From 09af5437e71416bcb94fbbe2a54560be6d0e5932 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 24 Mar 2026 20:21:56 -0400 Subject: [PATCH] skeleton --- .gitignore | 2 + SaneSlate.uplugin | 29 ++++++++ Source/SaneSlate/SaneSlate.build.cs | 66 +++++++++++++++++++ Source/SaneSlate/SaneSlateCommon.h | 51 ++++++++++++++ Source/SaneSlate/SaneSlateEngineMinimal.h | 25 +++++++ Source/SaneSlate/SaneSlateLog.cpp | 3 +- Source/SaneSlate/SaneSlateLog.h | 30 +++------ Source/SaneSlate/SaneSlateModule.cpp | 1 + Source/SaneSlate/SaneSlateModule.h | 10 +++ .../SaneSlateEditor/SaneSlateEditor.build.cs | 10 +++ Source/SaneSlateEditor/SaneSlateEditorLog.cpp | 1 + Source/SaneSlateEditor/SaneSlateEditorLog.h | 1 + .../SaneSlateEditor/SaneSlateEditorModule.cpp | 2 + .../SaneSlateEditor/SaneSlateEditorModule.h | 2 + 14 files changed, 212 insertions(+), 21 deletions(-) create mode 100644 .gitignore create mode 100644 SaneSlate.uplugin create mode 100644 Source/SaneSlate/SaneSlate.build.cs create mode 100644 Source/SaneSlate/SaneSlateCommon.h create mode 100644 Source/SaneSlate/SaneSlateEngineMinimal.h create mode 100644 Source/SaneSlate/SaneSlateModule.cpp create mode 100644 Source/SaneSlate/SaneSlateModule.h create mode 100644 Source/SaneSlateEditor/SaneSlateEditor.build.cs create mode 100644 Source/SaneSlateEditor/SaneSlateEditorLog.cpp create mode 100644 Source/SaneSlateEditor/SaneSlateEditorLog.h create mode 100644 Source/SaneSlateEditor/SaneSlateEditorModule.cpp create mode 100644 Source/SaneSlateEditor/SaneSlateEditorModule.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5f0065b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Binaries +Intermediate diff --git a/SaneSlate.uplugin b/SaneSlate.uplugin new file mode 100644 index 0000000..eeb46d5 --- /dev/null +++ b/SaneSlate.uplugin @@ -0,0 +1,29 @@ +{ + "FileVersion": 3, + "Version": 0.1, + "VersionName": "0.1", + "FriendlyName": "Sane Slate", + "Description": "Slate for humans.", + "Category": "UI", + "CreatedBy": "Edward R. Gonzalez", + "CreatedByURL": "https://github.com/Ed94/SaneSlate", + "DocsURL": "https://github.com/Ed94/SaneSlate", + "MarketplaceURL": "", + "SupportURL": "", + "CanContainContent": false, + "IsBetaVersion": false, + "IsExperimentalVersion": true, + "Modules": + [ + { + "Name": "SaneSlate", + "Type": "Runtime", + "LoadingPhase": "Default" + }, + { + "Name": "SaneSlateEditor", + "Type": "Editor", + "LoadingPhase": "Default" + } + ] +} diff --git a/Source/SaneSlate/SaneSlate.build.cs b/Source/SaneSlate/SaneSlate.build.cs new file mode 100644 index 0000000..75c2ff0 --- /dev/null +++ b/Source/SaneSlate/SaneSlate.build.cs @@ -0,0 +1,66 @@ +using UnrealBuildTool; + +public class SaneSlate : ModuleRules +{ + public static void SetDevConfig(ReadOnlyTargetRules Target, ModuleRules rules) + { + // Only use the configuration if building in editor (only for development) + if (Target.bCompileAgainstEditor == false) { + return; + } + rules.bValidateCircularDependencies = true; + rules.bUseUnity = false; + rules.bMergeUnityFiles = false; + var Kilobyte = 1024; + rules.NumIncludedBytesPerUnityCPPOverride = Kilobyte * 32; + rules.IWYUSupport = IWYUSupport.None; + rules.PCHUsage = PCHUsageMode.NoPCHs; + rules.MinFilesUsingPrecompiledHeaderOverride = 1; + rules.OptimizeCode = CodeOptimization.Never; + // rules.MinCpuArchX64 = MinimumCpuArchitectureX64.AVX512; + rules.bDisableStaticAnalysis = true; + rules.bEnableExceptions = false; + rules.bEnableBufferSecurityChecks = false; + rules.bEnableNonInlinedGenCppWarnings = false; + rules.bIgnoreUnresolvedSymbols = false; + rules.ShadowVariableWarningLevel = WarningLevel.Error; + rules.bEnableUndefinedIdentifierWarnings = false; + rules.bWarningsAsErrors = true; + rules.bCodeCoverage = false; + // Not in 5.3 + // rules.bValidateFormatStrings = false; + // rules.bValidateInternalApi = false; + // rules.UndefinedIdentifierWarningLevel = UnrealBuildTool.WarningLevel.Off; + } + + public static void SetupFolderModuleIncludePath(ModuleRules rules) + { + rules.bAddDefaultIncludePaths = false; + + rules.PrivateIncludePaths.AddRange(new string [] { + rules.ModuleDirectory, + }); + rules.PublicIncludePaths.AddRange(new string [] { + rules.ModuleDirectory + "/..", + }); + } + + public SaneSlate(ReadOnlyTargetRules Target) : base(Target) + { + IncludeOrderVersion = EngineIncludeOrderVersion.Latest; + SetDevConfig(Target, this); + SetupFolderModuleIncludePath(this); + + PublicDependencyModuleNames.AddRange(new string[] { + "Core", + "CoreUObject", + "Engine", + "InputCore", + "Json", + "JsonUtilities", + "SlateCore", + "Slate", + "UMG", + }); + } +} diff --git a/Source/SaneSlate/SaneSlateCommon.h b/Source/SaneSlate/SaneSlateCommon.h new file mode 100644 index 0000000..b0e82a6 --- /dev/null +++ b/Source/SaneSlate/SaneSlateCommon.h @@ -0,0 +1,51 @@ +#pragma once + +#include "SaneSlateEngineMinimal.h" + +#pragma region Engine Forwards +class FJsonObject; +class FJsonValue; + +class FProperty; +class FBoolProperty; +class FByteProperty; +class FEnumProperty; +class FIntProperty; +class FInt8Property; +class FInt64Property; +class FUInt32Property; +class FFloatProperty; +class FDoubleProperty; +class FStrProperty; +class FNameProperty; +class FTextProperty; +class FInterfaceProperty; +class FStructProperty; +class FObjectProperty; +class FClassProperty; +class FArrayProperty; +class FMapProperty; +class FSetProperty; + +class FSubsystemCollectionBase; + +class SPanel; +class SScrollBox; +class STextBlock; +class SVerticalBox; +class SWidget; +class SWindow; + +class UObject; +#pragma endregion Engine Forwards + +#pragma region Plugin Forwards + +#pragma endregion Plugin Forwards + +#ifndef SaneSlate_NS +#define SaneSlate_NS_BEGIN namespace SaneSlate { +#define SaneSlate_NS_END } +#define SaneSlate_NS SaneSlate:: +#endif + diff --git a/Source/SaneSlate/SaneSlateEngineMinimal.h b/Source/SaneSlate/SaneSlateEngineMinimal.h new file mode 100644 index 0000000..f66c423 --- /dev/null +++ b/Source/SaneSlate/SaneSlateEngineMinimal.h @@ -0,0 +1,25 @@ +#pragma once + +/*---------------------------------------------------------------------------- + Low level includes. +----------------------------------------------------------------------------*/ + +#include "CoreTypes.h" + +/*---------------------------------------------------------------------------- + Forward declarations +----------------------------------------------------------------------------*/ + +#include "CoreFwd.h" +#include "UObject/UObjectHierarchyFwd.h" +#include "Containers/ContainersFwd.h" + +/*---------------------------------------------------------------------------- + Commonly used headers +----------------------------------------------------------------------------*/ + +#include "Misc/VarArgs.h" +#include "Logging/LogVerbosity.h" +#include "UObject/ObjectMacros.h" +#include "Delegates/Delegate.h" +#include "Delegates/DelegateCombinations.h" diff --git a/Source/SaneSlate/SaneSlateLog.cpp b/Source/SaneSlate/SaneSlateLog.cpp index f4dadf4..1f6da55 100644 --- a/Source/SaneSlate/SaneSlateLog.cpp +++ b/Source/SaneSlate/SaneSlateLog.cpp @@ -1 +1,2 @@ -#include "SaneSlateLog.h" \ No newline at end of file +#include "SaneSlateLog.h" + diff --git a/Source/SaneSlate/SaneSlateLog.h b/Source/SaneSlate/SaneSlateLog.h index b19c32e..10b193c 100644 --- a/Source/SaneSlate/SaneSlateLog.h +++ b/Source/SaneSlate/SaneSlateLog.h @@ -59,18 +59,6 @@ using FLogCategoryParam = FNoLoggingCategory; using FLogCategoryParam = FLogCategoryBase; #endif -struct LogParams -{ - bool bToScreen; - bool bDisplayNewerOnTop; - uint64 ScreenMsgKey; - bool DumpStack; - FLogCategoryParam& Category; - int32 Line; - ANSICHAR const* File; - ANSICHAR const* Func; -}; - inline void LogToFile(FString Message , ELogV Verbosity = ELogV::Log @@ -82,11 +70,9 @@ void LogToFile(FString Message { #if !UE_BUILD_SHIPPING && !NO_LOGGING ELogVerbosity::Type EngineVerbosity = (ELogVerbosity::Type) Verbosity; - static UE::Logging::Private::FStaticBasicLogDynamicData LOG_Dynamic; static UE::Logging::Private::FStaticBasicLogRecord LOG_Static(TEXT("%s -- %hs %hs(%d)"), File, Line, EngineVerbosity, LOG_Dynamic); - if ((EngineVerbosity & ELogVerbosity::VerbosityMask) <= ELogVerbosity::COMPILED_IN_MINIMUM_VERBOSITY) { if ((EngineVerbosity & ELogVerbosity::VerbosityMask) <= Category.GetVerbosity()) @@ -102,15 +88,19 @@ void LogToFile(FString Message #endif } + +struct LogParams { + bool bToScreen = false; + float TimeToDisplay = 5.f; + FColor DisplayColor = FColor::Cyan; + bool bDisplayNewerOnTop = true; + uint64 ScreenMsgKey = -1; + bool DumpStack = false; +}; void Log(FString Message , ELogV Verbosity = ELogV::Log - , bool bToScreen = false - , float TimeToDisplay = 5.f - , FColor DisplayColor = FColor::Cyan - , bool bDisplayNewerOnTop = true - , uint64 ScreenMsgKey = -1 - , bool DumpStack = false , FLogCategoryParam& Category = LogSaneSlate + , LogParams Params = {} , int32 Line = __builtin_LINE() , ANSICHAR const* File = __builtin_FILE() , ANSICHAR const* Func = __builtin_FUNCTION() ); diff --git a/Source/SaneSlate/SaneSlateModule.cpp b/Source/SaneSlate/SaneSlateModule.cpp new file mode 100644 index 0000000..8f855d7 --- /dev/null +++ b/Source/SaneSlate/SaneSlateModule.cpp @@ -0,0 +1 @@ +#include "SaneSlateModule.h" \ No newline at end of file diff --git a/Source/SaneSlate/SaneSlateModule.h b/Source/SaneSlate/SaneSlateModule.h new file mode 100644 index 0000000..2174f07 --- /dev/null +++ b/Source/SaneSlate/SaneSlateModule.h @@ -0,0 +1,10 @@ +#pragma once + +#include "Modules/ModuleInterface.h" + +class FSaneSlateModule : public IModuleInterface +{ +public: + // void StartupModule() override; + // void ShutdownModule() override; +}; diff --git a/Source/SaneSlateEditor/SaneSlateEditor.build.cs b/Source/SaneSlateEditor/SaneSlateEditor.build.cs new file mode 100644 index 0000000..6777454 --- /dev/null +++ b/Source/SaneSlateEditor/SaneSlateEditor.build.cs @@ -0,0 +1,10 @@ +using UnrealBuildTool; + + +public class SaneSlateEditor : ModuleRules +{ + public SaneSlateEditor(ReadOnlyTargetRules Target) : base(Target) + { + + } +} diff --git a/Source/SaneSlateEditor/SaneSlateEditorLog.cpp b/Source/SaneSlateEditor/SaneSlateEditorLog.cpp new file mode 100644 index 0000000..116a5ab --- /dev/null +++ b/Source/SaneSlateEditor/SaneSlateEditorLog.cpp @@ -0,0 +1 @@ +#include "SaneSlateEditorLog.h" \ No newline at end of file diff --git a/Source/SaneSlateEditor/SaneSlateEditorLog.h b/Source/SaneSlateEditor/SaneSlateEditorLog.h new file mode 100644 index 0000000..73b4b86 --- /dev/null +++ b/Source/SaneSlateEditor/SaneSlateEditorLog.h @@ -0,0 +1 @@ +#pragma once diff --git a/Source/SaneSlateEditor/SaneSlateEditorModule.cpp b/Source/SaneSlateEditor/SaneSlateEditorModule.cpp new file mode 100644 index 0000000..53ed59c --- /dev/null +++ b/Source/SaneSlateEditor/SaneSlateEditorModule.cpp @@ -0,0 +1,2 @@ +#include "SaneSlateEditorModule.cpp" + diff --git a/Source/SaneSlateEditor/SaneSlateEditorModule.h b/Source/SaneSlateEditor/SaneSlateEditorModule.h new file mode 100644 index 0000000..079a383 --- /dev/null +++ b/Source/SaneSlateEditor/SaneSlateEditorModule.h @@ -0,0 +1,2 @@ +#pragma once +