12#include "CoreMinimal.h"
15#include "WidgetStudioRuntime.h"
17#include "Subsystems/EngineSubsystem.h"
18#include "Theme/WSIconSet.h"
19#include "Theme/WSTheme.h"
20#include "Theme/WSTypography.h"
21#include "WSSubsystem.generated.h"
23extern int32 DefaultBorderRadius;
24extern float DefaultIdealWidth;
25extern float DefaultIdealHeight;
27DECLARE_DYNAMIC_MULTICAST_DELEGATE(FStyleDelegate);
28DECLARE_DYNAMIC_MULTICAST_DELEGATE(FStartInitDelegate);
29DECLARE_DYNAMIC_MULTICAST_DELEGATE(FEndInitDelegate);
36UCLASS(Blueprintable, BlueprintType, Category =
"Widget Studio")
46 UPROPERTY(EditAnywhere, Category =
"Theme", Meta = (HideViewOptions, DisplayThumbnail =
"false", ToolTip =
"Choose the current Widget Studio theme"))
47 TSoftObjectPtr<UWidgetStudioTheme> Theme;
49 UPROPERTY(EditAnywhere, Category =
"Typography", Meta = (HideViewOptions, ToolTip =
"Choose the font/type look and feel"))
50 TSoftObjectPtr<UWidgetStudioTypography> Typography;
52 UPROPERTY(EditAnywhere, Category =
"Icon Set", Meta = (HideViewOptions, ToolTip =
"Choose the icon style"))
53 TSoftObjectPtr<UWidgetStudioIconSet> IconSet;
55 UPROPERTY(EditAnywhere, Category =
"Style", Meta = (ToolTip =
"The corner roundness found on controls, such as buttons, comboboxs, etc."))
56 int32 BorderRadius = DefaultBorderRadius;
58 UPROPERTY(EditAnywhere, Category =
"Style", Meta = (ToolTip =
"The default x dimension of controls if not overridden via layouts."))
59 float IdealWidth = DefaultIdealWidth;
61 UPROPERTY(EditAnywhere, Category =
"Style", Meta = (ToolTip =
"The default y dimension of controls if not overridden via layouts."))
62 float IdealHeight = DefaultIdealHeight;
64 UPROPERTY(BlueprintAssignable, BlueprintReadWrite, BlueprintCallable, Category =
"Widget Studio|Events")
65 FStyleDelegate OnStyleChanged;
67 UPROPERTY(BlueprintAssignable, BlueprintReadWrite, BlueprintCallable, Category =
"Widget Studio|Inititalization")
68 FStartInitDelegate OnPluginStartedInit;
70 UPROPERTY(BlueprintAssignable, BlueprintReadWrite, BlueprintCallable, Category =
"Widget Studio|Initialization")
71 FEndInitDelegate OnPluginFinishedInit;
79 UFUNCTION(BlueprintPure, Category =
"Widget Studio|Style")
86 UFUNCTION(BlueprintPure, Category =
"Widget Studio|Style")
93 UFUNCTION(BlueprintPure, Category =
"Widget Studio|Style")
100 UFUNCTION(BlueprintPure, Category =
"Widget Studio|Style")
101 static int32 GetBorderRadius();
107 UFUNCTION(BlueprintPure, Category =
"Widget Studio|Style")
108 static FVector2D GetControlDimensions();
119 UFUNCTION(BlueprintCallable, Category =
"Widget Studio|Style")
120 bool SetTheme(TSoftObjectPtr<UWidgetStudioTheme> InTheme);
131 UFUNCTION(BlueprintCallable, Category =
"Widget Studio|Style")
132 bool SetIconSet(TSoftObjectPtr<UWidgetStudioIconSet> InIconStyle);
143 UFUNCTION(BlueprintCallable, Category =
"Widget Studio|Style")
144 bool SetTypography(TSoftObjectPtr<UWidgetStudioTypography> InTypography);
152 UFUNCTION(BlueprintCallable, Category =
"Widget Studio|Style")
153 bool SetBorderRadius(int32 InRadius);
161 UFUNCTION(BlueprintCallable, Category =
"Widget Studio|Style")
162 bool SetControlDimensions(FVector2D InDimensions);
164 UFUNCTION(BlueprintPure, Category =
"Widget Studio|Initialization")
165 bool IsPluginInitialized()
const
167 return bIsPluginInitialized;
172 virtual void Initialize(FSubsystemCollectionBase &Collection)
override;
173 virtual void Deinitialize()
override;
197 void LoadValuesFromIni();
203 void SaveValuesToIni()
const;
210 void HandleAssetRenamed(
const FAssetData& AssetData,
const FString& NewName);
212 void HandleAssetAdded(
const FAssetData& AssetData);
214 bool bIsPluginInitialized =
false;
215 bool bIsDataAssetRenameInProcess =
false;
217 FString ChangedDataAssetName = TEXT(
"");
218 FString ChangedDataAssetType = TEXT(
"");