LuckyRobotsUnreal/Source/Luckyrobots/Public/LuckyRobotsGameInstance.h
martinluckyrobots 3eb18f4d20 Optimize some WB_GameWidget codes and Gameinstance codes
2025-04-04 10:21:44 +08:00

129 lines
3.2 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "SharedDef.h"
#include "LuckyRobotsGameInstance.generated.h"
class USIOJsonValue;
class UGameUserWidget;
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ULuckyRobotsGameInstance : public UGameInstance
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
UDataTable* RobotDataDataTable;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
UDataTable* LevelDataTable;
//public:
// bool bIsFirstOpenGame;
//
// bool bIsDebug;
// bool bIsWidgetTestMode;
// bool bIsShowPath;
//
//public:
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
// bool bIsCapture;
//
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
// bool bIsCaptureHand;
//
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
// bool bIsCaptureHead;
//
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
// bool bScenarioCapture;
//
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
// bool bIsMouseOpen;
//
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
// bool bIschange;
//
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
// int PerSecond;
//
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
// FTransform TargetPosition;
//
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
// FCaptureSettingsData CaptureSettingsData;
//
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
ERobotsName CurrentSelectRobot = ERobotsName::None;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
ELevelEnum CurrentSelectLevel = ELevelEnum::None;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
EQualityEnum CurrentSelectQuality = EQualityEnum::Epic;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<FGoalsTaskData> TaskList;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FGoalsTaskData TempTask;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UGameUserWidget* GameUserWidget;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<FLuckyCode> LuckyCodeList;
public:
UFUNCTION(BlueprintCallable)
void DoSendMessage(FString SendValue);
UFUNCTION(BlueprintCallable)
void DoLogItemAdd(FString Topic, FString MsgText, ELogItemType LogItemType);
UFUNCTION(BlueprintCallable)
void SwitchGamePaused();
public:
UFUNCTION(BlueprintCallable)
void ClearTaskList();
UFUNCTION(BlueprintCallable)
void AddTask(FGoalsTaskData TaskData);
UFUNCTION(BlueprintCallable)
void RemoveTask(FGoalsTaskData TaskData);
UFUNCTION(BlueprintCallable)
void RemoveTaskByGoalType(EGoalType GoalType);
UFUNCTION(BlueprintPure)
int GetTaskNum();
UFUNCTION(BlueprintCallable)
void SetTask(int Index, FGoalsTaskData TaskData);
UFUNCTION(BlueprintCallable)
bool GetTask(int Index, FGoalsTaskData& TaskData);
UFUNCTION(BlueprintCallable)
void ReSetTaskList();
UFUNCTION(BlueprintPure)
TArray<FGoalsTaskData> GetTaskList();
UFUNCTION(BlueprintCallable)
void DoSetTempTaskValueChange(bool IsClear);
public:
UFUNCTION(BlueprintImplementableEvent)
void DoGetDispatch(const FString& EventName, USIOJsonValue* EventData);
};