GASATHON/Project/Source/Gasa/UI/GasaUserWidget.h

54 lines
1.5 KiB
C
Raw Permalink Normal View History

#pragma once
#include "Blueprint/UserWidget.h"
2024-04-21 15:56:57 -07:00
#include "GasaCommon.h"
#include "GasaUserWidget.generated.h"
2024-04-21 15:56:57 -07:00
UCLASS(Blueprintable)
class GASA_API UGasaUserWidget : public UUserWidget
{
GENERATED_BODY()
public:
UFUNCTION()
void OnLooseParentCompiled(UBlueprint* BP);
UFUNCTION(CallInEditor, Category="Parent (Expriemental)", meta=(
ToolTip="Exprimental: This will overrite the current LooseParent widgets or create them in this user widget. Beware it will be destructive changes"))
void GenerateParentHierarchyFromLooseParent();
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Parent (Expriemental)")
bool bUpdateOnParentCompile = false;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Parent (Expriemental)")
TSubclassOf<UGasaUserWidget> LooseParent;
UPROPERTY(BlueprintReadOnly)
2024-04-21 15:56:57 -07:00
TObjectPtr<UWidgetController> WidgetController;
UGasaUserWidget(FObjectInitializer const& ObjectInitializer);
2024-04-21 15:56:57 -07:00
template<typename WidgetControllerType>
FORCEINLINE WidgetControllerType* GetWidgetController() { return Cast<WidgetControllerType>(WidgetController); }
UFUNCTION(BlueprintCallable)
2024-04-21 15:56:57 -07:00
void SetWidgetController(UWidgetController* Controller)
{
WidgetController = Controller;
OnWidgetControllerSet();
}
UFUNCTION(BlueprintImplementableEvent)
void OnWidgetControllerSet();
#pragma region UserWidget
bool Initialize() override;
void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
void NativeOnInitialized() override;
void NativePreConstruct() override;
#pragma endregion UserWidget
};