// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "Widget/MsgBox/CsdkMsgBoxBase.h"
#include "CsdkUiSubsystem.generated.h"

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMaskToggled, bool, bIsShow);

UCLASS()
class CSDKUI_API UCsdkUiSubsystem : public UGameInstanceSubsystem
{
	GENERATED_BODY()
public:
	UFUNCTION(BlueprintCallable,Category="CSDK|UI|MsgBox")
	void OpenMsgBoxWithOk(const FString& Content, const FString& OkStr,const FOnMsgBoxBtnClicked& OkCallback);
	UFUNCTION(BlueprintCallable,Category="CSDK|UI|MsgBox")
	void OpenMsgBoxWithOkAndCancel(const FString& Content, const FString& OkStr, const FOnMsgBoxBtnClicked& OkCallback, const FString& CancelStr, const FOnMsgBoxBtnClicked& CancelCallback);
	UFUNCTION(BlueprintCallable,Category="CSDK|UI|Throbber")
	void ShowThrobber();
	UFUNCTION(BlueprintCallable,Category="CSDK|UI|Throbber")
	void HideThrobber();

	UFUNCTION(BlueprintCallable,Category="CSDK|UI|Mask")
	void ToggleMask(bool bIsShow);
	UPROPERTY(BlueprintAssignable,Category="CSDK|UI|Mask")
	FOnMaskToggled OnMaskToggled;
private:
	UCsdkMsgBoxBase* GetMsgBox();
protected:
	UPROPERTY()
	UCsdkMsgBoxBase* PopMsgBox = nullptr;
	UPROPERTY()
	UUserWidget* Throbber = nullptr;
};


