|
|
|
|
| #pragma once
|
|
|
| #include "GameSetting.h"
|
|
|
| #include "GameSettingAction.generated.h"
|
|
|
| #define UE_API GAMESETTINGS_API
|
|
|
|
|
|
|
|
|
|
|
| class ULocalPlayer;
|
|
|
| DECLARE_DELEGATE_TwoParams(UGameSettingCustomAction, UGameSetting* , ULocalPlayer* )
|
|
|
| |
| |
|
|
| UCLASS(MinimalAPI)
|
| class UGameSettingAction : public UGameSetting
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| UE_API UGameSettingAction();
|
|
|
| public:
|
|
|
| DECLARE_EVENT_TwoParams(UGameSettingAction, FOnExecuteNamedAction, UGameSetting* , FGameplayTag );
|
| FOnExecuteNamedAction OnExecuteNamedActionEvent;
|
|
|
| public:
|
|
|
| FText GetActionText() const { return ActionText; }
|
| void SetActionText(FText Value) { ActionText = Value; }
|
| #if !UE_BUILD_SHIPPING
|
| void SetActionText(const FString& Value) { SetActionText(FText::FromString(Value)); }
|
| #endif
|
|
|
| FGameplayTag GetNamedAction() const { return NamedAction; }
|
| void SetNamedAction(FGameplayTag Value) { NamedAction = Value; }
|
|
|
| bool HasCustomAction() const { return CustomAction.IsBound(); }
|
| void SetCustomAction(UGameSettingCustomAction InAction) { CustomAction = InAction; }
|
| UE_API void SetCustomAction(TFunction<void(ULocalPlayer*)> InAction);
|
|
|
| |
| |
| |
| |
|
|
| void SetDoesActionDirtySettings(bool Value) { bDirtyAction = Value; }
|
|
|
| UE_API virtual void ExecuteAction();
|
|
|
| protected:
|
|
|
| UE_API virtual void OnInitialized() override;
|
|
|
| protected:
|
| FText ActionText;
|
| FGameplayTag NamedAction;
|
| UGameSettingCustomAction CustomAction;
|
| bool bDirtyAction = false;
|
| };
|
|
|
| #undef UE_API
|
|
|