This commit is contained in:
2026-03-24 20:21:56 -04:00
parent 6585c5c20b
commit 09af5437e7
14 changed files with 212 additions and 21 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
Binaries
Intermediate

29
SaneSlate.uplugin Normal file
View File

@@ -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"
}
]
}

View File

@@ -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",
});
}
}

View File

@@ -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

View File

@@ -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"

View File

@@ -1 +1,2 @@
#include "SaneSlateLog.h"
#include "SaneSlateLog.h"

View File

@@ -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() );

View File

@@ -0,0 +1 @@
#include "SaneSlateModule.h"

View File

@@ -0,0 +1,10 @@
#pragma once
#include "Modules/ModuleInterface.h"
class FSaneSlateModule : public IModuleInterface
{
public:
// void StartupModule() override;
// void ShutdownModule() override;
};

View File

@@ -0,0 +1,10 @@
using UnrealBuildTool;
public class SaneSlateEditor : ModuleRules
{
public SaneSlateEditor(ReadOnlyTargetRules Target) : base(Target)
{
}
}

View File

@@ -0,0 +1 @@
#include "SaneSlateEditorLog.h"

View File

@@ -0,0 +1 @@
#pragma once

View File

@@ -0,0 +1,2 @@
#include "SaneSlateEditorModule.cpp"

View File

@@ -0,0 +1,2 @@
#pragma once