Adds plugins
This commit is contained in:
76
Plugins/DarkerNodes/Source/DarkerNodes/DarkerNodes.Build.cs
Normal file
76
Plugins/DarkerNodes/Source/DarkerNodes/DarkerNodes.Build.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
using System.IO;
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class DarkerNodes : ModuleRules
|
||||
{
|
||||
public DarkerNodes(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicIncludePaths.AddRange(
|
||||
new string[] { }
|
||||
);
|
||||
|
||||
PrivateIncludePaths.AddRange(
|
||||
new string[] { }
|
||||
);
|
||||
|
||||
PublicDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"Core"
|
||||
}
|
||||
);
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"CoreUObject",
|
||||
"RenderCore",
|
||||
"Engine",
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
"InputCore",
|
||||
"UnrealEd",
|
||||
"EditorStyle",
|
||||
"PIEPreviewDeviceProfileSelector",
|
||||
"Projects",
|
||||
#if UE_4_26_OR_LATER
|
||||
"DeveloperSettings",
|
||||
#endif
|
||||
"NiagaraEditor",
|
||||
|
||||
//Check usefulness
|
||||
"SceneOutliner",
|
||||
"ToolMenus",
|
||||
"HierarchicalLODUtilities",
|
||||
"ApplicationCore",
|
||||
}
|
||||
);
|
||||
|
||||
DynamicallyLoadedModuleNames.AddRange(
|
||||
new string[]
|
||||
{ }
|
||||
);
|
||||
|
||||
|
||||
// DesktopPlatform is only available for Editor and Program targets (running on a desktop platform)
|
||||
bool IsDesktopPlatformType = Target.Platform == UnrealBuildTool.UnrealTargetPlatform.Win32
|
||||
|| Target.Platform == UnrealBuildTool.UnrealTargetPlatform.Win64
|
||||
|| Target.Platform == UnrealBuildTool.UnrealTargetPlatform.Mac
|
||||
|| Target.Platform == UnrealBuildTool.UnrealTargetPlatform.Linux;
|
||||
if (Target.Type == TargetType.Editor || (Target.Type == TargetType.Program && IsDesktopPlatformType))
|
||||
{
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"DesktopPlatform",
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
508
Plugins/DarkerNodes/Source/DarkerNodes/Private/Colorizer.cpp
Normal file
508
Plugins/DarkerNodes/Source/DarkerNodes/Private/Colorizer.cpp
Normal file
@@ -0,0 +1,508 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
|
||||
#include "EditorStyleSet.h"
|
||||
#include "Interfaces/IPluginManager.h"
|
||||
#include "Classes/EditorStyleSettings.h"
|
||||
#include "SettingsEditor/Public/ISettingsEditorModule.h"
|
||||
#include "NiagaraEditorStyle.h"
|
||||
|
||||
FColorizer::FColorizer()
|
||||
{
|
||||
LoadDatabase();
|
||||
|
||||
DarkerNodesSettings = GetMutableDefault<UDarkerNodesSettings>();
|
||||
|
||||
DarkerNodesSettings->OnSettingChanged().AddRaw(this, &FColorizer::Reload);
|
||||
FCoreDelegates::OnPostEngineInit.AddLambda([this]()
|
||||
{
|
||||
if (DarkerNodesSettings->UpdateMaterials || DarkerNodesSettings->PluginVersionUpdate != CurrentPluginVersion)
|
||||
{
|
||||
DarkerNodesSettings->UpdateMaterials = false;
|
||||
DarkerNodesSettings->PluginVersionUpdate = CurrentPluginVersion;
|
||||
DarkerNodesSettings->SaveConfig();
|
||||
BrushDatabase->UpdateAndSaveMaterials();
|
||||
}
|
||||
});
|
||||
|
||||
EditorStyle = static_cast<FSlateStyleSet*>(&FEditorStyle::Get());
|
||||
CoreStyle = static_cast<FSlateStyleSet*>(const_cast<ISlateStyle*>(&FCoreStyle::Get()));
|
||||
NiagaraStyle = static_cast<FSlateStyleSet*>(const_cast<ISlateStyle*>(&FNiagaraEditorStyle::Get()));
|
||||
PluginDirectory = IPluginManager::Get().FindPlugin(TEXT("DarkerNodes"))->GetBaseDir();
|
||||
ThemeDirectory = PluginDirectory + FString("/Resources/Theme");
|
||||
FontsDirectory = PluginDirectory + FString("/Resources/Fonts");
|
||||
GlobalSettingsFile = PluginDirectory + "/Settings.ini";
|
||||
|
||||
if (DarkerNodesSettings->UseGlobalSettings)
|
||||
{
|
||||
if (FPaths::FileExists(GlobalSettingsFile))
|
||||
{
|
||||
DarkerNodesSettings->LoadConfig(nullptr, *GlobalSettingsFile);
|
||||
}
|
||||
}
|
||||
|
||||
ReloadStyle();
|
||||
}
|
||||
|
||||
void FColorizer::LoadDatabase()
|
||||
{
|
||||
BrushDatabase = NewObject<UBrushDatabase>();
|
||||
|
||||
BrushDatabase->CreateSlateBrush("GreyBase", "SolidColor.SolidColor");
|
||||
BrushDatabase->CreateSlateBrush("GreyDark", "SolidColor.SolidColor");
|
||||
BrushDatabase->CreateSlateBrush("GreyLight", "SolidColor.SolidColor");
|
||||
BrushDatabase->CreateSlateBrush("Debug", "SolidColor.SolidColor");
|
||||
|
||||
BrushDatabase->CreateSlateBrush("HoverDark", "SolidColor.SolidColor");
|
||||
BrushDatabase->CreateSlateBrush("HoverBase", "SolidColor.SolidColor");
|
||||
BrushDatabase->CreateSlateBrush("HoverBaseBright", "SolidColor.SolidColor");
|
||||
|
||||
BrushDatabase->CreateSlateBrush("Primary", "SolidColor.SolidColor");
|
||||
BrushDatabase->CreateSlateColor("TextColor");
|
||||
BrushDatabase->CreateSlateBrush("ScrollbarColor", "SolidColor.SolidColor");
|
||||
BrushDatabase->CreateSlateBrush("MainWindowColor", "SolidColor.SolidColor");
|
||||
BrushDatabase->CreateSlateBrush("ChildWindowColor", "SolidColor.SolidColor");
|
||||
|
||||
BrushDatabase->CreateSlateColor("GridLine");
|
||||
BrushDatabase->CreateSlateColor("GridRule");
|
||||
BrushDatabase->CreateSlateColor("GridCenter");
|
||||
|
||||
BrushDatabase->CreateSlateBrush("Button", "Button.Button");
|
||||
BrushDatabase->CreateSlateBrush("Button_Hovered", "Button.Button");
|
||||
BrushDatabase->CreateSlateBrush("Button_Pressed", "Button.Button");
|
||||
BrushDatabase->CreateSlateBrush("Button_Disabled", "Button.Button");
|
||||
|
||||
BrushDatabase->CreateSlateBrush("Button_Start", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_Start_Hovered", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_Start_Pressed", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_Start_Checked", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_Start_Hovered_Checked", "ButtonCut.ButtonCut");
|
||||
|
||||
BrushDatabase->CreateSlateBrush("Button_Middle", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_Middle_Hovered", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_Middle_Pressed", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_Middle_Checked", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_Middle_Hovered_Checked", "ButtonCut.ButtonCut");
|
||||
|
||||
BrushDatabase->CreateSlateBrush("Button_End", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_End_Hovered", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_End_Pressed", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_End_Checked", "ButtonCut.ButtonCut");
|
||||
BrushDatabase->CreateSlateBrush("Button_End_Hovered_Checked", "ButtonCut.ButtonCut");
|
||||
|
||||
BrushDatabase->CreateSlateBrush("RegularNode_body", "Box.Box");
|
||||
BrushDatabase->CreateSlateBrush("VarNode_body", "Box.Box");
|
||||
BrushDatabase->CreateSlateBrush("RegularNode_shadow_selected", "Box.Box");
|
||||
BrushDatabase->CreateSlateBrush("VarNode_shadow_selected", "Box.Box");
|
||||
BrushDatabase->CreateSlateBrush("RegularNode_color_spill", "HeaderBox.HeaderBox");
|
||||
|
||||
BrushDatabase->CreateSlateBrush("PanelDark", "Panel.Panel");
|
||||
}
|
||||
|
||||
void FColorizer::ResetColors()
|
||||
{
|
||||
GreyDark = FColor(20, 20, 20);
|
||||
GreyBase = FColor(40, 40, 40);
|
||||
GreyLight = FColor(120, 120, 120);
|
||||
|
||||
TextColor = FColor(200, 200, 200);
|
||||
TextShadow = FColor(10, 10, 10);
|
||||
|
||||
ButtonPrimary = FColor(0, 96, 178);
|
||||
ButtonSuccess = FColor(58, 161, 17);
|
||||
ButtonInfo = FColor(0, 96, 178);
|
||||
ButtonWarning = FColor(223, 179, 0);
|
||||
ButtonDanger = FColor(178, 0, 0);
|
||||
}
|
||||
|
||||
void FColorizer::ReloadStyle()
|
||||
{
|
||||
if (!DarkerNodesSettings->MasterActivate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ResetColors();
|
||||
|
||||
switch (DarkerNodesSettings->ThemeLight)
|
||||
{
|
||||
case EThemeLight::Dark:
|
||||
GreyBase = OffsetColor(GreyBase, 20);
|
||||
GreyDark = OffsetColor(GreyDark, 20);
|
||||
GreyLight = OffsetColor(GreyLight, 20);
|
||||
break;
|
||||
case EThemeLight::Darker:
|
||||
break;
|
||||
case EThemeLight::Darkest:
|
||||
GreyBase = OffsetColor(GreyBase, -20);
|
||||
GreyDark = OffsetColor(GreyDark, -10);
|
||||
GreyLight = OffsetColor(GreyLight, -10);
|
||||
break;
|
||||
}
|
||||
|
||||
if (DarkerNodesSettings->LightTheme)
|
||||
{
|
||||
GreyBase = InvertLight(GreyBase);
|
||||
GreyDark = InvertLight(GreyDark);
|
||||
GreyLight = InvertLight(GreyLight);
|
||||
TextColor = InvertLight(TextColor);
|
||||
TextShadow = InvertLight(TextShadow);
|
||||
ImageColor = InvertLight(ImageColor);
|
||||
}
|
||||
|
||||
const FColor WarmLayer = FColor(229, 110, 23);
|
||||
const FColor CoolLayer = FColor(23, 141, 229);
|
||||
|
||||
switch (DarkerNodesSettings->ThemeTemperature)
|
||||
{
|
||||
case EThemeTemperature::Cooler:
|
||||
GreyBase = MixColor(GreyBase, CoolLayer, 0.05);
|
||||
GreyDark = MixColor(GreyDark, CoolLayer, 0.05);
|
||||
GreyLight = MixColor(GreyLight, CoolLayer, 0.05);
|
||||
break;
|
||||
case EThemeTemperature::Cool:
|
||||
GreyBase = MixColor(GreyBase, CoolLayer, 0.025);
|
||||
GreyDark = MixColor(GreyDark, CoolLayer, 0.025);
|
||||
GreyLight = MixColor(GreyLight, CoolLayer, 0.025);
|
||||
break;
|
||||
case EThemeTemperature::Normal:
|
||||
break;
|
||||
case EThemeTemperature::Warm:
|
||||
GreyBase = MixColor(GreyBase, WarmLayer, 0.025);
|
||||
GreyDark = MixColor(GreyDark, WarmLayer, 0.025);
|
||||
GreyLight = MixColor(GreyLight, WarmLayer, 0.025);
|
||||
break;
|
||||
case EThemeTemperature::Warmer:
|
||||
GreyBase = MixColor(GreyBase, WarmLayer, 0.05);
|
||||
GreyDark = MixColor(GreyDark, WarmLayer, 0.05);
|
||||
GreyLight = MixColor(GreyLight, WarmLayer, 0.05);
|
||||
break;
|
||||
}
|
||||
|
||||
// Cyan = Orange + 180
|
||||
// Purple = Orange - 100
|
||||
// Green = Orange + 80
|
||||
// Red = Orange - 25
|
||||
|
||||
const FColor White = FColor(126, 126, 126);
|
||||
const FColor Orange = FColor(229, 110, 23);
|
||||
const FColor Cyan = FColor(23, 141, 229);
|
||||
const FColor Red = FColor(229, 25, 23);
|
||||
const FColor Purple = FColor(178, 23, 229);
|
||||
const FColor Green = FColor(74, 229, 23);
|
||||
|
||||
switch (DarkerNodesSettings->PrimaryColor)
|
||||
{
|
||||
case EPrimaryColor::White:
|
||||
Primary = White;
|
||||
break;
|
||||
case EPrimaryColor::Orange:
|
||||
Primary = Orange;
|
||||
break;
|
||||
case EPrimaryColor::Cyan:
|
||||
Primary = Cyan;
|
||||
break;
|
||||
case EPrimaryColor::Red:
|
||||
Primary = Red;
|
||||
break;
|
||||
case EPrimaryColor::Purple:
|
||||
Primary = Purple;
|
||||
break;
|
||||
case EPrimaryColor::Green:
|
||||
Primary = Green;
|
||||
break;
|
||||
}
|
||||
|
||||
if (DarkerNodesSettings->UseGreyCustomization)
|
||||
{
|
||||
GreyBase = DarkerNodesSettings->GreyBase;
|
||||
GreyDark = DarkerNodesSettings->GreyDark;
|
||||
GreyLight = DarkerNodesSettings->GreyLight;
|
||||
}
|
||||
|
||||
ScrollbarColor = GreyDark;
|
||||
MainWindowColor = GreyBase;
|
||||
ChildWindowColor = GreyBase;
|
||||
|
||||
RegularNodeBackground = MixColor(FColor::Black, GreyDark, 0.5f).WithAlpha(255 * 0.75f);
|
||||
RegularNodeBorder = MixColor(FColor::Black, GreyDark, 0.5f);
|
||||
|
||||
switch (DarkerNodesSettings->BlueprintVarNodeStyle)
|
||||
{
|
||||
case EBlueprintVarNodeStyle::DarkSolid:
|
||||
VarNodeBackground = MixColor(FColor::Black, GreyDark, 0.5f).WithAlpha(255 * 0.75f);
|
||||
VarNodeBorder = MixColor(FColor::Black, GreyDark, 0.5f);
|
||||
break;
|
||||
case EBlueprintVarNodeStyle::LightSolid:
|
||||
VarNodeBackground = GreyLight.WithAlpha(255 * 0.30f);
|
||||
VarNodeBorder = GreyLight;
|
||||
break;
|
||||
case EBlueprintVarNodeStyle::DarkGlass:
|
||||
VarNodeBackground = MixColor(FColor::Black, GreyDark, 0.5f).WithAlpha(255 * 0.30f);
|
||||
VarNodeBorder = MixColor(FColor::Black, GreyDark, 0.5f);
|
||||
break;
|
||||
case EBlueprintVarNodeStyle::LightGlass:
|
||||
VarNodeBackground = GreyLight.WithAlpha(255 * 0.10f);
|
||||
VarNodeBorder = GreyLight;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (DarkerNodesSettings->ButtonBorder)
|
||||
{
|
||||
case EButtonBorder::None:
|
||||
ButtonBorderColor = GreyDark;
|
||||
break;
|
||||
case EButtonBorder::Dark:
|
||||
ButtonBorderColor = MixColor(GreyDark, FColor::Black, 0.5f);
|
||||
break;
|
||||
case EButtonBorder::Light:
|
||||
ButtonBorderColor = MixColor(GreyDark, FColor::White, 0.1f);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!DarkerNodesSettings->DisableUMGGrid)
|
||||
{
|
||||
GridLineColor = MixColor(GreyDark, GreyBase, 0.5f);
|
||||
GridRuleColor = GreyBase;
|
||||
GridCenterColor = MixColor(GreyBase, GreyLight, DarkerNodesSettings->OriginAxisOpacity);
|
||||
}
|
||||
else
|
||||
{
|
||||
GridLineColor = GreyDark;
|
||||
GridRuleColor = GreyDark;
|
||||
GridCenterColor = MixColor(GreyDark, GreyLight, DarkerNodesSettings->OriginAxisOpacity);
|
||||
}
|
||||
|
||||
if (DarkerNodesSettings->UseColorCustomization)
|
||||
{
|
||||
Primary = DarkerNodesSettings->CustomPrimaryColor;
|
||||
TextColor = DarkerNodesSettings->TextColor;
|
||||
ScrollbarColor = DarkerNodesSettings->ScrollbarColor;
|
||||
}
|
||||
|
||||
if (DarkerNodesSettings->UseWindowCustomization)
|
||||
{
|
||||
MainWindowColor = DarkerNodesSettings->MainWindowColor;
|
||||
ChildWindowColor = DarkerNodesSettings->ChildWindowColor;
|
||||
}
|
||||
|
||||
if (DarkerNodesSettings->UseButtonColorCustomization)
|
||||
{
|
||||
ButtonBorderColor = DarkerNodesSettings->ButtonBorderColor;
|
||||
ButtonPrimary = DarkerNodesSettings->ButtonPrimary;
|
||||
ButtonSuccess = DarkerNodesSettings->ButtonSuccess;
|
||||
ButtonInfo = DarkerNodesSettings->ButtonInfo;
|
||||
ButtonWarning = DarkerNodesSettings->ButtonWarning;
|
||||
ButtonDanger = DarkerNodesSettings->ButtonDanger;
|
||||
}
|
||||
|
||||
if (DarkerNodesSettings->UseBlueprintColorCustomization)
|
||||
{
|
||||
GridLineColor = DarkerNodesSettings->GridLineColor;
|
||||
GridRuleColor = DarkerNodesSettings->GridRuleColor;
|
||||
GridCenterColor = DarkerNodesSettings->GridCenterColor;
|
||||
|
||||
RegularNodeBackground = DarkerNodesSettings->RegularNodeBackground;
|
||||
RegularNodeBorder = DarkerNodesSettings->RegularNodeBorder;
|
||||
VarNodeBackground = DarkerNodesSettings->VarNodeBackground;
|
||||
VarNodeBorder = DarkerNodesSettings->VarNodeBorder;
|
||||
}
|
||||
|
||||
HoverDark = MixColor(GreyDark, Primary, 0.1);
|
||||
HoverBase = MixColor(GreyBase, Primary, 0.1);
|
||||
HoverBaseBright = MixColor(GreyBase, Primary, 0.5);
|
||||
|
||||
if (DarkerNodesSettings->OverwriteColors)
|
||||
{
|
||||
if (!DarkerNodesSettings->UseGreyCustomization)
|
||||
{
|
||||
DarkerNodesSettings->GreyBase = GreyBase;
|
||||
DarkerNodesSettings->GreyDark = GreyDark;
|
||||
DarkerNodesSettings->GreyLight = GreyLight;
|
||||
}
|
||||
|
||||
if (!DarkerNodesSettings->UseColorCustomization)
|
||||
{
|
||||
DarkerNodesSettings->CustomPrimaryColor = Primary;
|
||||
DarkerNodesSettings->TextColor = TextColor;
|
||||
DarkerNodesSettings->ScrollbarColor = ScrollbarColor;
|
||||
}
|
||||
|
||||
if (!DarkerNodesSettings->UseWindowCustomization)
|
||||
{
|
||||
DarkerNodesSettings->MainWindowColor = MainWindowColor;
|
||||
DarkerNodesSettings->ChildWindowColor = ChildWindowColor;
|
||||
}
|
||||
|
||||
if (!DarkerNodesSettings->UseButtonColorCustomization)
|
||||
{
|
||||
DarkerNodesSettings->ButtonBorderColor = ButtonBorderColor;
|
||||
DarkerNodesSettings->ButtonPrimary = ButtonPrimary;
|
||||
DarkerNodesSettings->ButtonSuccess = ButtonSuccess;
|
||||
DarkerNodesSettings->ButtonInfo = ButtonInfo;
|
||||
DarkerNodesSettings->ButtonWarning = ButtonWarning;
|
||||
DarkerNodesSettings->ButtonDanger = ButtonDanger;
|
||||
}
|
||||
|
||||
if (!DarkerNodesSettings->UseBlueprintColorCustomization)
|
||||
{
|
||||
DarkerNodesSettings->GridLineColor = GridLineColor;
|
||||
DarkerNodesSettings->GridRuleColor = GridRuleColor;
|
||||
DarkerNodesSettings->GridCenterColor = GridCenterColor;
|
||||
|
||||
DarkerNodesSettings->RegularNodeBackground = RegularNodeBackground;
|
||||
DarkerNodesSettings->RegularNodeBorder = RegularNodeBorder;
|
||||
DarkerNodesSettings->VarNodeBackground = VarNodeBackground;
|
||||
DarkerNodesSettings->VarNodeBorder = VarNodeBorder;
|
||||
}
|
||||
}
|
||||
|
||||
ApplyParameters();
|
||||
}
|
||||
|
||||
void FColorizer::Color()
|
||||
{
|
||||
if (!DarkerNodesSettings->MasterActivate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!FApp::HasProjectName())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SaveStyleForUMG();
|
||||
|
||||
ColorText();
|
||||
ColorGraph();
|
||||
ColorButtons();
|
||||
ColorCheckbox();
|
||||
ColorPanel();
|
||||
ColorWindow();
|
||||
ColorIcons();
|
||||
ColorIconsCustom();
|
||||
|
||||
ReloadTextureResources();
|
||||
}
|
||||
|
||||
|
||||
void FColorizer::ReloadTextureResources()
|
||||
{
|
||||
if (FSlateApplication::IsInitialized())
|
||||
{
|
||||
FSlateApplication::Get().GetRenderer()->ReloadTextureResources();
|
||||
}
|
||||
}
|
||||
|
||||
#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION <= 25
|
||||
void FColorizer::Reload(FName PropertyName)
|
||||
#else
|
||||
void FColorizer::Reload(UObject* Object, struct FPropertyChangedEvent& Property)
|
||||
#endif
|
||||
{
|
||||
#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 25
|
||||
const FName PropertyName = Property.GetPropertyName();
|
||||
#endif
|
||||
|
||||
if (DarkerNodesSettings->ReloadDefaultStyle)
|
||||
{
|
||||
UE_LOG(LogTemp, Log, TEXT("[Darker Nodes] Reloading default style..."));
|
||||
UEditorStyleSettings* StyleSettings = GetMutableDefault<UEditorStyleSettings>();
|
||||
StyleSettings->SelectionColor = FLinearColor(0.728f, 0.364f, 0.003f);
|
||||
StyleSettings->PressedSelectionColor = FLinearColor(0.701f, 0.225f, 0.003f);
|
||||
StyleSettings->InactiveSelectionColor = FLinearColor(0.25f, 0.25f, 0.25f);
|
||||
StyleSettings->EditorChildWindowBackgroundOverride = FSlateBrush();
|
||||
StyleSettings->EditorMainWindowBackgroundOverride = FSlateBrush();
|
||||
StyleSettings->RegularColor = FLinearColor(0.035, 0.035, 0.035);
|
||||
StyleSettings->RuleColor = FLinearColor(0.008, 0.008, 0.008);
|
||||
StyleSettings->CenterColor = FLinearColor::Black;
|
||||
StyleSettings->bUseGrid = true;
|
||||
StyleSettings->SaveConfig();
|
||||
UE_LOG(LogTemp, Log, TEXT("[Darker Nodes] Done!"));
|
||||
|
||||
DarkerNodesSettings->ReloadDefaultStyle = false;
|
||||
}
|
||||
|
||||
if (PropertyName == "UseGlobalSettings")
|
||||
{
|
||||
if (DarkerNodesSettings->UseGlobalSettings)
|
||||
{
|
||||
if (FPaths::FileExists(GlobalSettingsFile))
|
||||
{
|
||||
DarkerNodesSettings->LoadConfig(nullptr, *GlobalSettingsFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
DarkerNodesSettings->SaveConfig(CPF_Config, *GlobalSettingsFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (DarkerNodesSettings->LoadGlobalSettings)
|
||||
{
|
||||
if (FPaths::FileExists(GlobalSettingsFile))
|
||||
{
|
||||
DarkerNodesSettings->LoadConfig(nullptr, *GlobalSettingsFile);
|
||||
}
|
||||
DarkerNodesSettings->LoadGlobalSettings = false;
|
||||
}
|
||||
|
||||
if (DarkerNodesSettings->ReloadTextureResources)
|
||||
{
|
||||
DarkerNodesSettings->ReloadTextureResources = false;
|
||||
ReloadTextureResources();
|
||||
}
|
||||
|
||||
if (DarkerNodesSettings->UpdateMaterials)
|
||||
{
|
||||
DarkerNodesSettings->UpdateMaterials = false;
|
||||
BrushDatabase->UpdateAndSaveMaterials();
|
||||
}
|
||||
|
||||
if (!DarkerNodesSettings->MasterActivate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ReloadStyle();
|
||||
|
||||
ISettingsEditorModule* SettingsEditorModule = FModuleManager::GetModulePtr<ISettingsEditorModule>("SettingsEditor");
|
||||
if (SettingsEditorModule)
|
||||
{
|
||||
UEditorStyleSettings* StyleSettings = GetMutableDefault<UEditorStyleSettings>();
|
||||
StyleSettings->SelectionColor = FLinearColor::FromSRGBColor(Primary);
|
||||
StyleSettings->PressedSelectionColor = FLinearColor::FromSRGBColor(Primary);
|
||||
StyleSettings->InactiveSelectionColor = FLinearColor::FromSRGBColor(HoverBase);
|
||||
StyleSettings->bUseGrid = !DarkerNodesSettings->DisableBlueprintGrid;
|
||||
StyleSettings->SaveConfig();
|
||||
|
||||
SettingsEditorModule->OnApplicationRestartRequired();
|
||||
}
|
||||
|
||||
DarkerNodesSettings->SaveConfig();
|
||||
|
||||
if (DarkerNodesSettings->UseGlobalSettings)
|
||||
{
|
||||
DarkerNodesSettings->SaveConfig(CPF_Config, *GlobalSettingsFile);
|
||||
}
|
||||
}
|
||||
|
||||
FColor FColorizer::MixColor(FColor Base, FColor Layer, float Alpha) const
|
||||
{
|
||||
Base.R = FMath::Lerp(Base.R, Layer.R, Alpha);
|
||||
Base.G = FMath::Lerp(Base.G, Layer.G, Alpha);
|
||||
Base.B = FMath::Lerp(Base.B, Layer.B, Alpha);
|
||||
return Base;
|
||||
}
|
||||
|
||||
FColor FColorizer::OffsetColor(FColor Base, int Offset)
|
||||
{
|
||||
Base.R += Offset;
|
||||
Base.G += Offset;
|
||||
Base.B += Offset;
|
||||
return Base;
|
||||
}
|
||||
143
Plugins/DarkerNodes/Source/DarkerNodes/Private/Colorizer.h
Normal file
143
Plugins/DarkerNodes/Source/DarkerNodes/Private/Colorizer.h
Normal file
@@ -0,0 +1,143 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
#include "DarkerNodesSettings.h"
|
||||
#include "Lib/BrushDatabase.h"
|
||||
#include "Styling/SlateStyle.h"
|
||||
|
||||
class FColorizer
|
||||
{
|
||||
public:
|
||||
FColorizer();
|
||||
void Color();
|
||||
|
||||
private:
|
||||
void ReloadStyle();
|
||||
void SaveStyleForUMG();
|
||||
void ApplyFonts() const;
|
||||
|
||||
// Colorizers
|
||||
void ColorText();
|
||||
void ColorGraph();
|
||||
void ColorButtons();
|
||||
void ColorCheckbox();
|
||||
void ColorPanel();
|
||||
void ColorWindow();
|
||||
void ColorIcons();
|
||||
void ColorIconsCustom();
|
||||
|
||||
static void ReloadTextureResources();
|
||||
|
||||
// Inside Var
|
||||
FString PluginDirectory;
|
||||
FString ThemeDirectory;
|
||||
FString FontsDirectory;
|
||||
FString GlobalSettingsFile;
|
||||
FSlateStyleSet* EditorStyle;
|
||||
FSlateStyleSet* CoreStyle;
|
||||
FSlateStyleSet* NiagaraStyle;
|
||||
|
||||
const FString CurrentPluginVersion = "2.6";
|
||||
|
||||
// Utilities
|
||||
void LoadDatabase();
|
||||
void ApplyParameters() const;
|
||||
|
||||
#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION <= 25
|
||||
void Reload(FName PropertyName);
|
||||
#else
|
||||
void Reload(UObject* Object, struct FPropertyChangedEvent& Property);
|
||||
#endif
|
||||
|
||||
|
||||
FColor MixColor(FColor Base, FColor Layer, float Alpha) const;
|
||||
FColor OffsetColor(FColor Base, int Offset);
|
||||
|
||||
void AddMenuIcon(FSlateStyleSet* StyleSet, FString Name, FString Location, FColor Color) const;
|
||||
void ApplyImageBrush(FSlateStyleSet* StyleSet, FName Name, FString Location, FVector2D Size) const;
|
||||
void ApplyImageBrush(FSlateStyleSet* StyleSet, FName Name, FString Location, FVector2D Size, FColor Color) const;
|
||||
|
||||
FSlateImageBrush ImageBrush(FString Location, FVector2D Size = FVector2D(16, 16)) const;
|
||||
FSlateImageBrush ImageBrush(FString Location, FVector2D Size, FColor Color) const;
|
||||
FSlateImageBrush ColorImageBrush(FColor Color = FColor::White, FVector2D Size = FVector2D(16, 16)) const;
|
||||
|
||||
void ApplyBoxBrush(FSlateStyleSet* StyleSet, FName Name, FString Location, FMargin Margin = 0.25, FColor Color = FColor::White) const;
|
||||
void ApplyColorBoxBrush(FSlateStyleSet* StyleSet, FName Name, FColor Color) const;
|
||||
FSlateBoxBrush BoxBrush(FString Location, FVector2D Size, FMargin Margin = 0.25, FColor Color = FColor::White) const;
|
||||
|
||||
void ApplyColorBorderBrush(FSlateStyleSet* StyleSet, FName Name, FColor Color) const;
|
||||
FSlateBorderBrush BorderBrush(FString Location, FMargin Margin = FMargin(0.25), FColor Color = FColor::White) const;
|
||||
FSlateBorderBrush ColorBorderBrush(FColor Color, FMargin Margin = FMargin(0.25)) const;
|
||||
|
||||
void ApplyCenterIcon(FSlateStyleSet* StyleSet, FName Name, FString Location, FVector2D Size = FVector2D(16, 16), FColor Color = FColor::White) const;
|
||||
FSlateBrush* CenterIcon(FName Name, FString Location, FVector2D Size = FVector2D(16, 16), FColor Color = FColor::White) const;
|
||||
|
||||
void ResetColors();
|
||||
FColor InvertLight(FColor Color);
|
||||
FSlateBrush* SlateBrush(FString Name) const;
|
||||
|
||||
int32 GetFontSize(int32 BaseSize) const;
|
||||
|
||||
// Icons
|
||||
|
||||
FVector2D Icon0 = FVector2D::ZeroVector;
|
||||
FVector2D Icon8 = FVector2D(8, 8);
|
||||
FVector2D Icon10 = FVector2D(10, 10);
|
||||
FVector2D Icon12 = FVector2D(12, 12);
|
||||
FVector2D Icon14 = FVector2D(14, 14);
|
||||
FVector2D Icon16 = FVector2D(16, 16);
|
||||
FVector2D Icon20 = FVector2D(20, 20);
|
||||
FVector2D Icon24 = FVector2D(24, 24);
|
||||
FVector2D Icon32 = FVector2D(32, 32);
|
||||
FVector2D Icon40 = FVector2D(40, 40);
|
||||
FVector2D Icon256 = FVector2D(256, 256);
|
||||
|
||||
// Colors
|
||||
|
||||
FColor DebugRed = FColor(255, 0, 0);
|
||||
FColor DebugGreen = FColor(0, 255, 0);
|
||||
FColor DebugBlue = FColor(0, 0, 255);
|
||||
|
||||
FColor GreyDark = FColor(20, 20, 20);
|
||||
FColor GreyBase = FColor(40, 40, 40);
|
||||
FColor GreyLight = FColor(120, 120, 120);
|
||||
|
||||
FColor Primary;
|
||||
FColor HoverDark;
|
||||
FColor HoverBase;
|
||||
FColor HoverBaseBright;
|
||||
|
||||
FColor TextColor = FColor(200, 200, 200);
|
||||
FColor TextShadow = FColor(10, 10, 10);
|
||||
FColor ScrollbarColor = FColor(20, 20, 20);
|
||||
FColor MainWindowColor = FColor(40, 40, 40);
|
||||
FColor ChildWindowColor = FColor(40, 40, 40);
|
||||
|
||||
FColor GridLineColor;
|
||||
FColor GridRuleColor;
|
||||
FColor GridCenterColor;
|
||||
|
||||
FColor RegularNodeBackground;
|
||||
FColor RegularNodeBorder;
|
||||
FColor VarNodeBackground;
|
||||
FColor VarNodeBorder;
|
||||
|
||||
FColor ButtonBorderColor = FColor::Transparent;
|
||||
FColor ButtonPrimary = FColor(0, 96, 178);
|
||||
FColor ButtonSuccess = FColor(58, 161, 17);
|
||||
FColor ButtonInfo = FColor(0, 96, 178);
|
||||
FColor ButtonWarning = FColor(223, 179, 0);
|
||||
FColor ButtonDanger = FColor(178, 0, 0);
|
||||
|
||||
FColor ImageColor = FColor(255, 255, 255);
|
||||
|
||||
FTextBlockStyle NormalText;
|
||||
|
||||
UBrushDatabase* BrushDatabase;
|
||||
UDarkerNodesSettings* DarkerNodesSettings;
|
||||
};
|
||||
@@ -0,0 +1,336 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
#include "Materials/MaterialInstanceDynamic.h"
|
||||
#include "PIEPreviewDeviceProfileSelector/Private/PIEPreviewWindowCoreStyle.h"
|
||||
|
||||
void FColorizer::ColorButtons()
|
||||
{
|
||||
if (!DarkerNodesSettings->UseCustomButton)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FMargin Margin;
|
||||
const FMargin SmallMargin = FMargin(2);
|
||||
|
||||
switch (DarkerNodesSettings->ButtonPadding)
|
||||
{
|
||||
case EButtonPadding::None:
|
||||
Margin = FMargin(2, 0);
|
||||
break;
|
||||
case EButtonPadding::Small:
|
||||
Margin = FMargin(2);
|
||||
break;
|
||||
case EButtonPadding::Normal:
|
||||
Margin = FMargin(4);
|
||||
break;
|
||||
case EButtonPadding::Big:
|
||||
Margin = FMargin(8);
|
||||
break;
|
||||
}
|
||||
|
||||
SlateBrush("Button")->SetImageSize(Icon16);
|
||||
SlateBrush("Button_Hovered")->SetImageSize(Icon16);
|
||||
SlateBrush("Button_Pressed")->SetImageSize(Icon16);
|
||||
|
||||
// Button
|
||||
const FButtonStyle Button =
|
||||
FButtonStyle()
|
||||
.SetNormal(*SlateBrush("Button"))
|
||||
.SetHovered(*SlateBrush("Button_Hovered"))
|
||||
.SetPressed(*SlateBrush("Button_Pressed"))
|
||||
.SetDisabled(*SlateBrush("Button_Disabled"))
|
||||
.SetNormalPadding(Margin)
|
||||
.SetPressedPadding(Margin);
|
||||
CoreStyle->Set("Button", Button);
|
||||
|
||||
const FComboButtonStyle ComboButton =
|
||||
FComboButtonStyle()
|
||||
.SetButtonStyle(Button)
|
||||
.SetDownArrowImage(ImageBrush("/Elements/Button/ComboArrow.png", Icon8))
|
||||
.SetMenuBorderBrush(*SlateBrush("Button"))
|
||||
.SetMenuBorderPadding(Margin);
|
||||
CoreStyle->Set("ComboButton", ComboButton);
|
||||
|
||||
const FComboBoxStyle ComboBox = FComboBoxStyle()
|
||||
.SetComboButtonStyle(ComboButton);
|
||||
CoreStyle->Set("ComboBox", ComboBox);
|
||||
|
||||
|
||||
EditorStyle->Set("FilePath.FolderButton", Button);
|
||||
EditorStyle->Set("PropertyEditor.AssetComboStyle", Button);
|
||||
|
||||
// Scrollbar
|
||||
|
||||
FScrollBarStyle ScrollBar = CoreStyle->GetWidgetStyle<FScrollBarStyle>("ScrollBar");
|
||||
|
||||
if (DarkerNodesSettings->UseCustomScrollbar)
|
||||
{
|
||||
ScrollBar =
|
||||
FScrollBarStyle()
|
||||
.SetVerticalTopSlotImage(ColorImageBrush(GreyBase, Icon8))
|
||||
.SetVerticalBottomSlotImage(ColorImageBrush(GreyBase, Icon8))
|
||||
.SetHorizontalTopSlotImage(ColorImageBrush(GreyBase, Icon8))
|
||||
.SetHorizontalBottomSlotImage(ColorImageBrush(GreyBase, Icon8))
|
||||
.SetNormalThumbImage(*SlateBrush("ScrollbarColor"))
|
||||
.SetDraggedThumbImage(*SlateBrush("ScrollbarColor"))
|
||||
.SetHoveredThumbImage(*SlateBrush("ScrollbarColor"));
|
||||
}
|
||||
|
||||
CoreStyle->Set("Scrollbar", ScrollBar);
|
||||
EditorStyle->Set("Scrollbar", ScrollBar);
|
||||
|
||||
|
||||
// Textbox
|
||||
|
||||
const FEditableTextBoxStyle NormalEditableTextBoxStyle =
|
||||
FEditableTextBoxStyle()
|
||||
.SetFont(NormalText.Font)
|
||||
.SetBackgroundImageNormal(*SlateBrush("Button"))
|
||||
.SetBackgroundImageHovered(*SlateBrush("Button_Hovered"))
|
||||
.SetBackgroundImageFocused(*SlateBrush("Button_Hovered"))
|
||||
.SetBackgroundImageReadOnly(*SlateBrush("Button_Disabled"))
|
||||
.SetScrollBarStyle(ScrollBar)
|
||||
.SetForegroundColor(*BrushDatabase->GetSlateColor("TextColor"));
|
||||
CoreStyle->Set("NormalEditableTextBox", NormalEditableTextBoxStyle);
|
||||
CoreStyle->Set("SpecialEditableTextBox", NormalEditableTextBoxStyle);
|
||||
NiagaraStyle->Set("NiagaraEditor.ParameterEditableTextBox", NormalEditableTextBoxStyle);
|
||||
|
||||
EditorStyle->Set("EditableTextBox.Background.Normal", SlateBrush("Button"));
|
||||
EditorStyle->Set("EditableTextBox.Background.Hovered", SlateBrush("Button_Hovered"));
|
||||
EditorStyle->Set("EditableTextBox.Background.Focused", SlateBrush("Button_Hovered"));
|
||||
EditorStyle->Set("EditableTextBox.Background.ReadOnly", SlateBrush("Button_Disabled"));
|
||||
|
||||
const FSpinBoxStyle SpinBox =
|
||||
FSpinBoxStyle()
|
||||
.SetBackgroundBrush(*SlateBrush("Button"))
|
||||
.SetHoveredBackgroundBrush(*SlateBrush("Button_Hovered"))
|
||||
.SetActiveFillBrush(*SlateBrush("Button_Hovered"))
|
||||
.SetInactiveFillBrush(*SlateBrush("Button"))
|
||||
.SetArrowsImage(ImageBrush("/Elements/Textbox/SpinArrows.png", Icon12))
|
||||
.SetForegroundColor(*BrushDatabase->GetSlateColor("TextColor"))
|
||||
.SetTextPadding(Margin);
|
||||
|
||||
CoreStyle->Set("SpinBox", SpinBox);
|
||||
EditorStyle->Set("SpinBox", SpinBox);
|
||||
CoreStyle->Set("NumericEntrySpinBox", SpinBox);
|
||||
EditorStyle->Set("NumericEntrySpinBox", SpinBox);
|
||||
CoreStyle->Set("NumericEntrySpinBox_Dark", SpinBox);
|
||||
NiagaraStyle->Set("NiagaraEditor.ParameterSpinbox", SpinBox);
|
||||
|
||||
// Tableview
|
||||
|
||||
const FTableRowStyle DefaultTableRowStyle =
|
||||
FTableRowStyle()
|
||||
.SetEvenRowBackgroundBrush(FSlateNoResource())
|
||||
.SetEvenRowBackgroundHoveredBrush(ColorImageBrush(HoverBase))
|
||||
.SetOddRowBackgroundBrush(FSlateNoResource())
|
||||
.SetOddRowBackgroundHoveredBrush(ColorImageBrush(HoverBase))
|
||||
.SetSelectorFocusedBrush(BorderBrush("/Elements/Table/Selector.png", FMargin(0.25), HoverBaseBright))
|
||||
.SetActiveBrush(ColorImageBrush(HoverBase))
|
||||
.SetActiveHoveredBrush(ColorImageBrush(HoverBase))
|
||||
.SetInactiveBrush(ColorImageBrush(HoverBase))
|
||||
.SetInactiveHoveredBrush(ColorImageBrush(HoverBase))
|
||||
.SetActiveHighlightedBrush(ColorImageBrush(HoverBase))
|
||||
.SetInactiveHighlightedBrush(ColorImageBrush(HoverBase))
|
||||
.SetTextColor(FLinearColor::FromSRGBColor(TextColor))
|
||||
.SetSelectedTextColor(FLinearColor::FromSRGBColor(TextColor))
|
||||
.SetDropIndicator_Above(BorderBrush("/Elements/Table/DropZoneIndicator_Above.png", FMargin(10.0f / 16.0f, 10.0f / 16.0f, 0, 0), HoverBaseBright))
|
||||
.SetDropIndicator_Onto(BorderBrush("/Elements/Table/DropZoneIndicator_Onto.png", FMargin(0.25), HoverBaseBright))
|
||||
.SetDropIndicator_Below(BorderBrush("/Elements/Table/DropZoneIndicator_Below.png", FMargin(10.0f / 16.0f, 0, 0, 10.0f / 16.0f), HoverBaseBright));
|
||||
CoreStyle->Set("TableView.Row", FTableRowStyle(DefaultTableRowStyle));
|
||||
EditorStyle->Set("TableView.Row", FTableRowStyle(DefaultTableRowStyle));
|
||||
|
||||
// SmallRounded
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start")->SetScalarParameterValue("Part", -1);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Hovered")->SetScalarParameterValue("Part", -1);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Pressed")->SetScalarParameterValue("Part", -1);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Checked")->SetScalarParameterValue("Part", -1);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Hovered_Checked")->SetScalarParameterValue("Part", -1);
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle")->SetScalarParameterValue("Part", 0);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Hovered")->SetScalarParameterValue("Part", 0);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Pressed")->SetScalarParameterValue("Part", 0);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Checked")->SetScalarParameterValue("Part", 0);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Hovered_Checked")->SetScalarParameterValue("Part", 0);
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("Button_End")->SetScalarParameterValue("Part", 1);
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Hovered")->SetScalarParameterValue("Part", 1);
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Pressed")->SetScalarParameterValue("Part", 1);
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Checked")->SetScalarParameterValue("Part", 1);
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Hovered_Checked")->SetScalarParameterValue("Part", 1);
|
||||
|
||||
EditorStyle->Set("EditorViewportToolBar.MenuButton", FButtonStyle(Button));
|
||||
EditorStyle->Set("EditorViewportToolBar.MenuButtonWarning", FButtonStyle(Button));
|
||||
EditorStyle->Set("ViewportPinnedCommandList.Button", FButtonStyle(Button));
|
||||
EditorStyle->Set("ViewportMenu.Button", FButtonStyle(Button));
|
||||
EditorStyle->Set(
|
||||
"ViewportMenu.Button.Start",
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(*SlateBrush("Button_Start"))
|
||||
.SetHovered(*SlateBrush("Button_Start_Hovered"))
|
||||
.SetPressed(*SlateBrush("Button_Start_Pressed")));
|
||||
EditorStyle->Set(
|
||||
"ViewportMenu.Button.Middle",
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(*SlateBrush("Button_Middle"))
|
||||
.SetHovered(*SlateBrush("Button_Middle_Hovered"))
|
||||
.SetPressed(*SlateBrush("Button_Middle_Pressed")));
|
||||
EditorStyle->Set(
|
||||
"ViewportMenu.Button.End",
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(*SlateBrush("Button_End"))
|
||||
.SetHovered(*SlateBrush("Button_End_Hovered"))
|
||||
.SetPressed(*SlateBrush("Button_End_Pressed")));
|
||||
|
||||
const FCheckBoxStyle ToggleStart =
|
||||
FCheckBoxStyle()
|
||||
.SetCheckBoxType(ESlateCheckBoxType::ToggleButton)
|
||||
.SetUncheckedImage(*SlateBrush("Button_Start"))
|
||||
.SetUncheckedHoveredImage(*SlateBrush("Button_Start_Hovered"))
|
||||
.SetUncheckedPressedImage(*SlateBrush("Button_Start_Pressed"))
|
||||
.SetCheckedImage(*SlateBrush("Button_Start_Checked"))
|
||||
.SetCheckedHoveredImage(*SlateBrush("Button_Start_Hovered_Checked"))
|
||||
.SetCheckedPressedImage(*SlateBrush("Button_Start_Pressed"))
|
||||
.SetPadding(Margin);
|
||||
|
||||
const FCheckBoxStyle ToggleMiddle =
|
||||
FCheckBoxStyle()
|
||||
.SetCheckBoxType(ESlateCheckBoxType::ToggleButton)
|
||||
.SetUncheckedImage(*SlateBrush("Button_Middle"))
|
||||
.SetUncheckedHoveredImage(*SlateBrush("Button_Middle_Hovered"))
|
||||
.SetUncheckedPressedImage(*SlateBrush("Button_Middle_Pressed"))
|
||||
.SetCheckedImage(*SlateBrush("Button_Middle_Checked"))
|
||||
.SetCheckedHoveredImage(*SlateBrush("Button_Middle_Hovered_Checked"))
|
||||
.SetCheckedPressedImage(*SlateBrush("Button_Middle_Pressed"))
|
||||
.SetPadding(Margin);
|
||||
|
||||
const FCheckBoxStyle ToggleEnd =
|
||||
FCheckBoxStyle()
|
||||
.SetCheckBoxType(ESlateCheckBoxType::ToggleButton)
|
||||
.SetUncheckedImage(*SlateBrush("Button_End"))
|
||||
.SetUncheckedHoveredImage(*SlateBrush("Button_End_Hovered"))
|
||||
.SetUncheckedPressedImage(*SlateBrush("Button_End_Pressed"))
|
||||
.SetCheckedImage(*SlateBrush("Button_End_Checked"))
|
||||
.SetCheckedHoveredImage(*SlateBrush("Button_End_Hovered_Checked"))
|
||||
.SetCheckedPressedImage(*SlateBrush("Button_End_Pressed"))
|
||||
.SetPadding(Margin);
|
||||
|
||||
|
||||
EditorStyle->Set("ViewportMenu.ToggleButton.Start", ToggleStart);
|
||||
EditorStyle->Set("ViewportMenu.ToggleButton.Middle", ToggleMiddle);
|
||||
EditorStyle->Set("ViewportMenu.ToggleButton.End", ToggleEnd);
|
||||
|
||||
EditorStyle->Set("Property.ToggleButton.Start", ToggleStart);
|
||||
EditorStyle->Set("Property.ToggleButton.Middle", ToggleMiddle);
|
||||
EditorStyle->Set("Property.ToggleButton.End", ToggleEnd);
|
||||
|
||||
CoreStyle->Set(
|
||||
"ToolBar.Button",
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(FSlateNoResource())
|
||||
.SetPressed(*SlateBrush("HoverDark"))
|
||||
.SetHovered(*SlateBrush("HoverDark"))
|
||||
.SetNormalPadding(SmallMargin)
|
||||
.SetPressedPadding(SmallMargin)
|
||||
);
|
||||
|
||||
|
||||
CoreStyle->Set("ToolBar.Button.Pressed", SlateBrush("HoverDark"));
|
||||
CoreStyle->Set("ToolBar.Button.Hovered", SlateBrush("HoverDark"));
|
||||
|
||||
CoreStyle->Set("ToolBar.Button.Checked", SlateBrush("HoverBase"));
|
||||
CoreStyle->Set("ToolBar.Button.Checked_Hovered", SlateBrush("HoverDark"));
|
||||
CoreStyle->Set("ToolBar.Button.Checked_Pressed", SlateBrush("HoverDark"));
|
||||
|
||||
EditorStyle->Set("PropertyWindow.CategoryBackground", SlateBrush("Button"));
|
||||
|
||||
CoreStyle->Set(
|
||||
"Menu.Button",
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(FSlateNoResource())
|
||||
.SetHovered(*SlateBrush("Primary"))
|
||||
.SetPressed(*SlateBrush("Primary"))
|
||||
.SetNormalPadding(FMargin(0, 1))
|
||||
.SetPressedPadding(FMargin(0, 2, 0, 0))
|
||||
);
|
||||
|
||||
CoreStyle->Set("Menu.Button.Checked", SlateBrush("HoverDark"));
|
||||
CoreStyle->Set("Menu.Button.Checked_Hovered", SlateBrush("HoverDark"));
|
||||
CoreStyle->Set("Menu.Button.Checked_Pressed", SlateBrush("HoverDark"));
|
||||
CoreStyle->Set("Menu.Button.SubMenuOpen", SlateBrush("HoverDark"));
|
||||
|
||||
const FButtonStyle ToggleButton =
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(FSlateNoResource())
|
||||
.SetHovered(*SlateBrush("HoverBase"))
|
||||
.SetPressed(*SlateBrush("HoverBase"))
|
||||
.SetNormalPadding(FMargin(0))
|
||||
.SetPressedPadding(FMargin(0));
|
||||
|
||||
const FButtonStyle RoundButton =
|
||||
FButtonStyle(ToggleButton)
|
||||
.SetNormal(*SlateBrush("GreyBase"))
|
||||
.SetHovered(*SlateBrush("HoverBase"))
|
||||
.SetPressed(*SlateBrush("HoverBase"));
|
||||
EditorStyle->Set("ToggleButton", ToggleButton);
|
||||
EditorStyle->Set("FlatButton", ToggleButton);
|
||||
|
||||
//FSlateColorBrush(FLinearColor::White)
|
||||
|
||||
EditorStyle->Set("RoundButton", RoundButton);
|
||||
EditorStyle->Set(
|
||||
"FlatButton",
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(*SlateBrush("GreyBase"))
|
||||
.SetHovered(*SlateBrush("HoverBase"))
|
||||
.SetPressed(*SlateBrush("HoverBase"))
|
||||
);
|
||||
EditorStyle->Set("FlatButton.Dark", RoundButton);
|
||||
EditorStyle->Set("FlatButton.DarkGrey", RoundButton);
|
||||
EditorStyle->Set("FlatButton.Light", RoundButton);
|
||||
EditorStyle->Set("FlatButton.Default", RoundButton);
|
||||
|
||||
|
||||
struct ButtonColor
|
||||
{
|
||||
FName Name;
|
||||
FColor Normal;
|
||||
FColor Hovered;
|
||||
|
||||
ButtonColor(const FName& InName, const FColor& Color) : Name(InName)
|
||||
{
|
||||
Normal = Color;
|
||||
Normal.A = Color.A * 0.75;
|
||||
Hovered = Color;
|
||||
Hovered.A = Color.A * 1.0;
|
||||
}
|
||||
};
|
||||
|
||||
// Red #b20000
|
||||
// Blue #0060b2
|
||||
// Yellow #dfb300
|
||||
// Green #3aa111
|
||||
|
||||
TArray<ButtonColor> FlatButtons;
|
||||
FlatButtons.Add(ButtonColor("FlatButton.Primary", ButtonPrimary));
|
||||
FlatButtons.Add(ButtonColor("FlatButton.Success", ButtonSuccess));
|
||||
FlatButtons.Add(ButtonColor("FlatButton.Info", ButtonInfo));
|
||||
FlatButtons.Add(ButtonColor("FlatButton.Warning", ButtonWarning));
|
||||
FlatButtons.Add(ButtonColor("FlatButton.Danger", ButtonDanger));
|
||||
|
||||
for (const ButtonColor& Entry : FlatButtons)
|
||||
{
|
||||
EditorStyle->Set(
|
||||
Entry.Name,
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(BoxBrush("/Elements/Button/FlatButton.png", Icon0, 0.25, Entry.Normal))
|
||||
.SetHovered(BoxBrush("/Elements/Button/FlatButton.png", Icon0, 0.25, Entry.Hovered))
|
||||
.SetPressed(BoxBrush("/Elements/Button/FlatButton.png", Icon0, 0.25, Entry.Hovered))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
|
||||
void FColorizer::ColorCheckbox()
|
||||
{
|
||||
if (!DarkerNodesSettings->UseCustomButton)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Border Opacity 15% / 75%
|
||||
// Front Opacity 75%
|
||||
|
||||
const FCheckBoxStyle BasicCheckBoxStyle =
|
||||
FCheckBoxStyle()
|
||||
.SetCheckBoxType(ESlateCheckBoxType::CheckBox)
|
||||
|
||||
.SetUncheckedImage(ImageBrush("/Elements/Checkbox/CheckBox.png"))
|
||||
.SetUncheckedHoveredImage(ImageBrush("/Elements/Checkbox/CheckBox_Hovered.png"))
|
||||
.SetUncheckedPressedImage(ImageBrush("/Elements/Checkbox/CheckBox_Hovered.png"))
|
||||
|
||||
.SetCheckedImage(ImageBrush("/Elements/Checkbox/CheckBox_Checked.png"))
|
||||
.SetCheckedHoveredImage(ImageBrush("/Elements/Checkbox/CheckBox_Checked_Hovered.png"))
|
||||
.SetCheckedPressedImage(ImageBrush("/Elements/Checkbox/CheckBox_Checked_Hovered.png"))
|
||||
|
||||
.SetUndeterminedImage(ImageBrush("/Elements/Checkbox/CheckBox_Undetermined.png"))
|
||||
.SetUndeterminedHoveredImage(ImageBrush("/Elements/Checkbox/CheckBox_Undetermined_Hovered.png"))
|
||||
.SetUndeterminedPressedImage(ImageBrush("/Elements/Checkbox/CheckBox_Undetermined_Hovered.png"));
|
||||
|
||||
CoreStyle->Set("Checkbox", BasicCheckBoxStyle);
|
||||
|
||||
EditorStyle->Set("Graph.Checkbox", BasicCheckBoxStyle);
|
||||
const FCheckBoxStyle BasicToggleButtonCheckBoxStyle =
|
||||
FCheckBoxStyle(BasicCheckBoxStyle)
|
||||
.SetCheckBoxType(ESlateCheckBoxType::ToggleButton);
|
||||
|
||||
CoreStyle->Set("Menu.CheckBox", BasicCheckBoxStyle);
|
||||
CoreStyle->Set("Menu.Check", BasicCheckBoxStyle);
|
||||
CoreStyle->Set("Menu.ToggleButton", BasicToggleButtonCheckBoxStyle);
|
||||
|
||||
|
||||
const FCheckBoxStyle BasicRadioButtonStyle =
|
||||
FCheckBoxStyle()
|
||||
.SetUncheckedImage(ImageBrush("/Elements/Checkbox/RadioButton.png"))
|
||||
.SetUncheckedHoveredImage(ImageBrush("/Elements/Checkbox/RadioButton_Hovered.png"))
|
||||
.SetUncheckedPressedImage(ImageBrush("/Elements/Checkbox/RadioButton_Hovered.png"))
|
||||
|
||||
.SetCheckedImage(ImageBrush("/Elements/Checkbox/RadioButton_Checked.png"))
|
||||
.SetCheckedHoveredImage(ImageBrush("/Elements/Checkbox/RadioButton_Checked_Hovered.png"))
|
||||
.SetCheckedPressedImage(ImageBrush("/Elements/Checkbox/RadioButton_Checked_Hovered.png"))
|
||||
|
||||
.SetUndeterminedImage(ImageBrush("/Elements/Checkbox/RadioButton.png"))
|
||||
.SetUndeterminedHoveredImage(ImageBrush("/Elements/Checkbox/RadioButton_Hovered.png"))
|
||||
.SetUndeterminedPressedImage(ImageBrush("/Elements/Checkbox/RadioButton_Hovered.png"));
|
||||
|
||||
CoreStyle->Set("RadioButton", BasicRadioButtonStyle);
|
||||
CoreStyle->Set("Menu.RadioButton", BasicRadioButtonStyle);
|
||||
CoreStyle->Set("ToolBar.RadioButton", BasicRadioButtonStyle);
|
||||
|
||||
//EditorStyle->Set("RadioButton", BasicRadioButtonStyle);
|
||||
//EditorStyle->Set("ToolBar.RadioButton", BasicRadioButtonStyle);
|
||||
//EditorStyle->Set("NotificationBar.RadioButton", BasicRadioButtonStyle);
|
||||
//EditorStyle->Set("Menu.RadioButton", BasicRadioButtonStyle);
|
||||
//EditorStyle->Set("EditorModesToolbar.RadioButton", BasicRadioButtonStyle);
|
||||
//EditorStyle->Set("PinnedCommandList.RadioButton", BasicRadioButtonStyle);
|
||||
//EditorStyle->Set("ViewportPinnedCommandList.RadioButton", BasicRadioButtonStyle);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
|
||||
void FColorizer::ApplyFonts() const
|
||||
{
|
||||
FTypeface* Typeface = const_cast<FTypeface*>(&FCoreStyle::GetDefaultFont().Get().DefaultTypeface);
|
||||
|
||||
if (!DarkerNodesSettings->UseCustomRegularFont)
|
||||
{
|
||||
switch (DarkerNodesSettings->FontFamily)
|
||||
{
|
||||
case EFontFamily::BalsamiqSans:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/BalsamiqSans-Regular.ttf";
|
||||
break;
|
||||
case EFontFamily::Cannonade:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/Cannonade-Regular.ttf";
|
||||
break;
|
||||
case EFontFamily::CaskaydiaCove:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/CaskaydiaCove-Regular.ttf";
|
||||
break;
|
||||
case EFontFamily::EudoxusSans:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/EudoxusSans-Regular.ttf";
|
||||
break;
|
||||
case EFontFamily::GolosUI:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/GolosUI-Regular.ttf";
|
||||
break;
|
||||
case EFontFamily::Jua:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/Jua-Regular.ttf";
|
||||
break;
|
||||
case EFontFamily::Junction:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/Junction-Regular.ttf";
|
||||
break;
|
||||
case EFontFamily::NewTelegraph:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/NewTelegraph-Regular.ttf";
|
||||
break;
|
||||
case EFontFamily::XXIIAven:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/XXIIAven-Regular.ttf";
|
||||
break;
|
||||
default:
|
||||
DarkerNodesSettings->RegularFont.FilePath = Typeface->Fonts[0].Font.GetFontFilename();
|
||||
}
|
||||
}
|
||||
Typeface->Fonts[0] = FTypefaceEntry(TEXT("Regular"), DarkerNodesSettings->RegularFont.FilePath, EFontHinting::Default, EFontLoadingPolicy::LazyLoad);
|
||||
|
||||
|
||||
if (!DarkerNodesSettings->UseCustomItalicFont)
|
||||
{
|
||||
DarkerNodesSettings->ItalicFont.FilePath = Typeface->Fonts[1].Font.GetFontFilename();
|
||||
}
|
||||
Typeface->Fonts[1] = FTypefaceEntry(TEXT("Italic"), DarkerNodesSettings->ItalicFont.FilePath, EFontHinting::Default, EFontLoadingPolicy::LazyLoad);
|
||||
|
||||
|
||||
if (!DarkerNodesSettings->UseCustomBoldFont)
|
||||
{
|
||||
switch (DarkerNodesSettings->FontFamily)
|
||||
{
|
||||
case EFontFamily::BalsamiqSans:
|
||||
DarkerNodesSettings->RegularFont.FilePath = FontsDirectory + "/BalsamiqSans-Bold.ttf";
|
||||
break;
|
||||
case EFontFamily::Cannonade:
|
||||
DarkerNodesSettings->BoldFont.FilePath = FontsDirectory + "/Cannonade-Bold.ttf";
|
||||
break;
|
||||
case EFontFamily::CaskaydiaCove:
|
||||
DarkerNodesSettings->BoldFont.FilePath = FontsDirectory + "/CaskaydiaCove-Bold.ttf";
|
||||
break;
|
||||
case EFontFamily::EudoxusSans:
|
||||
DarkerNodesSettings->BoldFont.FilePath = FontsDirectory + "/EudoxusSans-Bold.ttf";
|
||||
break;
|
||||
case EFontFamily::GolosUI:
|
||||
DarkerNodesSettings->BoldFont.FilePath = FontsDirectory + "/GolosUI-Bold.ttf";
|
||||
break;
|
||||
case EFontFamily::Junction:
|
||||
DarkerNodesSettings->BoldFont.FilePath = FontsDirectory + "/Junction-Bold.ttf";
|
||||
break;
|
||||
case EFontFamily::NewTelegraph:
|
||||
DarkerNodesSettings->BoldFont.FilePath = FontsDirectory + "/NewTelegraph-Bold.ttf";
|
||||
break;
|
||||
case EFontFamily::XXIIAven:
|
||||
DarkerNodesSettings->BoldFont.FilePath = FontsDirectory + "/XXIIAven-Bold.ttf";
|
||||
break;
|
||||
default:
|
||||
DarkerNodesSettings->BoldFont.FilePath = Typeface->Fonts[0].Font.GetFontFilename();
|
||||
}
|
||||
}
|
||||
Typeface->Fonts[2] = FTypefaceEntry(TEXT("Bold"), DarkerNodesSettings->BoldFont.FilePath, EFontHinting::Default, EFontLoadingPolicy::LazyLoad);
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
#include "Materials/MaterialInstanceDynamic.h"
|
||||
#include "Classes/EditorStyleSettings.h"
|
||||
|
||||
void FColorizer::ColorGraph()
|
||||
{
|
||||
// Graph Nodes
|
||||
|
||||
if (DarkerNodesSettings->ActivateBlueprintTheme)
|
||||
{
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_body")->SetScalarParameterValue("Size", 32);
|
||||
SlateBrush("RegularNode_body")->ImageSize = FVector2D(32, 32);
|
||||
SlateBrush("RegularNode_body")->Margin = FMargin(0.5f);
|
||||
SlateBrush("RegularNode_body")->DrawAs = ESlateBrushDrawType::Box;
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_body")->SetScalarParameterValue("Size", 32);
|
||||
SlateBrush("VarNode_body")->ImageSize = FVector2D(32, 32);
|
||||
SlateBrush("VarNode_body")->Margin = FMargin(0.5f);
|
||||
SlateBrush("VarNode_body")->DrawAs = ESlateBrushDrawType::Box;
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_color_spill")->SetScalarParameterValue("Size", 32);
|
||||
SlateBrush("RegularNode_color_spill")->ImageSize = FVector2D(32, 32);
|
||||
SlateBrush("RegularNode_color_spill")->Margin = FMargin(0.5f);
|
||||
SlateBrush("RegularNode_color_spill")->DrawAs = ESlateBrushDrawType::Box;
|
||||
|
||||
EditorStyle->Set("Graph.Node.Body", SlateBrush("RegularNode_body"));
|
||||
EditorStyle->Set("Graph.VarNode.Body", SlateBrush("VarNode_body"));
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_shadow_selected")->SetScalarParameterValue("Size", 64);
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_shadow_selected")->SetScalarParameterValue("Size", 64);
|
||||
|
||||
SlateBrush("RegularNode_shadow_selected")->ImageSize = FVector2D(64, 64);
|
||||
SlateBrush("RegularNode_shadow_selected")->Margin = FMargin(0.5f);
|
||||
SlateBrush("RegularNode_shadow_selected")->DrawAs = ESlateBrushDrawType::Box;
|
||||
|
||||
SlateBrush("VarNode_shadow_selected")->ImageSize = FVector2D(64, 64);
|
||||
SlateBrush("VarNode_shadow_selected")->Margin = FMargin(0.5f);
|
||||
SlateBrush("VarNode_shadow_selected")->DrawAs = ESlateBrushDrawType::Box;
|
||||
|
||||
EditorStyle->Set("Graph.PlayInEditor", SlateBrush("RegularNode_shadow_selected"));
|
||||
EditorStyle->Set("Graph.Node.ShadowSelected", SlateBrush("RegularNode_shadow_selected"));
|
||||
EditorStyle->Set("Graph.VarNode.ShadowSelected", SlateBrush("VarNode_shadow_selected"));
|
||||
|
||||
#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION <= 24
|
||||
ApplyBoxBrush(EditorStyle, "Graph.Node.TitleGloss", "/Graph/RegularNode_color_spill_424.png");
|
||||
EditorStyle->Set("Graph.Node.ColorSpill", new FSlateNoResource());
|
||||
#else
|
||||
EditorStyle->Set("Graph.Node.ColorSpill", SlateBrush("RegularNode_color_spill"));
|
||||
EditorStyle->Set("Graph.Node.TitleGloss", new FSlateNoResource());
|
||||
#endif
|
||||
|
||||
EditorStyle->Set("Graph.Node.Shadow", new FSlateNoResource());
|
||||
EditorStyle->Set("Graph.Node.TitleHighlight", new FSlateNoResource());
|
||||
|
||||
switch (DarkerNodesSettings->BlueprintVarNodeLine)
|
||||
{
|
||||
case EBlueprintVarNodeLine::Thin:
|
||||
ApplyImageBrush(EditorStyle, "Graph.VarNode.ColorSpill", "/Graph/VarNode_color_spill_thin.png", FVector2D(132, 28));
|
||||
break;
|
||||
case EBlueprintVarNodeLine::Thick:
|
||||
ApplyImageBrush(EditorStyle, "Graph.VarNode.ColorSpill", "/Graph/VarNode_color_spill_thick.png", FVector2D(132, 28));
|
||||
break;
|
||||
}
|
||||
|
||||
EditorStyle->Set("Graph.VarNode.Gloss", new FSlateNoResource());
|
||||
EditorStyle->Set("Graph.VarNode.Shadow", new FSlateNoResource());
|
||||
|
||||
//EditorStyle->Set("Graph.VarNode.Body", SlateBrush("Button_Hovered"));
|
||||
|
||||
EditorStyle->Set("Graph.CollapsedNode.Body", SlateBrush("RegularNode_body"));
|
||||
ApplyBoxBrush(EditorStyle, "Graph.CollapsedNode.BodyColorSpill", "/Graph/CollapsedNode_Body_ColorSpill.png");
|
||||
|
||||
// Pin Icons
|
||||
|
||||
ApplyImageBrush(EditorStyle, "Graph.Pin.Connected_VarA", "/Elements/Pin/Pin_connected_VarA.png", FVector2D(15, 11));
|
||||
ApplyImageBrush(EditorStyle, "Graph.Pin.Disconnected_VarA", "/Elements/Pin/Pin_disconnected_VarA.png", FVector2D(15, 11));
|
||||
ApplyImageBrush(EditorStyle, "Graph.Pin.Connected", "/Elements/Pin/Pin_connected.png", FVector2D(11, 11));
|
||||
ApplyImageBrush(EditorStyle, "Graph.Pin.Disconnected", "/Elements/Pin/Pin_disconnected.png", FVector2D(11, 11));
|
||||
|
||||
ApplyImageBrush(EditorStyle, "Graph.ExecPin.Connected", "/Elements/Pin/ExecPin_Connected.png", FVector2D(12, 16));
|
||||
ApplyImageBrush(EditorStyle, "Graph.ExecPin.Disconnected", "/Elements/Pin/ExecPin_Disconnected.png", FVector2D(12, 16));
|
||||
ApplyImageBrush(EditorStyle, "Graph.ExecPin.ConnectedHovered", "/Elements/Pin/ExecPin_Connected.png", FVector2D(12, 16), FColor(150, 150, 150));
|
||||
ApplyImageBrush(EditorStyle, "Graph.ExecPin.DisconnectedHovered", "/Elements/Pin/ExecPin_Disconnected.png", FVector2D(12, 16), FColor(150, 150, 150));
|
||||
ApplyImageBrush(EditorStyle, "Graph.ExecutionBubble", "/Elements/Pin/ExecutionBubble.png", FVector2D(16, 16));
|
||||
}
|
||||
|
||||
// Grid
|
||||
|
||||
if (DarkerNodesSettings->UseCustomPanels)
|
||||
{
|
||||
EditorStyle->Set("Graph.Panel.GridLineColor", BrushDatabase->GetColor("GridLine").Get());
|
||||
GetMutableDefault<UEditorStyleSettings>()->RegularColor = BrushDatabase->GetColor("GridLine").Get();
|
||||
|
||||
EditorStyle->Set("Graph.Panel.GridRuleColor", BrushDatabase->GetColor("GridRule").Get());
|
||||
GetMutableDefault<UEditorStyleSettings>()->RuleColor = BrushDatabase->GetColor("GridRule").Get();
|
||||
|
||||
EditorStyle->Set("Graph.Panel.GridCenterColor", BrushDatabase->GetColor("GridCenter").Get());
|
||||
GetMutableDefault<UEditorStyleSettings>()->CenterColor = BrushDatabase->GetColor("GridCenter").Get();
|
||||
}
|
||||
|
||||
ApplyBoxBrush(EditorStyle, "Kismet.Comment.Background", "/Graph/Comment_Background.png");
|
||||
|
||||
// Comments
|
||||
|
||||
ApplyBoxBrush(EditorStyle, "Graph.Node.CommentBubble", "/Graph/CommentBubble.png");
|
||||
ApplyImageBrush(EditorStyle, "Graph.Node.CommentArrow", "/Graph/CommentBubbleArrow.png", Icon8);
|
||||
|
||||
// Panel
|
||||
|
||||
ApplyImageBrush(EditorStyle, "BlueprintEditor.Details.ArgUpButton", "/Icons/Graph/icon_FunctionArgUp.png", Icon16);
|
||||
ApplyImageBrush(EditorStyle, "BlueprintEditor.Details.ArgDownButton", "/Icons/Graph/icon_FunctionArgDown.png", Icon16);
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
|
||||
void FColorizer::ColorIcons()
|
||||
{
|
||||
if (DarkerNodesSettings->UseCustomIcons)
|
||||
{
|
||||
// Opacity 50%
|
||||
|
||||
// Red #b20000
|
||||
// Blue #0060b2
|
||||
// Yellow #dfb300
|
||||
// Green #3aa111
|
||||
|
||||
FColor YellowGroupColor = ImageColor;
|
||||
FColor BlueGroupColor = ImageColor;
|
||||
FColor GreenGroupColor = ImageColor;
|
||||
|
||||
if (DarkerNodesSettings->UseIconColorization)
|
||||
{
|
||||
YellowGroupColor = FColor(255,255,63);
|
||||
BlueGroupColor = FColor(0,191,255);
|
||||
GreenGroupColor = FColor(63,255,63);
|
||||
}
|
||||
|
||||
AddMenuIcon(EditorStyle, "Kismet.Status.Unknown", "/Menu/CompileStatus_Working.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "Kismet.Status.Error", "/Menu/CompileStatus_Fail.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "Kismet.Status.Good", "/Menu/CompileStatus_Good.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "Kismet.Status.Warning", "/Menu/CompileStatus_Warning.png", ImageColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "AssetEditor.SaveAsset", "/Menu/icon_SaveAsset_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "SystemWideCommands.FindInContentBrowser", "/Menu/icon_toolbar_genericfinder_40px.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "BlueprintEditor.FindInBlueprint", "/Menu/icon_Blueprint_Find_40px.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.FindInMaterial", "/Menu/icon_Blueprint_Find_40px.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "TranslationEditor.Search", "/Menu/icon_Blueprint_Find_40px.png", ImageColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "FullBlueprintEditor.EditGlobalOptions", "/Menu/icon_Blueprint_Options_40px.png", BlueGroupColor);
|
||||
AddMenuIcon(EditorStyle, "FullBlueprintEditor.EditClassDefaults", "/Menu/icon_BlueprintEditor_Defaults_40x.png", BlueGroupColor);
|
||||
AddMenuIcon(EditorStyle, "FullBlueprintEditor.SwitchToBlueprintDefaultsMode", "/Menu/icon_BlueprintEditor_Defaults_40x.png", BlueGroupColor);
|
||||
AddMenuIcon(EditorStyle, "BlueprintEditor.EnableSimulation", "/Menu/icon_Enable_Simulation_40px.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.PlayInViewport", "/Menu/icon_playInSelectedViewport_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "GraphEditor.ToggleHideUnrelatedNodes", "/Menu/icon_HideUnrelatedNodes_40x.png", ImageColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.Build", "/Menu/icon_build_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.Recompile", "/Menu/icon_compile_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.OpenContentBrowser", "/Menu/icon_ContentBrowser_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.EditorModes", "/Menu/icon_Editor_Modes_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.ToggleVR", "/Menu/VR_Editor_Toolbar_Icon.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.GameSettings", "/Menu/icon_game_settings_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.OpenLevelBlueprint", "/Menu/icon_kismet2_40x.png", BlueGroupColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.OpenMarketplace", "/Menu/icon_Marketplace_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.EditMatinee", "/Menu/icon_matinee_40x.png", BlueGroupColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.SourceControl", "/Menu/icon_source_control_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.SourceControl.On", "/Menu/icon_source_control_40x_on.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.SourceControl.Off", "/Menu/icon_source_control_40x_off.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.SourceControl.Unknown", "/Menu/icon_source_control_40x_unknown.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "LevelEditor.SourceControl.Problem", "/Menu/icon_source_control_40x_problem.png", ImageColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.Apply", "/Menu/icon_MatEd_Apply_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.CameraHome", "/Menu/icon_MatEd_Home_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.ToggleRealtimeExpressions", "/Menu/icon_MatEd_LiveNodes_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.AlwaysRefreshAllPreviews", "/Menu/icon_MatEd_Refresh_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.ToggleLivePreview", "/Menu/icon_MatEd_LivePreview_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.ToggleMaterialStats", "/Menu/icon_MatEd_Stats_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.TogglePlatformStats", "/Menu/icon_MobileStats_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.CleanUnusedExpressions", "/Menu/icon_MatEd_CleanUp_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "MaterialEditor.ShowHideConnectors", "/Menu/icon_MatEd_Connectors_40x.png", ImageColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.PausePlaySession", "/Menu/icon_pause_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.StopPlaySession", "/Menu/icon_stop_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.PossessPlayer", "/Menu/icon_possess_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.EjectFromPlayer", "/Menu/icon_eject_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.RepeatLastLaunch", "/Menu/icon_PlayOnDevice_40px.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.PlayInNewProcess", "/Menu/icon_PlayStandalone_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.PlayInEditorFloating", "/Menu/icon_playInWindow_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.PlayInMobilePreview", "/Menu/icon_PlayMobilePreview_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.PlayInVR", "/Menu/icon_playInVR_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.LateJoinSession", "/Menu/icon_simulate_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.ResumePlaySession", "/Menu/icon_simulate_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.Simulate", "/Menu/icon_simulate_40x.png", YellowGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.RepeatLastPlay", "/Menu/icon_simulate_40x.png", YellowGroupColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.SingleFrameAdvance", "/Menu/icon_advance_40x.png", BlueGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.ShowCurrentStatement", "/Menu/icon_findnode_40x.png", BlueGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.StepOut", "/Menu/icon_DebugStepOut_40x.png", BlueGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.StepInto", "/Menu/icon_DebugStepIn_40x.png", BlueGroupColor);
|
||||
AddMenuIcon(EditorStyle, "PlayWorld.StepOver", "/Menu/icon_DebugStepOver_40x.png", BlueGroupColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "BTEditor.SwitchToBehaviorTreeMode", "/Menu/BehaviorTreeMode_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "UMGEditor.SwitchToDesigner", "/Menu/Designer_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "FullBlueprintEditor.SwitchToScriptingMode", "/Menu/icon_BlueprintEditor_EventGraph_40x.png", ImageColor);
|
||||
AddMenuIcon(CoreStyle, "WidgetReflector.Icon", "/Menu/icon_tab_WidgetReflector_40x.png", ImageColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "EditorViewport.ToggleRealTime", "/Menu/icon_MatEd_Realtime_40x.png", ImageColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowWireframe", "/Menu/icon_StaticMeshEd_Wireframe_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowVertexColor", "/Menu/icon_StaticMeshEd_VertColor_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetRealtimePreview", "/Menu/icon_MatEd_Realtime_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ReimportMesh", "/Menu/icon_Persona_ReimportMesh_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowBounds", "/Menu/icon_StaticMeshEd_Bounds_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowCollision", "/Menu/icon_StaticMeshEd_Collision_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowGrid", "/Menu/icon_MatEd_Grid_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetDrawUVs", "/Menu/icon_StaticMeshEd_UVOverlay_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ResetCamera", "/Menu/icon_Camera_Reset_40px.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowPivot", "/Menu/icon_StaticMeshEd_ShowPivot_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowSockets", "/Menu/icon_StaticMeshEd_ShowSockets_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowNormals", "/Menu/icon_StaticMeshEd_Normals_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowTangents", "/Menu/icon_StaticMeshEd_Tangents_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowBinormals", "/Menu/icon_StaticMeshEd_Binormals_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetDrawAdditionalData", "/Menu/icon_StaticMeshEd_AdditionalData_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.SetShowVertices", "/Menu/icon_StaticMeshEd_Vertices_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowPivots", "/Menu/icon_StaticMeshEd_ShowPivot_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowSockets", "/Menu/icon_StaticMeshEd_ShowSockets_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowNormals", "/Menu/icon_StaticMeshEd_Normals_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowTangents", "/Menu/icon_StaticMeshEd_Tangents_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowBinormals", "/Menu/icon_StaticMeshEd_Binormals_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowBounds", "/Menu/icon_StaticMeshEd_Bounds_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowGrids", "/Menu/icon_MatEd_Grid_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowVertices", "/Menu/icon_StaticMeshEd_Vertices_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowWireframes", "/Menu/icon_StaticMeshEd_Wireframe_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "StaticMeshEditor.ToggleShowVertexColors", "/Menu/icon_StaticMeshEd_VertColor_40x.png", GreenGroupColor);
|
||||
AddMenuIcon(EditorStyle, "Persona.BakeMaterials", "/Menu/icon_tab_Layers_40x.png", ImageColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "AnimationEditor.ApplyCompression", "/Menu/icon_Persona_Compression_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "AnimationEditor.ExportToFBX", "/Menu/icon_Persona_ExportFBX_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "AnimationEditor.ReimportAnimation", "/Menu/icon_Persona_ReimportMesh_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "AnimationEditor.CreateAsset", "/Menu/icon_Persona_CreateAsset_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "AnimationEditor.SetKey", "/Menu/icon_Persona_SetKey_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "AnimationEditor.ApplyAnimation", "/Menu/icon_MatEd_Apply_40x.png", ImageColor);
|
||||
|
||||
AddMenuIcon(EditorStyle, "Persona.TogglePreviewAsset", "/Menu/icon_Persona_PreviewAsset_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "Persona.CreateAsset", "/Menu/icon_Persona_CreateAsset_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "Persona.ExportToFBX", "/Menu/icon_Persona_ExportFBX_40x.png", ImageColor);
|
||||
AddMenuIcon(EditorStyle, "Persona.ConvertToStaticMesh", "/Menu/icon_ShowStaticMeshes_40x.png", ImageColor);
|
||||
}
|
||||
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.LocationGridSnap", "/Icons/Viewport/LocationGridSnap.png", Icon14, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.RotationGridSnap", "/Icons/Viewport/RotationGridSnap.png", Icon14, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.Layer2DSnap", "/Icons/Viewport/Layer2DSnap.png", Icon14, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.ScaleGridSnap", "/Icons/Viewport/ScaleGridSnap.png", Icon14, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.ToggleSurfaceSnapping", "/Icons/Viewport/icon_surface_snapping_14px.png", Icon14, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.RelativeCoordinateSystem_Local", "/Icons/Viewport/icon_axis_local_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.RelativeCoordinateSystem_Local.Small", "/Icons/Viewport/icon_axis_local_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.RelativeCoordinateSystem_World", "/Icons/Viewport/icon_axis_world_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.RelativeCoordinateSystem_World.Small", "/Icons/Viewport/icon_axis_world_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.CamSpeedSetting", "/Icons/Viewport/icon_CameraSpeed_24x16px.png", FVector2D(24, 16), TextColor);
|
||||
|
||||
ApplyImageBrush(EditorStyle, "DetailsView.EditRawProperties", "/Icons/DetailsView/icon_PropertyMatrix_16px.png", Icon16, TextColor);
|
||||
|
||||
ApplyImageBrush(EditorStyle, "CurveEd.Visible", "/Icons/DetailsView/icon_visible_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "CurveEd.VisibleHighlight", "/Icons/DetailsView/icon_visible_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "CurveEd.Invisible", "/Icons/DetailsView/icon_invisible_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "CurveEd.InvisibleHighlight", "/Icons/DetailsView/icon_invisible_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "Level.VisibleIcon16x", "/Icons/DetailsView/icon_visible_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "Level.VisibleHighlightIcon16x", "/Icons/DetailsView/icon_visible_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "Level.NotVisibleIcon16x", "/Icons/DetailsView/icon_invisible_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "Level.NotVisibleHighlightIcon16x", "/Icons/DetailsView/icon_invisible_16px.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "GenericViewButton", "/Icons/DetailsView/icon_visible_16px.png", Icon16, TextColor);
|
||||
|
||||
const FColor TextColor50 = TextColor.WithAlpha(255 * 0.5);
|
||||
|
||||
ApplyCenterIcon(EditorStyle, "PropertyWindow.Button_CreateNewBlueprint", "/Icons/DetailsView/PlusSymbol_12x.png", Icon12, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "PropertyWindow.Button_Browse", "/Icons/DetailsView/lens_12x.png", Icon12, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "PropertyWindow.Button_Use", "/Icons/DetailsView/assign_12x.png", Icon12, TextColor50);
|
||||
|
||||
ApplyCenterIcon(EditorStyle, "GenericLock", "/Icons/DetailsView/padlock_locked_16x.png", Icon16, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "GenericLock.Small", "/Icons/DetailsView/padlock_locked_16x.png", Icon16, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "GenericUnlock", "/Icons/DetailsView/padlock_unlocked_16x.png", Icon16, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "GenericUnlock.Small", "/Icons/DetailsView/padlock_unlocked_16x.png", Icon16, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "PropertyWindow.Locked", "/Icons/DetailsView/padlock_locked_16x.png", Icon16, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "PropertyWindow.Unlocked", "/Icons/DetailsView/padlock_unlocked_16x.png", Icon16, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "FindResults.LockButton_Locked", "/Icons/DetailsView/padlock_locked_16x.png", Icon16, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "FindResults.LockButton_Unlocked", "/Icons/DetailsView/padlock_unlocked_16x.png", Icon16, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "ContentBrowser.LockButton_Locked", "/Icons/DetailsView/padlock_locked_16x.png", Icon16, TextColor50);
|
||||
ApplyCenterIcon(EditorStyle, "ContentBrowser.LockButton_Unlocked", "/Icons/DetailsView/padlock_unlocked_16x.png", Icon16, TextColor50);
|
||||
|
||||
ApplyImageBrush(EditorStyle, "DetailsView.PulldownArrow.Down", "/Icons/PropertyView/AdvancedButton_Down.png",
|
||||
FVector2D(10, 8), TextColor50);
|
||||
ApplyImageBrush(EditorStyle, "DetailsView.PulldownArrow.Down.Hovered", "/Icons/PropertyView/AdvancedButton_Down.png",
|
||||
FVector2D(10, 8), TextColor);
|
||||
ApplyImageBrush(EditorStyle, "DetailsView.PulldownArrow.Up", "/Icons/PropertyView/AdvancedButton_Up.png",
|
||||
FVector2D(10, 8), TextColor50);
|
||||
ApplyImageBrush(EditorStyle, "DetailsView.PulldownArrow.Up.Hovered", "/Icons/PropertyView/AdvancedButton_Up.png",
|
||||
FVector2D(10, 8), TextColor);
|
||||
|
||||
ApplyImageBrush(CoreStyle, "TreeArrow_Collapsed", "/Panel/TreeArrow_Collapsed.png", Icon10, TextColor50);
|
||||
ApplyImageBrush(CoreStyle, "TreeArrow_Collapsed_Hovered", "/Panel/TreeArrow_Collapsed.png", Icon10, TextColor);
|
||||
ApplyImageBrush(CoreStyle, "TreeArrow_Expanded", "/Panel/TreeArrow_Expanded.png", Icon10, TextColor50);
|
||||
ApplyImageBrush(CoreStyle, "TreeArrow_Expanded_Hovered", "/Panel/TreeArrow_Expanded.png", Icon10, TextColor);
|
||||
|
||||
ApplyImageBrush(CoreStyle, "NotificationList.DefaultMessage", "/Icons/EventMessage_Default.png", Icon40, TextColor);
|
||||
|
||||
ApplyImageBrush(EditorStyle, "TreeArrow_Collapsed", "/Panel/TreeArrow_Collapsed.png", Icon10, TextColor.WithAlpha(255 * 0.25));
|
||||
ApplyImageBrush(EditorStyle, "TreeArrow_Collapsed_Hovered", "/Panel/TreeArrow_Collapsed.png", Icon10, TextColor.WithAlpha(255 * 0.75));
|
||||
ApplyImageBrush(EditorStyle, "TreeArrow_Expanded", "/Panel/TreeArrow_Expanded.png", Icon10, TextColor.WithAlpha(255 * 0.25));
|
||||
ApplyImageBrush(EditorStyle, "TreeArrow_Expanded_Hovered", "/Panel/TreeArrow_Expanded.png", Icon10, TextColor.WithAlpha(255 * 0.75));
|
||||
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.TranslateMode", "/Icons/Viewport/icon_translateb_16x.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.RotateMode", "/Icons/Viewport/icon_rotateb_16x.png", Icon16, TextColor);
|
||||
ApplyImageBrush(EditorStyle, "EditorViewport.ScaleMode", "/Icons/Viewport/icon_scaleb_16x.png", Icon16, TextColor);
|
||||
|
||||
ApplyImageBrush(EditorStyle, "TimelineEditor.AddFloatTrack", "/Icons/Timeline/icon_TrackAddFloat_36x24px.png", FVector2D(36, 24), TextColor);
|
||||
ApplyImageBrush(EditorStyle, "TimelineEditor.AddVectorTrack", "/Icons/Timeline/icon_TrackAddVector_36x24px.png", FVector2D(36, 24), TextColor);
|
||||
ApplyImageBrush(EditorStyle, "TimelineEditor.AddEventTrack", "/Icons/Timeline/icon_TrackAddEvent_36x24px.png", FVector2D(36, 24), TextColor);
|
||||
ApplyImageBrush(EditorStyle, "TimelineEditor.AddColorTrack", "/Icons/Timeline/icon_TrackAddColor_36x24px.png", FVector2D(36, 24), TextColor);
|
||||
ApplyImageBrush(EditorStyle, "TimelineEditor.AddCurveAssetTrack", "/Icons/Timeline/icon_TrackAddCurve_36x24px.png", FVector2D(36, 24), TextColor);
|
||||
ApplyImageBrush(EditorStyle, "TimelineEditor.DeleteTrack", "/Icons/Timeline/icon_TrackDelete_36x24px.png", FVector2D(36, 24), TextColor);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
#include "Styling/SlateStyleRegistry.h"
|
||||
|
||||
void FColorizer::ColorIconsCustom()
|
||||
{
|
||||
if (DarkerNodesSettings->UseCustomIcons)
|
||||
{
|
||||
const ISlateStyle* MegascansConstStyle = FSlateStyleRegistry::FindSlateStyle("MegascansStyle");
|
||||
if (MegascansConstStyle != nullptr)
|
||||
{
|
||||
FSlateStyleSet* MegascansStyle = static_cast<FSlateStyleSet*>(const_cast<ISlateStyle*>(MegascansConstStyle));
|
||||
AddMenuIcon(MegascansStyle, "Megascans.Logo", "/Menu/megascans.png", ImageColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
#include "Classes/EditorStyleSettings.h"
|
||||
#include "EditorStyle/Private/SlateEditorStyle.cpp"
|
||||
|
||||
void FColorizer::ColorPanel()
|
||||
{
|
||||
if (!DarkerNodesSettings->UseCustomPanels)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const FButtonStyle CloseButton =
|
||||
FButtonStyle()
|
||||
.SetNormal(ImageBrush("/Elements/Panel/CloseApp_Normal.png", Icon16))
|
||||
.SetPressed(ImageBrush("/Elements/Panel/CloseApp_Pressed.png", Icon16))
|
||||
.SetHovered(ImageBrush("/Elements/Panel/CloseApp_Hovered.png", Icon16));
|
||||
|
||||
//ApplyColorBorderBrush(CoreStyle, "Border", Green);
|
||||
CoreStyle->Set(
|
||||
"Docking.Tab",
|
||||
FDockTabStyle()
|
||||
.SetCloseButtonStyle(CloseButton)
|
||||
.SetNormalBrush(*SlateBrush("GreyDark"))
|
||||
.SetHoveredBrush(*SlateBrush("HoverDark"))
|
||||
.SetForegroundBrush(*SlateBrush("GreyBase"))
|
||||
.SetActiveBrush(*SlateBrush("GreyBase"))
|
||||
.SetColorOverlayTabBrush(*SlateBrush("HoverDark"))
|
||||
.SetColorOverlayIconBrush(*SlateBrush("HoverDark"))
|
||||
.SetContentAreaBrush(*SlateBrush("GreyDark"))
|
||||
.SetTabWellBrush(FSlateNoResource())
|
||||
.SetTabPadding(FMargin(5, 2, 5, 2))
|
||||
.SetOverlapWidth(-1.0f)
|
||||
.SetFlashColor(FSlateColor(FLinearColor::FromSRGBColor(HoverDark)))
|
||||
);
|
||||
|
||||
CoreStyle->Set(
|
||||
"Docking.MajorTab",
|
||||
FDockTabStyle()
|
||||
.SetCloseButtonStyle(CloseButton)
|
||||
.SetNormalBrush(*SlateBrush("GreyBase"))
|
||||
.SetActiveBrush(*SlateBrush("HoverBase"))
|
||||
.SetColorOverlayTabBrush(*SlateBrush("GreyDark"))
|
||||
.SetColorOverlayIconBrush(*SlateBrush("GreyDark"))
|
||||
.SetForegroundBrush(*SlateBrush("GreyDark"))
|
||||
.SetHoveredBrush(*SlateBrush("HoverBase"))
|
||||
.SetContentAreaBrush(*SlateBrush("GreyDark"))
|
||||
.SetTabWellBrush(FSlateNoResource())
|
||||
.SetTabPadding(FMargin(8, 4, 8, 4))
|
||||
.SetOverlapWidth(0.0f)
|
||||
.SetFlashColor(FSlateColor(FLinearColor::FromSRGBColor(HoverBase)))
|
||||
);
|
||||
|
||||
//EditorStyle->Set("ToolPalette.DockingWell", new FSlateColorBrush(FLinearColor(Blue)));
|
||||
|
||||
CoreStyle->Set("ToolBar.Separator", SlateBrush("GreyDark"));
|
||||
|
||||
EditorStyle->Set("Graph.Panel.SolidBackground", SlateBrush("GreyDark"));
|
||||
|
||||
//ApplyImageBrush(EditorStyle, "Graph.Panel.SolidBackground", "/Graph/GraphPanel_SolidBackground.png", Icon16);
|
||||
|
||||
// new FSlateColorBrush(FLinearColor::FromSRGBColor(DebugRed))
|
||||
|
||||
EditorStyle->Set("Window.Background", SlateBrush("GreyDark"));
|
||||
CoreStyle->Set("ToolBar.Background", SlateBrush("GreyDark"));
|
||||
EditorStyle->Set("ToolBar.Background", SlateBrush("GreyDark"));
|
||||
CoreStyle->Set("Menu.Background", SlateBrush("GreyDark"));
|
||||
EditorStyle->Set("Menu.Background", SlateBrush("GreyDark"));
|
||||
|
||||
ApplyColorBoxBrush(EditorStyle, "Graph.InstructionBackground", FColor(40, 40, 40, 128));
|
||||
|
||||
|
||||
EditorStyle->Set("ContentBrowser.TileViewTooltip.ContentBorder", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("ProjectBrowser.TileViewTooltip.ContentBorder", SlateBrush("GreyBase"));
|
||||
|
||||
CoreStyle->Set("ToolPanel.GroupBorder", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("ToolPanel.GroupBorder", SlateBrush("GreyBase"));
|
||||
|
||||
EditorStyle->Set("PropertyTable.RowHeader.Background", SlateBrush("GreyDark"));
|
||||
EditorStyle->Set("PropertyTable.RowHeader.BackgroundActive", SlateBrush("HoverDark"));
|
||||
|
||||
EditorStyle->Set(
|
||||
"PropertyTable.TableRow",
|
||||
FTableRowStyle()
|
||||
.SetEvenRowBackgroundBrush(FSlateColorBrush(FLinearColor::FromSRGBColor(MixColor(GreyBase, FColor::Black, 0.2))))
|
||||
.SetEvenRowBackgroundHoveredBrush(ColorImageBrush(HoverBase, Icon8))
|
||||
.SetOddRowBackgroundBrush(FSlateColorBrush(FLinearColor::FromSRGBColor(GreyBase)))
|
||||
.SetOddRowBackgroundHoveredBrush(ColorImageBrush(HoverBase, Icon8))
|
||||
.SetSelectorFocusedBrush(ColorBorderBrush(Primary))
|
||||
.SetActiveBrush(ColorImageBrush(HoverBase, Icon8))
|
||||
.SetActiveHoveredBrush(ColorImageBrush(HoverBase, Icon8))
|
||||
.SetInactiveBrush(ColorImageBrush(HoverBase, Icon8))
|
||||
.SetInactiveHoveredBrush(ColorImageBrush(HoverBase, Icon8))
|
||||
.SetTextColor(*BrushDatabase->GetSlateColor("TextColor"))
|
||||
.SetSelectedTextColor(*BrushDatabase->GetSlateColor("TextColor"))
|
||||
);
|
||||
|
||||
EditorStyle->Set("SCSEditor.TreePanel", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("ContentBrowser.TopBar.GroupBorder", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("ToolPanel.DarkGroupBorder", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("ToolPanel.LightGroupBorder", SlateBrush("GreyBase"));
|
||||
|
||||
EditorStyle->Set("DetailsView.CollapsedCategory", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("DetailsView.CollapsedCategory_Hovered", SlateBrush("HoverDark"));
|
||||
EditorStyle->Set("DetailsView.CategoryTop", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("DetailsView.CategoryTop_Hovered", SlateBrush("HoverDark"));
|
||||
EditorStyle->Set("DetailsView.CategoryMiddle", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("DetailsView.CategoryMiddle_Hovered", SlateBrush("HoverBase"));
|
||||
EditorStyle->Set("DetailsView.CategoryBottom", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("DetailsView.AdvancedDropdownBorder", SlateBrush("GreyBase"));
|
||||
EditorStyle->Set("DetailsView.AdvancedDropdownBorder.Open", SlateBrush("GreyBase"));
|
||||
|
||||
UEditorStyleSettings* StyleSettings = GetMutableDefault<UEditorStyleSettings>();
|
||||
StyleSettings->SelectionColor = FLinearColor::FromSRGBColor(HoverBaseBright);
|
||||
StyleSettings->PressedSelectionColor = FLinearColor::FromSRGBColor(HoverBaseBright);
|
||||
StyleSettings->InactiveSelectionColor = FLinearColor::FromSRGBColor(HoverBase);
|
||||
StyleSettings->SaveConfig();
|
||||
|
||||
FCoreStyle::SetSelectionColor(FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
//FCoreStyle::SetSelectorColor(FLinearColor::FromSRGBColor(Green));
|
||||
FCoreStyle::SetPressedSelectionColor(FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
FCoreStyle::SetInactiveSelectionColor(FLinearColor::FromSRGBColor(HoverBase));
|
||||
|
||||
|
||||
CoreStyle->Set("InvertedForeground", *BrushDatabase->GetSlateColor("TextColor"));
|
||||
CoreStyle->Set("DefaultForeground", *BrushDatabase->GetSlateColor("TextColor"));
|
||||
EditorStyle->Set("InvertedForeground", *BrushDatabase->GetSlateColor("TextColor"));
|
||||
EditorStyle->Set("DefaultForeground", *BrushDatabase->GetSlateColor("TextColor"));
|
||||
|
||||
CoreStyle->Set(
|
||||
"Docking.UnhideTabwellButton",
|
||||
FButtonStyle(CoreStyle->GetWidgetStyle<FButtonStyle>("Button"))
|
||||
.SetNormal(ColorImageBrush(FColor::Transparent, FVector2D(10, 10)))
|
||||
.SetPressed(ImageBrush("/Docking/ShowTabwellButton_Pressed.png", FVector2D(10, 10)))
|
||||
.SetHovered(ImageBrush("/Docking/ShowTabwellButton_Hovered.png", FVector2D(10, 10)))
|
||||
.SetNormalPadding(0)
|
||||
.SetPressedPadding(0)
|
||||
);
|
||||
|
||||
const FTableColumnHeaderStyle TableColumnHeaderStyle =
|
||||
FTableColumnHeaderStyle()
|
||||
.SetSortPrimaryAscendingImage(ImageBrush("/Panel/SortUpArrow.png", FVector2D(8, 4)))
|
||||
.SetSortPrimaryDescendingImage(ImageBrush("/Panel/SortDownArrow.png", FVector2D(8, 4)))
|
||||
.SetSortSecondaryAscendingImage(ImageBrush("/Panel/SortUpArrows.png", FVector2D(16, 4)))
|
||||
.SetSortSecondaryDescendingImage(ImageBrush("/Panel/SortDownArrows.png", FVector2D(16, 4)))
|
||||
.SetNormalBrush(*SlateBrush("GreyDark"))
|
||||
.SetHoveredBrush(*SlateBrush("HoverDark"))
|
||||
.SetMenuDropdownImage(ImageBrush("/Panel/ColumnHeader_Arrow.png", Icon8))
|
||||
.SetMenuDropdownNormalBorderBrush(*SlateBrush("GreyBase"))
|
||||
.SetMenuDropdownHoveredBorderBrush(*SlateBrush("HoverBase"));
|
||||
CoreStyle->Set("TableView.Header.Column", TableColumnHeaderStyle);
|
||||
|
||||
const FSplitterStyle TableHeaderSplitterStyle =
|
||||
FSplitterStyle()
|
||||
.SetHandleNormalBrush(FSlateNoResource())
|
||||
.SetHandleHighlightBrush(ImageBrush("/Panel/HeaderSplitterGrip.png", Icon8));
|
||||
|
||||
CoreStyle->Set(
|
||||
"TableView.Header",
|
||||
FHeaderRowStyle()
|
||||
.SetColumnStyle(TableColumnHeaderStyle)
|
||||
.SetLastColumnStyle(TableColumnHeaderStyle)
|
||||
.SetColumnSplitterStyle(TableHeaderSplitterStyle)
|
||||
.SetBackgroundBrush(*SlateBrush("GreyDark"))
|
||||
.SetForegroundColor(*BrushDatabase->GetSlateColor("TextColor"))
|
||||
);
|
||||
|
||||
EditorStyle->Set(
|
||||
"PropertyTable.HeaderRow",
|
||||
FHeaderRowStyle()
|
||||
.SetColumnStyle(TableColumnHeaderStyle)
|
||||
.SetLastColumnStyle(TableColumnHeaderStyle)
|
||||
.SetColumnSplitterStyle(TableHeaderSplitterStyle)
|
||||
.SetBackgroundBrush(*SlateBrush("GreyDark"))
|
||||
.SetForegroundColor(*BrushDatabase->GetSlateColor("TextColor"))
|
||||
);
|
||||
|
||||
CoreStyle->Set("PopupText.Background", SlateBrush("GreyDark"));
|
||||
CoreStyle->Set("NotificationList.ItemBackground", SlateBrush("PanelDark"));
|
||||
|
||||
EditorStyle->Set(
|
||||
"TableView.DarkRow",
|
||||
FTableRowStyle(EditorStyle->GetWidgetStyle<FTableRowStyle>("TableView.Row"))
|
||||
.SetEvenRowBackgroundBrush(*SlateBrush("GreyBase"))
|
||||
.SetEvenRowBackgroundHoveredBrush(*SlateBrush("GreyBase"))
|
||||
.SetOddRowBackgroundBrush(*SlateBrush("GreyBase"))
|
||||
.SetOddRowBackgroundHoveredBrush(*SlateBrush("GreyBase"))
|
||||
.SetSelectorFocusedBrush(*SlateBrush("HoverBase"))
|
||||
.SetActiveBrush(*SlateBrush("HoverBase"))
|
||||
.SetActiveHoveredBrush(*SlateBrush("HoverBase"))
|
||||
.SetInactiveBrush(*SlateBrush("HoverBase"))
|
||||
.SetInactiveHoveredBrush(*SlateBrush("HoverBase"))
|
||||
);
|
||||
|
||||
EditorStyle->Set(
|
||||
"PlacementBrowser.Tab",
|
||||
FCheckBoxStyle()
|
||||
.SetCheckBoxType(ESlateCheckBoxType::ToggleButton)
|
||||
.SetUncheckedImage(*SlateBrush("GreyDark"))
|
||||
.SetUncheckedPressedImage(*SlateBrush("HoverDark"))
|
||||
.SetUncheckedHoveredImage(*SlateBrush("HoverDark"))
|
||||
.SetCheckedImage(*SlateBrush("HoverDark"))
|
||||
.SetCheckedHoveredImage(*SlateBrush("HoverDark"))
|
||||
.SetCheckedPressedImage(*SlateBrush("HoverDark"))
|
||||
.SetPadding(0));
|
||||
|
||||
EditorStyle->Set("Sequencer.ToolBar.Background", SlateBrush("GreyBase"));
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
#include "Materials/MaterialInstanceDynamic.h"
|
||||
#include "Classes/EditorStyleSettings.h"
|
||||
|
||||
void FColorizer::ApplyParameters() const
|
||||
{
|
||||
ApplyFonts();
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("GreyBase")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(GreyBase));
|
||||
BrushDatabase->GetDynamicMaterial("GreyLight")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(GreyLight));
|
||||
BrushDatabase->GetDynamicMaterial("GreyDark")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Debug")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(DebugRed));
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("HoverDark")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(HoverDark));
|
||||
BrushDatabase->GetDynamicMaterial("HoverBase")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(HoverBase));
|
||||
BrushDatabase->GetDynamicMaterial("HoverBaseBright")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("Primary")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->SetSlateColor("TextColor", FLinearColor::FromSRGBColor(TextColor));
|
||||
BrushDatabase->GetDynamicMaterial("ScrollbarColor")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(ScrollbarColor));
|
||||
BrushDatabase->GetDynamicMaterial("MainWindowColor")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(MainWindowColor));
|
||||
BrushDatabase->GetDynamicMaterial("ChildWindowColor")->SetVectorParameterValue("Color", FLinearColor::FromSRGBColor(ChildWindowColor));
|
||||
|
||||
BrushDatabase->SetSlateColor("GridLine", FLinearColor::FromSRGBColor(GridLineColor));
|
||||
BrushDatabase->SetSlateColor("GridRule", FLinearColor::FromSRGBColor(GridRuleColor));
|
||||
BrushDatabase->SetSlateColor("GridCenter", FLinearColor::FromSRGBColor(GridCenterColor));
|
||||
|
||||
if (DarkerNodesSettings->UseCustomPanels)
|
||||
{
|
||||
GetMutableDefault<UEditorStyleSettings>()->RegularColor = BrushDatabase->GetColor("GridLine").Get();
|
||||
GetMutableDefault<UEditorStyleSettings>()->RuleColor = BrushDatabase->GetColor("GridRule").Get();
|
||||
GetMutableDefault<UEditorStyleSettings>()->CenterColor = BrushDatabase->GetColor("GridCenter").Get();
|
||||
GetMutableDefault<UEditorStyleSettings>()->SaveConfig();
|
||||
}
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("Button")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(ButtonBorderColor));
|
||||
BrushDatabase->GetDynamicMaterial("Button")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Hovered")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Hovered")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Hovered")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Pressed")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Pressed")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Pressed")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Disabled")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Disabled")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Disabled")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Disabled")->SetScalarParameterValue("Alpha", 0.5);
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(ButtonBorderColor));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Hovered")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Hovered")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Hovered")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Pressed")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Pressed")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Pressed")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Checked")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Checked")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Checked")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Hovered_Checked")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Hovered_Checked")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Start_Hovered_Checked")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(ButtonBorderColor));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Hovered")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Hovered")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Pressed")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Pressed")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Checked")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Checked")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Hovered_Checked")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
BrushDatabase->GetDynamicMaterial("Button_Middle_Hovered_Checked")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("Button_End")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(ButtonBorderColor));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Hovered")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Hovered")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Hovered")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Pressed")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverDark));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Pressed")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Pressed")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Checked")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Checked")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Checked")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Hovered_Checked")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(HoverBaseBright));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Hovered_Checked")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(Primary));
|
||||
BrushDatabase->GetDynamicMaterial("Button_End_Hovered_Checked")->SetScalarParameterValue("Radius", DarkerNodesSettings->ButtonRadius);
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_body")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(RegularNodeBackground));
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_body")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(RegularNodeBorder));
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_body")->SetScalarParameterValue("Radius", DarkerNodesSettings->BlueprintRegularNodeRadius);
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_shadow_selected")->SetScalarParameterValue("Radius", DarkerNodesSettings->BlueprintRegularNodeRadius + 2);
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_shadow_selected")->SetVectorParameterValue("Border", Primary);
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_shadow_selected")->SetVectorParameterValue("Background", Primary.WithAlpha(0.0f));
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_color_spill")->SetScalarParameterValue("Radius", DarkerNodesSettings->BlueprintRegularNodeRadius);
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_color_spill")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(MixColor(FColor::Black, FColor::White, DarkerNodesSettings->BlueprintNodeHeaderSaturation)));
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_color_spill")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(MixColor(FColor::Black, FColor::White, DarkerNodesSettings->BlueprintNodeHeaderSaturation)));
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_color_spill")->SetScalarParameterValue("Alpha", DarkerNodesSettings->BlueprintNodeHeaderOpacity);
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("PanelDark")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(GreyDark));
|
||||
BrushDatabase->GetDynamicMaterial("PanelDark")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(GreyBase));
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_body")->SetVectorParameterValue("Background", FLinearColor::FromSRGBColor(VarNodeBackground));
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_body")->SetVectorParameterValue("Border", FLinearColor::FromSRGBColor(VarNodeBorder));
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_body")->SetScalarParameterValue("Radius", DarkerNodesSettings->BlueprintVarNodeRadius);
|
||||
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_shadow_selected")->SetScalarParameterValue("Radius", DarkerNodesSettings->BlueprintVarNodeRadius + 2);
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_shadow_selected")->SetVectorParameterValue("Border", Primary);
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_shadow_selected")->SetVectorParameterValue("Background", Primary.WithAlpha(0.0f));
|
||||
|
||||
if (DarkerNodesSettings->ExtendNodes)
|
||||
{
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_body")->SetVectorParameterValue("Padding", FLinearColor(0, 0, 4, 0));
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_body")->SetVectorParameterValue("Padding", FLinearColor(0, 0, 4, 0));
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_shadow_selected")->SetVectorParameterValue("Padding", FLinearColor(10, 10, 14, 10));
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_shadow_selected")->SetVectorParameterValue("Padding", FLinearColor(10, 10, 14, 10));
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_color_spill")->SetVectorParameterValue("Padding", FLinearColor(1, 1, 0, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_body")->SetVectorParameterValue("Padding", FLinearColor(4, 2, 4, 2));
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_body")->SetVectorParameterValue("Padding", FLinearColor(4, 2, 4, 2));
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_shadow_selected")->SetVectorParameterValue("Padding", FLinearColor(14, 12, 14, 12));
|
||||
BrushDatabase->GetDynamicMaterial("VarNode_shadow_selected")->SetVectorParameterValue("Padding", FLinearColor(14, 12, 14, 12));
|
||||
BrushDatabase->GetDynamicMaterial("RegularNode_color_spill")->SetVectorParameterValue("Padding", FLinearColor(5, 3, 0, 0));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
|
||||
void FColorizer::SaveStyleForUMG()
|
||||
{
|
||||
// Hack to save the slates for UMG
|
||||
|
||||
CoreStyle->Set("Saved_Checkbox", CoreStyle->GetWidgetStyle<FCheckBoxStyle>("Checkbox"));
|
||||
CoreStyle->Set("Saved_SpinBox", CoreStyle->GetWidgetStyle<FSpinBoxStyle>("SpinBox"));
|
||||
CoreStyle->Set("Saved_Button", CoreStyle->GetWidgetStyle<FButtonStyle>("Button"));
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
|
||||
void FColorizer::ColorText()
|
||||
{
|
||||
if (!DarkerNodesSettings->UseCustomButton)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CoreStyle->Set("NormalFont", FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(9)));
|
||||
CoreStyle->Set("SmallFont", FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8)));
|
||||
|
||||
EditorStyle->Set("NormalFont", FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(9)));
|
||||
EditorStyle->Set("BoldFont", FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(9)));
|
||||
|
||||
// FLinearColor(0.19f, 0.33f, 0.72f);
|
||||
|
||||
NormalText =
|
||||
FTextBlockStyle()
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(9)))
|
||||
.SetColorAndOpacity(*BrushDatabase->GetSlateColor("TextColor"))
|
||||
.SetShadowOffset(FVector2D::ZeroVector)
|
||||
.SetShadowColorAndOpacity(FLinearColor::FromSRGBColor(TextShadow))
|
||||
.SetHighlightColor(FLinearColor::FromSRGBColor(Primary));
|
||||
|
||||
const FTextBlockStyle ShadowText =
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetShadowOffset(FVector2D(1.0f, 1.0f));
|
||||
|
||||
CoreStyle->Set("NormalText", NormalText);
|
||||
|
||||
CoreStyle->Set(
|
||||
"SmallText",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set("NormalText", NormalText);
|
||||
|
||||
EditorStyle->Set(
|
||||
"NormalText.Subdued",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetColorAndOpacity(FSlateColor::UseSubduedForeground()));
|
||||
|
||||
EditorStyle->Set(
|
||||
"NormalText.Important",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(9)))
|
||||
.SetShadowOffset(FVector2D(1, 1)));
|
||||
|
||||
EditorStyle->Set(
|
||||
"SmallText",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"SmallText.Subdued",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8)))
|
||||
.SetColorAndOpacity(FSlateColor::UseSubduedForeground()));
|
||||
|
||||
EditorStyle->Set(
|
||||
"TinyText",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"TinyText.Subdued",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8)))
|
||||
.SetColorAndOpacity(FSlateColor::UseSubduedForeground()));
|
||||
|
||||
EditorStyle->Set(
|
||||
"LargeText",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(11)))
|
||||
.SetShadowOffset(FVector2D(1, 1)));
|
||||
|
||||
const FEditableTextBoxStyle NormalEditableTextBoxStyle =
|
||||
FEditableTextBoxStyle()
|
||||
.SetFont(NormalText.Font)
|
||||
.SetBackgroundImageNormal(*SlateBrush("Button"))
|
||||
.SetBackgroundImageHovered(*SlateBrush("Button_Hovered"))
|
||||
.SetBackgroundImageFocused(*SlateBrush("Button_Hovered"))
|
||||
.SetBackgroundImageReadOnly(*SlateBrush("Button_Disabled"))
|
||||
.SetForegroundColor(FLinearColor::FromSRGBColor(TextColor))
|
||||
.SetScrollBarStyle(CoreStyle->GetWidgetStyle<FScrollBarStyle>("Scrollbar"));
|
||||
|
||||
CoreStyle->Set("NormalEditableTextBox", NormalEditableTextBoxStyle);
|
||||
EditorStyle->Set("NormalEditableTextBox", NormalEditableTextBoxStyle);
|
||||
|
||||
CoreStyle->Set(
|
||||
"EmbossedText",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(24)))
|
||||
.SetColorAndOpacity(*BrushDatabase->GetSlateColor("TextColor"))
|
||||
.SetShadowOffset(FVector2D(1.0f, 1.0f))
|
||||
);
|
||||
|
||||
CoreStyle->Set(
|
||||
"SearchBox",
|
||||
FSearchBoxStyle()
|
||||
.SetTextBoxStyle(NormalEditableTextBoxStyle)
|
||||
.SetUpArrowImage(ImageBrush("/Elements/Textbox/UpArrow.png", Icon8))
|
||||
.SetDownArrowImage(ImageBrush("/Elements/Textbox/DownArrow.png", Icon8))
|
||||
.SetGlassImage(ImageBrush("/Elements/Textbox/SearchGlass.png", Icon16))
|
||||
.SetClearImage(ImageBrush("/Elements/Textbox/X.png", Icon16))
|
||||
);
|
||||
|
||||
EditorStyle->Set(
|
||||
"LevelViewportContextMenu.ActorType.Text",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"LevelViewportContextMenu.AssetLabel.Text",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(9))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"EditorModesToolbar.Label",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(7))));
|
||||
EditorStyle->Set(
|
||||
"EditorModesToolbar.EditableText",
|
||||
FEditableTextBoxStyle(NormalEditableTextBoxStyle)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(9))));
|
||||
EditorStyle->Set(
|
||||
"EditorModesToolbar.Keybinding",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"ToolBar.Label",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(9))));
|
||||
EditorStyle->Set(
|
||||
"ToolBar.EditableText",
|
||||
FEditableTextBoxStyle(NormalEditableTextBoxStyle)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(9))));
|
||||
EditorStyle->Set(
|
||||
"ToolBar.Keybinding",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"ToolBar.Heading",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"ViewportMenu.Label",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(9))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"SProjectBadge.Text",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(12))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"Editor.SearchBoxFont",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(12))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"ViewportPinnedCommandList.Label",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(9))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"ViewportPinnedCommandList.EditableText",
|
||||
FEditableTextBoxStyle(NormalEditableTextBoxStyle)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(9))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"ViewportPinnedCommandList.Keybinding",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"ViewportPinnedCommandList.Heading",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"PlacementBrowser.Tab.Text",
|
||||
FTextBlockStyle(ShadowText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(10))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"PlacementBrowser.Asset.Name",
|
||||
FTextBlockStyle(ShadowText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(10))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"PlacementBrowser.Asset.Type",
|
||||
FTextBlockStyle(ShadowText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8))));
|
||||
|
||||
EditorStyle->Set(
|
||||
"FlatButton.DefaultTextStyle",
|
||||
FTextBlockStyle(ShadowText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(10)))
|
||||
.SetHighlightColor(FLinearColor::FromSRGBColor(Primary)));
|
||||
|
||||
EditorStyle->Set(
|
||||
"Profiler.EventGraph.DarkText",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(8)))
|
||||
);
|
||||
|
||||
EditorStyle->Set(
|
||||
"WorldBrowser.LabelFont",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", GetFontSize(9)))
|
||||
);
|
||||
|
||||
EditorStyle->Set(
|
||||
"WorldBrowser.LabelFontBold",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(10)))
|
||||
);
|
||||
|
||||
const FString FontAwesomePath = FPaths::EngineContentDir() / TEXT("Editor/Slate/Fonts/FontAwesome.ttf");
|
||||
|
||||
EditorStyle->Set(
|
||||
"FindResults.FindInBlueprints",
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FSlateFontInfo(FontAwesomePath, GetFontSize(10))));
|
||||
|
||||
// ----
|
||||
|
||||
const FInlineEditableTextBlockStyle InlineEditableTextBlockStyle =
|
||||
FInlineEditableTextBlockStyle()
|
||||
.SetTextStyle(NormalText)
|
||||
.SetEditableTextBoxStyle(NormalEditableTextBoxStyle);
|
||||
|
||||
EditorStyle->Set("InlineEditableTextBlockStyle", InlineEditableTextBlockStyle);
|
||||
CoreStyle->Set("InlineEditableTextBlockStyle", InlineEditableTextBlockStyle);
|
||||
EditorStyle->Set("Graph.Node.InlineEditablePinName", InlineEditableTextBlockStyle);
|
||||
|
||||
const FTextBlockStyle GraphNodeTitle =
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(10)));
|
||||
|
||||
EditorStyle->Set("Graph.Node.NodeTitle", GraphNodeTitle);
|
||||
EditorStyle->Set("Graph.Node.NodeTitleEditableText", NormalEditableTextBoxStyle);
|
||||
EditorStyle->Set("Graph.StateNode.NodeTitleEditableText", NormalEditableTextBoxStyle);
|
||||
|
||||
EditorStyle->Set(
|
||||
"Graph.Node.NodeTitleInlineEditableText",
|
||||
FInlineEditableTextBlockStyle()
|
||||
.SetTextStyle(GraphNodeTitle)
|
||||
.SetEditableTextBoxStyle(NormalEditableTextBoxStyle)
|
||||
);
|
||||
|
||||
EditorStyle->Set(
|
||||
"Graph.StateNode.NodeTitleInlineEditableText",
|
||||
FInlineEditableTextBlockStyle()
|
||||
.SetTextStyle(GraphNodeTitle)
|
||||
.SetEditableTextBoxStyle(NormalEditableTextBoxStyle)
|
||||
);
|
||||
|
||||
// ----
|
||||
|
||||
const FTextBlockStyle GraphCommentBlockTitle =
|
||||
FTextBlockStyle(NormalText)
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Bold", GetFontSize(18)))
|
||||
.SetColorAndOpacity(FSlateColor(FColor::White))
|
||||
.SetShadowOffset(FVector2D(1.5f, 1.5f))
|
||||
.SetShadowColorAndOpacity(FLinearColor::FromSRGBColor(TextShadow));
|
||||
EditorStyle->Set("Graph.CommentBlock.Title", GraphCommentBlockTitle);
|
||||
|
||||
const FEditableTextBoxStyle GraphCommentBlockTitleEditableText =
|
||||
FEditableTextBoxStyle(NormalEditableTextBoxStyle)
|
||||
.SetFont(GraphCommentBlockTitle.Font);
|
||||
EditorStyle->Set("Graph.CommentBlock.TitleEditableText", GraphCommentBlockTitleEditableText);
|
||||
|
||||
EditorStyle->Set(
|
||||
"Graph.CommentBlock.TitleInlineEditableText",
|
||||
FInlineEditableTextBlockStyle()
|
||||
.SetTextStyle(GraphCommentBlockTitle)
|
||||
.SetEditableTextBoxStyle(GraphCommentBlockTitleEditableText)
|
||||
);
|
||||
}
|
||||
|
||||
int32 FColorizer::GetFontSize(int32 BaseSize) const
|
||||
{
|
||||
switch (DarkerNodesSettings->FontSize)
|
||||
{
|
||||
case EFontSize::Small:
|
||||
return BaseSize * 0.8f;
|
||||
case EFontSize::Normal:
|
||||
return BaseSize;
|
||||
case EFontSize::Big:
|
||||
return BaseSize * 1.2f;
|
||||
case EFontSize::Bigger:
|
||||
return BaseSize * 1.5f;
|
||||
default:
|
||||
return BaseSize;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
#include "Lib/ColorLib.h"
|
||||
|
||||
void FColorizer::AddMenuIcon(FSlateStyleSet* StyleSet, FString Name, FString Location, FColor Color) const
|
||||
{
|
||||
switch (DarkerNodesSettings->IconStyle)
|
||||
{
|
||||
case EIconStyle::Line:
|
||||
ApplyImageBrush(StyleSet, FName(*Name), Location.Replace(TEXT("/Menu"), TEXT("/Menu/Line")), Icon40, Color);
|
||||
ApplyImageBrush(StyleSet, FName(*(Name + FString(".Small"))), Location.Replace(TEXT("/Menu"), TEXT("/Menu/Line.Small")), Icon20, Color);
|
||||
break;
|
||||
case EIconStyle::Solid:
|
||||
ApplyImageBrush(StyleSet, FName(*Name), Location.Replace(TEXT("/Menu"), TEXT("/Menu/Solid")), Icon40, Color);
|
||||
ApplyImageBrush(StyleSet, FName(*(Name + FString(".Small"))), Location.Replace(TEXT("/Menu"), TEXT("/Menu/Solid.Small")), Icon20, Color);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void FColorizer::ApplyImageBrush(FSlateStyleSet* StyleSet, FName Name, FString Location, FVector2D Size) const
|
||||
{
|
||||
ApplyImageBrush(StyleSet, Name, Location, Size, ImageColor);
|
||||
}
|
||||
|
||||
void FColorizer::ApplyImageBrush(FSlateStyleSet* StyleSet, FName Name, FString Location, FVector2D Size, FColor Color) const
|
||||
{
|
||||
StyleSet->Set(
|
||||
Name,
|
||||
new FSlateImageBrush(
|
||||
ThemeDirectory + Location,
|
||||
Size,
|
||||
FLinearColor::FromSRGBColor(Color)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
FSlateImageBrush FColorizer::ImageBrush(FString Location, FVector2D Size) const
|
||||
{
|
||||
return ImageBrush(Location, Size, ImageColor);
|
||||
}
|
||||
|
||||
FSlateImageBrush FColorizer::ImageBrush(FString Location, FVector2D Size, FColor Color) const
|
||||
{
|
||||
return FSlateImageBrush(
|
||||
ThemeDirectory + Location,
|
||||
Size,
|
||||
FLinearColor::FromSRGBColor(Color)
|
||||
);
|
||||
}
|
||||
|
||||
FSlateImageBrush FColorizer::ColorImageBrush(FColor Color, FVector2D Size) const
|
||||
{
|
||||
return FSlateImageBrush(
|
||||
ThemeDirectory + FString("/Blank.png"),
|
||||
Size,
|
||||
FLinearColor::FromSRGBColor(Color)
|
||||
);
|
||||
}
|
||||
|
||||
void FColorizer::ApplyBoxBrush(FSlateStyleSet* StyleSet, FName Name, FString Location, FMargin Margin, FColor Color) const
|
||||
{
|
||||
StyleSet->Set(
|
||||
Name,
|
||||
new FSlateBoxBrush(
|
||||
ThemeDirectory + Location,
|
||||
Margin,
|
||||
FLinearColor::FromSRGBColor(Color)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void FColorizer::ApplyColorBoxBrush(FSlateStyleSet* StyleSet, FName Name, FColor Color) const
|
||||
{
|
||||
StyleSet->Set(
|
||||
Name,
|
||||
new FSlateBoxBrush(
|
||||
ThemeDirectory + FString("/Blank.png"),
|
||||
FMargin(0.25),
|
||||
FLinearColor::FromSRGBColor(Color)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
FSlateBoxBrush FColorizer::BoxBrush(FString Location, FVector2D Size, FMargin Margin, FColor Color) const
|
||||
{
|
||||
return FSlateBoxBrush(
|
||||
ThemeDirectory + Location,
|
||||
Size,
|
||||
Margin,
|
||||
FLinearColor::FromSRGBColor(Color)
|
||||
);
|
||||
}
|
||||
|
||||
void FColorizer::ApplyColorBorderBrush(FSlateStyleSet* StyleSet, FName Name, FColor Color) const
|
||||
{
|
||||
StyleSet->Set(
|
||||
Name,
|
||||
new FSlateBorderBrush(
|
||||
ThemeDirectory + FString("/Blank.png"),
|
||||
FMargin(0.25),
|
||||
FLinearColor::FromSRGBColor(Color)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
FSlateBorderBrush FColorizer::ColorBorderBrush(FColor Color, FMargin Margin) const
|
||||
{
|
||||
return BorderBrush(
|
||||
FString("/Blank.png"),
|
||||
Margin,
|
||||
Color
|
||||
);
|
||||
}
|
||||
|
||||
FSlateBrush* FColorizer::SlateBrush(FString Name) const
|
||||
{
|
||||
return BrushDatabase->GetSlateBrush(Name);
|
||||
}
|
||||
|
||||
FSlateBorderBrush FColorizer::BorderBrush(FString Location, FMargin Margin, FColor Color) const
|
||||
{
|
||||
return FSlateBorderBrush(
|
||||
ThemeDirectory + Location,
|
||||
Margin,
|
||||
Color
|
||||
);
|
||||
}
|
||||
|
||||
void FColorizer::ApplyCenterIcon(FSlateStyleSet* StyleSet, FName Name, FString Location, FVector2D Size, FColor Color) const
|
||||
{
|
||||
StyleSet->Set(
|
||||
Name,
|
||||
BrushDatabase->GetCenteredImageBrush(
|
||||
Name.ToString(),
|
||||
Location,
|
||||
Size,
|
||||
Color
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
FSlateBrush* FColorizer::CenterIcon(FName Name, FString Location, FVector2D Size, FColor Color) const
|
||||
{
|
||||
return BrushDatabase->GetCenteredImageBrush(
|
||||
Name.ToString(),
|
||||
Location,
|
||||
Size,
|
||||
Color
|
||||
);
|
||||
}
|
||||
|
||||
FColor FColorizer::InvertLight(FColor Color)
|
||||
{
|
||||
FVector LAB = FColorLib::XYZtoLAB(FColorLib::RGBtoXYZ(Color));
|
||||
LAB.X = 100.0f - LAB.X;
|
||||
return FColorLib::XYZtoRGB(FColorLib::LABtoXYZ(LAB));
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "Colorizer.h"
|
||||
#include "Classes/EditorStyleSettings.h"
|
||||
|
||||
void FColorizer::ColorWindow()
|
||||
{
|
||||
if (!DarkerNodesSettings->UseCustomPanels)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#if !PLATFORM_MAC
|
||||
const FVector2D IconWindow = FVector2D(30, 18);
|
||||
const FColor TextColor50 = TextColor.WithAlpha(255 * 0.5);
|
||||
const FColor TextColor75 = TextColor.WithAlpha(255 * 0.75);
|
||||
|
||||
const FButtonStyle Button = CoreStyle->GetWidgetStyle<FButtonStyle>("Button");
|
||||
|
||||
const FButtonStyle MinimizeButtonStyle =
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(*CenterIcon("WindowButton_Minimize_Normal", "/Window/WindowButton_Minimize.png", IconWindow, TextColor50))
|
||||
.SetHovered(*CenterIcon("WindowButton_Minimize_Hovered", "/Window/WindowButton_Minimize.png", IconWindow, TextColor))
|
||||
.SetPressed(*CenterIcon("WindowButton_Minimize_Pressed", "/Window/WindowButton_Minimize.png", IconWindow, TextColor75));
|
||||
|
||||
const FButtonStyle MaximizeButtonStyle =
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(*CenterIcon("WindowButton_Maximize_Normal", "/Window/WindowButton_Maximize.png", IconWindow, TextColor50))
|
||||
.SetHovered(*CenterIcon("WindowButton_Maximize_Hovered", "/Window/WindowButton_Maximize.png", IconWindow, TextColor))
|
||||
.SetPressed(*CenterIcon("WindowButton_Maximize_Pressed", "/Window/WindowButton_Maximize.png", IconWindow, TextColor75));
|
||||
|
||||
const FButtonStyle RestoreButtonStyle =
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(*CenterIcon("WindowButton_Restore_Normal", "/Window/WindowButton_Restore.png", IconWindow, TextColor50))
|
||||
.SetHovered(*CenterIcon("WindowButton_Restore_Hovered", "/Window/WindowButton_Restore.png", IconWindow, TextColor))
|
||||
.SetPressed(*CenterIcon("WindowButton_Restore_Pressed", "/Window/WindowButton_Restore.png", IconWindow, TextColor75));
|
||||
|
||||
const FButtonStyle CloseButtonStyle =
|
||||
FButtonStyle(Button)
|
||||
.SetNormal(*CenterIcon("WindowButton_Close_Normal", "/Window/WindowButton_Close.png", IconWindow, TextColor50))
|
||||
.SetHovered(*CenterIcon("WindowButton_Close_Hovered", "/Window/WindowButton_Close.png", IconWindow, TextColor))
|
||||
.SetPressed(*CenterIcon("WindowButton_Close_Pressed", "/Window/WindowButton_Close.png", IconWindow, TextColor75));
|
||||
#endif
|
||||
|
||||
|
||||
const FTextBlockStyle TitleTextStyle =
|
||||
FTextBlockStyle(CoreStyle->GetWidgetStyle<FTextBlockStyle>("NormalText"))
|
||||
.SetFont(FCoreStyle::GetDefaultFontStyle("Regular", 9))
|
||||
.SetShadowOffset(FVector2D(1.0f, 1.0f));
|
||||
|
||||
CoreStyle->Set(
|
||||
"Window",
|
||||
FWindowStyle()
|
||||
#if !PLATFORM_MAC
|
||||
.SetMinimizeButtonStyle(MinimizeButtonStyle)
|
||||
.SetMaximizeButtonStyle(MaximizeButtonStyle)
|
||||
.SetRestoreButtonStyle(RestoreButtonStyle)
|
||||
.SetCloseButtonStyle(CloseButtonStyle)
|
||||
#endif
|
||||
.SetTitleTextStyle(TitleTextStyle)
|
||||
.SetActiveTitleBrush(ImageBrush("/Transparent.png", Icon32))
|
||||
.SetInactiveTitleBrush(ImageBrush("/Window/WindowTitle_Inactive.png", Icon32))
|
||||
.SetFlashTitleBrush(ImageBrush("/Window/WindowTitle_Flashing.png", Icon24))
|
||||
.SetOutlineBrush(BorderBrush("/Window/WindowOutline.png"))
|
||||
.SetOutlineColor(FLinearColor(0.1f, 0.1f, 0.1f, 1.0f))
|
||||
.SetBorderBrush(BoxBrush("/Transparent.png", Icon256, 0.48f))
|
||||
.SetBackgroundBrush(*SlateBrush("MainWindowColor"))
|
||||
.SetChildBackgroundBrush(*SlateBrush("ChildWindowColor"))
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "DarkerNodes.h"
|
||||
#include "DarkerNodesCommands.h"
|
||||
#include "Interfaces/IPluginManager.h"
|
||||
#include "MainFrame/Public/Interfaces/IMainFrameModule.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FDarkerNodesModule"
|
||||
|
||||
void FDarkerNodesModule::StartupModule()
|
||||
{
|
||||
const FString ShaderDirectory = IPluginManager::Get().FindPlugin(TEXT("DarkerNodes"))->GetBaseDir() + FString("/Shaders");
|
||||
AddShaderSourceDirectoryMapping("/DarkerNodes", ShaderDirectory);
|
||||
|
||||
Colorizer.Color();
|
||||
|
||||
auto const CommandBindings = FModuleManager::LoadModuleChecked< IMainFrameModule >("MainFrame").GetMainFrameCommandBindings();
|
||||
DarkerNodesCommands::Register();
|
||||
|
||||
CommandBindings->MapAction(
|
||||
DarkerNodesCommands::Get().RestartEditorCommand,
|
||||
FExecuteAction::CreateRaw(this, &FDarkerNodesModule::RestartEditor)
|
||||
);
|
||||
}
|
||||
|
||||
void FDarkerNodesModule::RestartEditor()
|
||||
{
|
||||
FUnrealEdMisc::Get().RestartEditor(false);
|
||||
}
|
||||
|
||||
void FDarkerNodesModule::ShutdownModule()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
|
||||
IMPLEMENT_MODULE(FDarkerNodesModule, DarkerNodes)
|
||||
@@ -0,0 +1,32 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Framework/Commands/Commands.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "DarkerNodesCommands"
|
||||
|
||||
class DarkerNodesCommands : public TCommands<DarkerNodesCommands>
|
||||
{
|
||||
public:
|
||||
DarkerNodesCommands()
|
||||
: TCommands<DarkerNodesCommands>(
|
||||
TEXT("DarkerNodes"),
|
||||
FText::FromString("Darker Nodes"),
|
||||
NAME_None,
|
||||
"DarkerNodesStyle")
|
||||
{
|
||||
}
|
||||
|
||||
TSharedPtr<FUICommandInfo> RestartEditorCommand;
|
||||
|
||||
virtual void RegisterCommands() override
|
||||
{
|
||||
UI_COMMAND(RestartEditorCommand, "Restart Editor", "Trigger an editor restart", EUserInterfaceActionType::Button, FInputChord());
|
||||
}
|
||||
};
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
@@ -0,0 +1,162 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#include "BrushDatabase.h"
|
||||
|
||||
|
||||
#include "FileHelpers.h"
|
||||
#include "ImageUtils.h"
|
||||
#include "Interfaces/IPluginManager.h"
|
||||
#include "Materials/MaterialInstanceDynamic.h"
|
||||
#include "Styling/SlateStyle.h"
|
||||
|
||||
UBrushDatabase::UBrushDatabase()
|
||||
{
|
||||
AddToRoot();
|
||||
ThemeDirectory = IPluginManager::Get().FindPlugin(TEXT("DarkerNodes"))->GetBaseDir() + FString("/Resources/Theme");
|
||||
}
|
||||
|
||||
void UBrushDatabase::SetMaterial(FSlateBrush* Brush, FString Name)
|
||||
{
|
||||
if (!Materials.Contains(Name))
|
||||
{
|
||||
const FString MaterialPath = "/DarkerNodes/Materials/" + Name;
|
||||
UMaterial* Material = LoadObject<UMaterial>(nullptr, *MaterialPath);
|
||||
Materials.Add(Name, Material);
|
||||
}
|
||||
|
||||
if (IsValid(Materials[Name]))
|
||||
{
|
||||
Brush->SetResourceObject(Materials[Name]);
|
||||
}
|
||||
}
|
||||
|
||||
void UBrushDatabase::UpdateAndSaveMaterials()
|
||||
{
|
||||
FlushShaderFileCache();
|
||||
|
||||
TArray<UPackage*> PackagesToSave;
|
||||
|
||||
for (auto& Material : Materials)
|
||||
{
|
||||
Material.Value->PreEditChange(nullptr);
|
||||
Material.Value->PostEditChange();
|
||||
|
||||
#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION <= 25
|
||||
PackagesToSave.Add(Material.Value->GetOutermost());
|
||||
#else
|
||||
PackagesToSave.Add(Material.Value->GetPackage());
|
||||
#endif
|
||||
}
|
||||
|
||||
FEditorFileUtils::PromptForCheckoutAndSave(PackagesToSave, false, false);
|
||||
}
|
||||
|
||||
UMaterialInstanceDynamic* UBrushDatabase::GetDynamicMaterial(FString Name, FSlateBrush* Brush)
|
||||
{
|
||||
if (DynamicMaterials.Contains(Name))
|
||||
{
|
||||
return DynamicMaterials[Name];
|
||||
}
|
||||
|
||||
if (Brush == nullptr)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UObject* Resource = Brush->GetResourceObject();
|
||||
UMaterialInterface* Material = Cast<UMaterialInterface>(Resource);
|
||||
|
||||
if (Material)
|
||||
{
|
||||
UMaterialInstanceDynamic* DynamicMaterial = Cast<UMaterialInstanceDynamic>(Material);
|
||||
|
||||
if (!DynamicMaterial)
|
||||
{
|
||||
DynamicMaterial = UMaterialInstanceDynamic::Create(Material, this);
|
||||
DynamicMaterials.Add(Name, DynamicMaterial);
|
||||
Brush->SetResourceObject(DynamicMaterial);
|
||||
}
|
||||
|
||||
return DynamicMaterial;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FSlateBrush* UBrushDatabase::GetCenteredImageBrush(FString Name, FString Path, FVector2D Size, FColor Color)
|
||||
{
|
||||
FSlateBrush* Brush = new FSlateBrush();
|
||||
Brush->SetImageSize(Size);
|
||||
Brush->TintColor = FLinearColor::FromSRGBColor(Color);
|
||||
SetMaterial(Brush, "CenterUVs.CenterUVs");
|
||||
|
||||
const FString ImagePath = ThemeDirectory + Path;
|
||||
UTexture2D* Image = FImageUtils::ImportFileAsTexture2D(FPaths::ConvertRelativePathToFull(ImagePath));
|
||||
|
||||
UMaterialInstanceDynamic* MaterialInstance = GetDynamicMaterial(Name, Brush);
|
||||
MaterialInstance->SetVectorParameterValue("Size", FVector(Size.X, Size.Y, 0));
|
||||
MaterialInstance->SetTextureParameterValue("Image", Image);
|
||||
|
||||
return Brush;
|
||||
}
|
||||
|
||||
void UBrushDatabase::CreateDynamicMaterial(FString Name, FString ParentName)
|
||||
{
|
||||
if (!Materials.Contains(ParentName))
|
||||
{
|
||||
const FString MaterialPath = "/DarkerNodes/Materials/" + ParentName;
|
||||
UMaterial* Material = LoadObject<UMaterial>(nullptr, *MaterialPath);
|
||||
Materials.Add(ParentName, Material);
|
||||
}
|
||||
|
||||
UMaterialInstanceDynamic* DynamicMaterial = UMaterialInstanceDynamic::Create(Materials[ParentName], this);
|
||||
DynamicMaterials.Add(Name, DynamicMaterial);
|
||||
}
|
||||
|
||||
void UBrushDatabase::CreateSlateBrush(FString Name)
|
||||
{
|
||||
SlateBrushes.Add(Name, new FSlateBrush());
|
||||
}
|
||||
|
||||
void UBrushDatabase::CreateSlateBrush(FString Name, FString MaterialName)
|
||||
{
|
||||
CreateDynamicMaterial(Name, MaterialName);
|
||||
CreateSlateBrush(Name);
|
||||
SetSlateBrushMaterial(Name, Name);
|
||||
}
|
||||
|
||||
FSlateBrush* UBrushDatabase::GetSlateBrush(FString Name)
|
||||
{
|
||||
return SlateBrushes[Name];
|
||||
}
|
||||
|
||||
void UBrushDatabase::SetSlateBrushMaterial(FString Name, FString DynamicMaterialName)
|
||||
{
|
||||
SlateBrushes[Name]->SetResourceObject(DynamicMaterials[DynamicMaterialName]);
|
||||
}
|
||||
|
||||
void UBrushDatabase::CreateSlateColor(FString Name)
|
||||
{
|
||||
Colors.Add(Name, MakeShared<FLinearColor>());
|
||||
SlateColors.Add(Name, new FSlateColor(Colors[Name]));
|
||||
}
|
||||
|
||||
void UBrushDatabase::SetSlateColor(FString Name, FLinearColor Color)
|
||||
{
|
||||
Colors[Name].Get().R = Color.R;
|
||||
Colors[Name].Get().G = Color.G;
|
||||
Colors[Name].Get().B = Color.B;
|
||||
Colors[Name].Get().A = Color.A;
|
||||
}
|
||||
|
||||
FSlateColor* UBrushDatabase::GetSlateColor(FString Name)
|
||||
{
|
||||
return SlateColors[Name];
|
||||
}
|
||||
|
||||
TSharedRef<FLinearColor> UBrushDatabase::GetColor(FString Name)
|
||||
{
|
||||
return Colors[Name];
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
#include "SlateMaterialBrush.h"
|
||||
#include "UObject/Object.h"
|
||||
#include "BrushDatabase.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class DARKERNODES_API UBrushDatabase : public UObject
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UBrushDatabase();
|
||||
void SetMaterial(FSlateBrush* Brush, FString Name);
|
||||
|
||||
void UpdateAndSaveMaterials();
|
||||
UMaterialInstanceDynamic* GetDynamicMaterial(FString Name, FSlateBrush* Brush = nullptr);
|
||||
|
||||
FSlateBrush* GetCenteredImageBrush(FString Name, FString Path, FVector2D Size, FColor Color = FColor::White);
|
||||
|
||||
void CreateDynamicMaterial(FString Name, FString ParentName);
|
||||
|
||||
void CreateSlateBrush(FString Name);
|
||||
void CreateSlateBrush(FString Name, FString MaterialName);
|
||||
FSlateBrush* GetSlateBrush(FString Name);
|
||||
void SetSlateBrushMaterial(FString Name, FString DynamicMaterialName);
|
||||
|
||||
void CreateSlateColor(FString Name);
|
||||
void SetSlateColor(FString Name, FLinearColor Color);
|
||||
FSlateColor* GetSlateColor(FString Name);
|
||||
|
||||
TSharedRef<FLinearColor> GetColor(FString Name);
|
||||
|
||||
private:
|
||||
FString ThemeDirectory;
|
||||
|
||||
UPROPERTY()
|
||||
TMap<FString, UMaterial*> Materials;
|
||||
|
||||
UPROPERTY()
|
||||
TMap<FString, UMaterialInstanceDynamic*> DynamicMaterials;
|
||||
|
||||
TMap<FString, FSlateBrush*> SlateBrushes;
|
||||
TMap<FString, FSlateColor*> SlateColors;
|
||||
TMap<FString, const TSharedRef<FLinearColor>> Colors;
|
||||
|
||||
//TArray<const FSlateBrush*> Resources;
|
||||
};
|
||||
123
Plugins/DarkerNodes/Source/DarkerNodes/Private/Lib/ColorLib.h
Normal file
123
Plugins/DarkerNodes/Source/DarkerNodes/Private/Lib/ColorLib.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
class FColorLib
|
||||
{
|
||||
public:
|
||||
static float PivotRGBtoXYZ(float N)
|
||||
{
|
||||
return (N > 0.04045f ? FMath::Pow((N + 0.055f) / 1.055f, 2.4f) : N / 12.92f) * 100.0f;
|
||||
}
|
||||
|
||||
static FVector RGBtoXYZ(FColor Color)
|
||||
{
|
||||
const FMatrix Matrix(
|
||||
FPlane(0.4124564f, 0.2126729f, 0.0193339f, 0),
|
||||
FPlane(0.3575761f, 0.7151522f, 0.1191920f, 0),
|
||||
FPlane(0.1804375f, 0.0721750f, 0.9503041f, 0),
|
||||
FPlane(0, 0, 0, 1));
|
||||
|
||||
FVector OutColor;
|
||||
|
||||
OutColor.X = PivotRGBtoXYZ(Color.R / 255.0f);
|
||||
OutColor.Y = PivotRGBtoXYZ(Color.G / 255.0f);
|
||||
OutColor.Z = PivotRGBtoXYZ(Color.B / 255.0f);
|
||||
|
||||
OutColor = Matrix.TransformVector(OutColor);
|
||||
|
||||
OutColor.X = FMath::Clamp(OutColor.X, 0.0f, 100.0f);
|
||||
OutColor.Y = FMath::Clamp(OutColor.Y, 0.0f, 100.0f);
|
||||
OutColor.Z = FMath::Clamp(OutColor.Z, 0.0f, 100.0f);
|
||||
|
||||
return OutColor;
|
||||
}
|
||||
|
||||
static float PivotXYZtoRGB(float N)
|
||||
{
|
||||
N /= 100.0f;
|
||||
return (N > 0.003131f ? FMath::Pow(N, 1.0f / 2.4f) * 1.055f - 0.055f : N * 12.92f);
|
||||
}
|
||||
|
||||
static FColor XYZtoRGB(FVector Color)
|
||||
{
|
||||
const FMatrix Matrix(
|
||||
FPlane(3.2404542f, -0.9692660f, 0.0556434f, 0),
|
||||
FPlane(-1.5371385f, 1.8760108f, -0.2040259f, 0),
|
||||
FPlane(-0.4985314f, 0.0415560f, 1.0572252f, 0),
|
||||
FPlane(0, 0, 0, 1));
|
||||
|
||||
FVector OutColor(Color.X, Color.Y, Color.Z);
|
||||
OutColor = Matrix.TransformVector(OutColor);
|
||||
|
||||
OutColor.X = FMath::RoundToInt(PivotXYZtoRGB(OutColor.X) * 255.0f);
|
||||
OutColor.Y = FMath::RoundToInt(PivotXYZtoRGB(OutColor.Y) * 255.0f);
|
||||
OutColor.Z = FMath::RoundToInt(PivotXYZtoRGB(OutColor.Z) * 255.0f);
|
||||
|
||||
OutColor.X = FMath::Clamp(OutColor.X, 0.0f, 255.0f);
|
||||
OutColor.Y = FMath::Clamp(OutColor.Y, 0.0f, 255.0f);
|
||||
OutColor.Z = FMath::Clamp(OutColor.Z, 0.0f, 255.0f);
|
||||
|
||||
return FColor(OutColor.X, OutColor.Y, OutColor.Z);
|
||||
}
|
||||
|
||||
static float MathXYZtoLAB(float T)
|
||||
{
|
||||
const float D = 6.0f / 29.0f;
|
||||
if (T > D * D * D)
|
||||
{
|
||||
return FMath::Pow(T, 1.0f / 3.0f);
|
||||
}
|
||||
return T / (3.0f * D * D) + 4.0f / 29.0f;
|
||||
}
|
||||
|
||||
static FVector XYZtoLAB(FVector Color)
|
||||
{
|
||||
const float Xn = 95.0489f;
|
||||
const float Yn = 100.0f;
|
||||
const float Zn = 108.884f;
|
||||
|
||||
FVector OutColor;
|
||||
|
||||
OutColor.X = 116.0f * MathXYZtoLAB(Color.Y / Yn) - 16.0f;
|
||||
OutColor.Y = 500.0f * (MathXYZtoLAB(Color.X / Xn) - MathXYZtoLAB(Color.Y / Yn));
|
||||
OutColor.Z = 200.0f * (MathXYZtoLAB(Color.Y / Yn) - MathXYZtoLAB(Color.Z / Zn));
|
||||
|
||||
OutColor.X = FMath::Clamp(OutColor.X, 0.0f, 100.0f);
|
||||
OutColor.Y = FMath::Clamp(OutColor.Y, -128.0f, 128.0f);
|
||||
OutColor.Z = FMath::Clamp(OutColor.Z, -128.0f, 128.0f);
|
||||
|
||||
return OutColor;
|
||||
}
|
||||
|
||||
static float MathLABtoXYZ(float T)
|
||||
{
|
||||
const float D = 6.0f / 29.0f;
|
||||
if (T > D)
|
||||
{
|
||||
return T * T * T;
|
||||
}
|
||||
return 3.0f * D * D * (T - 4.0f / 29.0f);
|
||||
}
|
||||
|
||||
static FVector LABtoXYZ(FVector Color)
|
||||
{
|
||||
const float Xn = 95.0489f;
|
||||
const float Yn = 100.0f;
|
||||
const float Zn = 108.884f;
|
||||
|
||||
FVector OutColor;
|
||||
|
||||
OutColor.X = Xn * MathLABtoXYZ((Color.X + 16.0f) / 116.0f + Color.Y / 500.0f);
|
||||
OutColor.Y = Yn * MathLABtoXYZ((Color.X + 16.0f) / 116.0f);
|
||||
OutColor.Z = Zn * MathLABtoXYZ((Color.X + 16.0f) / 116.0f - Color.Z / 200.0f);
|
||||
|
||||
OutColor.X = FMath::Clamp(OutColor.X, 0.0f, 100.0f);
|
||||
OutColor.Y = FMath::Clamp(OutColor.Y, 0.0f, 100.0f);
|
||||
OutColor.Z = FMath::Clamp(OutColor.Z, 0.0f, 100.0f);
|
||||
|
||||
return OutColor;
|
||||
}
|
||||
};
|
||||
22
Plugins/DarkerNodes/Source/DarkerNodes/Public/DarkerNodes.h
Normal file
22
Plugins/DarkerNodes/Source/DarkerNodes/Public/DarkerNodes.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Colorizer.h"
|
||||
|
||||
class FDarkerNodesModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
|
||||
/** IModuleInterface implementation */
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
|
||||
void RestartEditor();
|
||||
|
||||
private:
|
||||
FColorizer Colorizer;
|
||||
};
|
||||
@@ -0,0 +1,424 @@
|
||||
/* Copyright (C) 2021 Hugo ATTAL - All Rights Reserved
|
||||
* This plugin is downloadable from the Unreal Engine Marketplace
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Engine/DeveloperSettings.h"
|
||||
#include "DarkerNodesSettings.generated.h"
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EHeaderStyle : uint8
|
||||
{
|
||||
Gradient,
|
||||
Plain,
|
||||
Outline
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EThemeLight : uint8
|
||||
{
|
||||
Dark,
|
||||
Darker,
|
||||
Darkest
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EThemeTemperature : uint8
|
||||
{
|
||||
Cooler,
|
||||
Cool,
|
||||
Normal,
|
||||
Warm,
|
||||
Warmer
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EPrimaryColor : uint8
|
||||
{
|
||||
White,
|
||||
Orange,
|
||||
Cyan,
|
||||
Red,
|
||||
Purple,
|
||||
Green
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EButtonPadding : uint8
|
||||
{
|
||||
None,
|
||||
Small,
|
||||
Normal,
|
||||
Big
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EButtonBorder : uint8
|
||||
{
|
||||
None,
|
||||
Dark,
|
||||
Light
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EFontFamily : uint8
|
||||
{
|
||||
BalsamiqSans UMETA(DisplayName = "BalsamiqSans (Handwritten)"),
|
||||
Cannonade UMETA(DisplayName = "Cannonade (Sans Serif)"),
|
||||
CaskaydiaCove UMETA(DisplayName = "Caskaydia Cove (Monospace)"),
|
||||
EudoxusSans UMETA(DisplayName = "Exodus Sans (Sans Serif)"),
|
||||
GolosUI UMETA(DisplayName = "Golos UI (Sans Serif)"),
|
||||
Jua UMETA(DisplayName = "Jua (Handwritten)"),
|
||||
Junction UMETA(DisplayName = "Junction (Sans Serif)"),
|
||||
NewTelegraph UMETA(DisplayName = "New Telegraph (Slab Serif)"),
|
||||
Roboto UMETA(DisplayName = "Roboto (Sans Serif)"),
|
||||
XXIIAven UMETA(DisplayName = "XXII Aven (Sans Serif)")
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EFontSize : uint8
|
||||
{
|
||||
Small,
|
||||
Normal,
|
||||
Big,
|
||||
Bigger
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EBlueprintVarNodeLine : uint8
|
||||
{
|
||||
Thin,
|
||||
Thick
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EBlueprintVarNodeStyle : uint8
|
||||
{
|
||||
DarkSolid,
|
||||
LightSolid,
|
||||
DarkGlass,
|
||||
LightGlass
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EIconStyle : uint8
|
||||
{
|
||||
Line,
|
||||
Solid
|
||||
};
|
||||
|
||||
|
||||
UCLASS(config = EditorPerProjectUserSettings, meta = (DisplayName = "Darker Nodes Plugin"))
|
||||
class DARKERNODES_API UDarkerNodesSettings : public UDeveloperSettings
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UDarkerNodesSettings()
|
||||
{
|
||||
CategoryName = TEXT("Plugins");
|
||||
SectionName = TEXT("Darker Nodes Plugin");
|
||||
}
|
||||
|
||||
/* -----[ Activation ] ----- */
|
||||
|
||||
/* Activate or deactivate the whole plugin. Default: true */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Activation")
|
||||
bool MasterActivate = true;
|
||||
|
||||
/* Use global settings across all your projects. When activated, it will load the global settings (overwriting this one).
|
||||
If no global settings exists, it will create it based on this one. Future updates will then be saved to global settings. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Activation")
|
||||
bool UseGlobalSettings = false;
|
||||
|
||||
/* Force reload the global settings (if it was modified outside this instance for example). */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Activation", meta = (EditCondition = "UseGlobalSettings"))
|
||||
bool LoadGlobalSettings = false;
|
||||
|
||||
/* Reload the default style (you must disable Master Activate first). */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Activation", meta = (EditCondition = "!MasterActivate"))
|
||||
bool ReloadDefaultStyle = false;
|
||||
|
||||
/* This should fix missing elements by updating and saving the theme materials. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Activation", meta = (DisplayName = "Fix Missing Elements"))
|
||||
bool UpdateMaterials = true;
|
||||
|
||||
/* Internal value to fix elements on plugin update. */
|
||||
UPROPERTY(config)
|
||||
FString PluginVersionUpdate = "";
|
||||
|
||||
/* -----[ Theme ] ----- */
|
||||
|
||||
/* Variations of the grey background (making it lighter or darker). Default: darker */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Theme")
|
||||
EThemeLight ThemeLight = EThemeLight::Darker;
|
||||
|
||||
/* Use light theme and invert luminosity (warning: experimental feature) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Theme", meta = (DisplayName = "Light Theme (experimental)"))
|
||||
bool LightTheme = false;
|
||||
|
||||
/* Variations of the grey background (making it more orange or cyan). Default: normal */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Theme")
|
||||
EThemeTemperature ThemeTemperature = EThemeTemperature::Normal;
|
||||
|
||||
/* Variations of the primary color. Default: orange */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Theme")
|
||||
EPrimaryColor PrimaryColor = EPrimaryColor::Orange;
|
||||
|
||||
/* -----[ Buttons / Text fields ] ----- */
|
||||
|
||||
/* Padding of buttons and text fields. Default: normal */
|
||||
UPROPERTY(config, EditAnywhere, Category = "ButtonsAndTextFields")
|
||||
EButtonPadding ButtonPadding = EButtonPadding::Normal;
|
||||
|
||||
/* Radius of buttons and text fields. Default: 2px */
|
||||
UPROPERTY(config, EditAnywhere, Category = "ButtonsAndTextFields", meta = (ClampMin = "0"))
|
||||
int32 ButtonRadius = 2;
|
||||
|
||||
/* Add a border to buttons and text fields. Default: None */
|
||||
UPROPERTY(config, EditAnywhere, Category = "ButtonsAndTextFields")
|
||||
EButtonBorder ButtonBorder = EButtonBorder::None;
|
||||
|
||||
/* -----[ Fonts ] ----- */
|
||||
|
||||
/* Font to use in the editor (it won't work on all texts). Default: Normal */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Fonts", meta = (DisplayName = "Font Size (experimental)"))
|
||||
EFontSize FontSize = EFontSize::Normal;
|
||||
|
||||
/* Font to use in the editor. Default: Roboto */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Fonts")
|
||||
EFontFamily FontFamily = EFontFamily::Roboto;
|
||||
|
||||
/* Use a custom font for regular texts. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Fonts")
|
||||
bool UseCustomRegularFont = false;
|
||||
|
||||
/* Path to the regular TTF font. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Fonts", meta = (EditCondition = "UseCustomRegularFont", FilePathFilter="ttf"))
|
||||
FFilePath RegularFont;
|
||||
|
||||
/* Use a custom font for bold texts. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Fonts")
|
||||
bool UseCustomBoldFont = false;
|
||||
|
||||
/* Path to the bold TTF font. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Fonts", meta = (EditCondition = "UseCustomBoldFont", FilePathFilter="ttf"))
|
||||
FFilePath BoldFont;
|
||||
|
||||
/* Use a custom font for italic texts. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Fonts")
|
||||
bool UseCustomItalicFont = false;
|
||||
|
||||
/* Path to the italic TTF font. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Fonts", meta = (EditCondition = "UseCustomItalicFont", FilePathFilter="ttf"))
|
||||
FFilePath ItalicFont;
|
||||
|
||||
/* -----[ Blueprint ] ----- */
|
||||
|
||||
/* Activate or deactivate the blueprint theme. Default: true */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint")
|
||||
bool ActivateBlueprintTheme = true;
|
||||
|
||||
/* Radius of regular nodes. Default: 2px */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint", meta = (EditCondition = "ActivateBlueprintTheme", ClampMin = "0"))
|
||||
int32 BlueprintRegularNodeRadius = 2;
|
||||
|
||||
/* Radius of var nodes. Default: 2px */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint", meta = (EditCondition = "ActivateBlueprintTheme", ClampMin = "0"))
|
||||
int32 BlueprintVarNodeRadius = 2;
|
||||
|
||||
/* Style of the VarNode top line. Default: Thin */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint", meta = (EditCondition = "ActivateBlueprintTheme"))
|
||||
EBlueprintVarNodeLine BlueprintVarNodeLine = EBlueprintVarNodeLine::Thin;
|
||||
|
||||
/* Style of the VarNode background. Default: Dark Glass */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint", meta = (EditCondition = "ActivateBlueprintTheme"))
|
||||
EBlueprintVarNodeStyle BlueprintVarNodeStyle = EBlueprintVarNodeStyle::DarkGlass;
|
||||
|
||||
/* Opacity of blueprint nodes header. Default: 0.25 */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint", meta = (ClampMin = "0", ClampMax="1"))
|
||||
float BlueprintNodeHeaderOpacity = 0.25f;
|
||||
|
||||
/* Saturation of blueprint nodes header. Default: 1.0 */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint", meta = (ClampMin = "0", ClampMax="1"))
|
||||
float BlueprintNodeHeaderSaturation = 1.0f;
|
||||
|
||||
/* Add a padding to make nodes match the grid on the top left corner. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint")
|
||||
bool ExtendNodes = false;
|
||||
|
||||
/* Disable the blueprint grid. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint")
|
||||
bool DisableBlueprintGrid = false;
|
||||
|
||||
/* Disable the UMG grid. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint", meta = (EditCondition = "DisableBlueprintGrid"))
|
||||
bool DisableUMGGrid = false;
|
||||
|
||||
/* Opacity of the origin axis of the background grid. Default: 0.5 */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Blueprint", meta = (ClampMin = "0", ClampMax="1"))
|
||||
float OriginAxisOpacity = 0.5f;
|
||||
|
||||
/* -----[ Miscellaneous ] ----- */
|
||||
|
||||
/* Use the dark scrollbar instead of the white one. Default: true */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Miscellaneous")
|
||||
bool UseCustomScrollbar = true;
|
||||
|
||||
/* Use the custom icons of Darker Nodes. Default: true */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Miscellaneous")
|
||||
bool UseCustomIcons = true;
|
||||
|
||||
/* Change the style of the custom icons. Default: Line */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Miscellaneous", meta = (EditCondition = "UseCustomIcons"))
|
||||
EIconStyle IconStyle = EIconStyle::Line;
|
||||
|
||||
/* Make icons colored by group. Default: true */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Miscellaneous", meta = (EditCondition = "UseCustomIcons"))
|
||||
bool UseIconColorization = false;
|
||||
|
||||
/* Use the custom panels of Darker Nodes. Default: true */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Miscellaneous")
|
||||
bool UseCustomPanels = true;
|
||||
|
||||
/* Use the custom buttons, text fields and checkboxes of Darker Nodes. Default: true */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Miscellaneous")
|
||||
bool UseCustomButton = true;
|
||||
|
||||
/* -----[ Customization ] ----- */
|
||||
|
||||
/* When "Use [Type] Customization" is unticked, overwrite the customized colors with the current theme colors. Default: true */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization")
|
||||
bool OverwriteColors = true;
|
||||
|
||||
/* Customize the backgrounds more in-depth. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Background")
|
||||
bool UseGreyCustomization = false;
|
||||
|
||||
/* Dark background of the theme. Default: RGB(20,20,20) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Background", meta = (EditCondition = "UseGreyCustomization"))
|
||||
FColor GreyDark = FColor(20, 20, 20);
|
||||
|
||||
/* Base background of the theme. Default: RGB(40,40,40) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Background", meta = (EditCondition = "UseGreyCustomization"))
|
||||
FColor GreyBase = FColor(40, 40, 40);
|
||||
|
||||
/* Light background of the theme. Default: RGB(80,80,80) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Background", meta = (EditCondition = "UseGreyCustomization"))
|
||||
FColor GreyLight = FColor(80, 80, 80);
|
||||
|
||||
/* Customize the colors more in-depth. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Color")
|
||||
bool UseColorCustomization = false;
|
||||
|
||||
/* Hover color on dark background. Default: RGB(229,110,23) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Color", meta = (EditCondition = "UseColorCustomization"))
|
||||
FColor CustomPrimaryColor = FColor(229, 110, 23);
|
||||
|
||||
/* Text color of the theme. Default: RGB(200,200,200) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Color", meta = (EditCondition = "UseColorCustomization"))
|
||||
FColor TextColor = FColor(200, 200, 200);
|
||||
|
||||
/* Color of the scrollbar. Default: RGB(20,20,20) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Color", meta = (EditCondition = "UseColorCustomization"))
|
||||
FColor ScrollbarColor = FColor(20, 20, 20);
|
||||
|
||||
/* Customize the colors more in-depth. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Windows")
|
||||
bool UseWindowCustomization = false;
|
||||
|
||||
/* Outline color of the main editor window. Default: RGB(40,40,40) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Windows", meta = (EditCondition = "UseWindowCustomization"))
|
||||
FColor MainWindowColor = FColor(40, 40, 40);
|
||||
|
||||
/* Outline color of child editor windows. Default: RGB(40,40,40) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Windows", meta = (EditCondition = "UseWindowCustomization"))
|
||||
FColor ChildWindowColor = FColor(40, 40, 40);
|
||||
|
||||
/* Customize the colors of Blueprint graphs. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Blueprint")
|
||||
bool UseBlueprintColorCustomization = false;
|
||||
|
||||
/* Color for grid lines in Blueprint graphs and UMG editor. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Blueprint", meta = (EditCondition = "UseBlueprintColorCustomization"))
|
||||
FColor GridLineColor;
|
||||
|
||||
/* Color for grid rules in Blueprint graphs and UMG editor. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Blueprint", meta = (EditCondition = "UseBlueprintColorCustomization"))
|
||||
FColor GridRuleColor;
|
||||
|
||||
/* Color for grid center in Blueprint graphs and UMG editor. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Blueprint", meta = (EditCondition = "UseBlueprintColorCustomization"))
|
||||
FColor GridCenterColor;
|
||||
|
||||
/* Background of regular Blueprint nodes. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Blueprint", meta = (EditCondition = "UseBlueprintColorCustomization"))
|
||||
FColor RegularNodeBackground;
|
||||
|
||||
/* Border of regular Blueprint nodes. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Blueprint", meta = (EditCondition = "UseBlueprintColorCustomization"))
|
||||
FColor RegularNodeBorder;
|
||||
|
||||
/* Background of var Blueprint nodes. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Blueprint", meta = (EditCondition = "UseBlueprintColorCustomization"))
|
||||
FColor VarNodeBackground;
|
||||
|
||||
/* Border of var Blueprint nodes. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Blueprint", meta = (EditCondition = "UseBlueprintColorCustomization"))
|
||||
FColor VarNodeBorder;
|
||||
|
||||
/* Customize the colors more in-depth. Default: false */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Buttons")
|
||||
bool UseButtonColorCustomization = false;
|
||||
|
||||
/* Color for buttons border. Default: RGB(20,20,20) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Buttons", meta = (EditCondition = "UseButtonColorCustomization"))
|
||||
FColor ButtonBorderColor = FColor(20, 20, 20);
|
||||
|
||||
/* Color for primary buttons. Default: RGB(0,96,178) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Buttons", meta = (EditCondition = "UseButtonColorCustomization"))
|
||||
FColor ButtonPrimary = FColor(0, 96, 178);
|
||||
|
||||
/* Color for success buttons. Default: RGB(58,161,17) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Buttons", meta = (EditCondition = "UseButtonColorCustomization"))
|
||||
FColor ButtonSuccess = FColor(58, 161, 17);
|
||||
|
||||
/* Color for info buttons. Default: RGB(0,96,178) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Buttons", meta = (EditCondition = "UseButtonColorCustomization"))
|
||||
FColor ButtonInfo = FColor(0, 96, 178);
|
||||
|
||||
/* Color for warning buttons. Default: RGB(223,179,0) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Buttons", meta = (EditCondition = "UseButtonColorCustomization"))
|
||||
FColor ButtonWarning = FColor(223, 179, 0);
|
||||
|
||||
/* Color for danger buttons. Default: RGB(178,0,0) */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Customization|Buttons", meta = (EditCondition = "UseButtonColorCustomization"))
|
||||
FColor ButtonDanger = FColor(178, 0, 0);
|
||||
|
||||
/* Force texture resources reload. */
|
||||
UPROPERTY(config, EditAnywhere, Category = "Debug")
|
||||
bool ReloadTextureResources = false;
|
||||
|
||||
virtual FName GetContainerName() const override
|
||||
{
|
||||
return "Editor";
|
||||
}
|
||||
|
||||
#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION <= 25
|
||||
DECLARE_EVENT_OneParam(UDarkerNodesSettings, FSettingChangedEvent, FName);
|
||||
FSettingChangedEvent& OnSettingChanged( ) { return SettingChangedEvent; }
|
||||
|
||||
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override
|
||||
{
|
||||
Super::PostEditChangeProperty(PropertyChangedEvent);
|
||||
|
||||
const FName Name = (PropertyChangedEvent.Property != nullptr) ? PropertyChangedEvent.Property->GetFName() : NAME_None;
|
||||
SettingChangedEvent.Broadcast(Name);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
FSettingChangedEvent SettingChangedEvent;
|
||||
#endif
|
||||
};
|
||||
Reference in New Issue
Block a user