-
Notifications
You must be signed in to change notification settings - Fork 0
/
MCUEGameMode.h
60 lines (42 loc) · 1.64 KB
/
MCUEGameMode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "MCUEGameMode.generated.h"
UENUM()
enum class EHUDState : uint8
{
HS_Ingame,
HS_Inventory,
HS_Craft_Menu
};
UCLASS(minimalapi)
class AMCUEGameMode : public AGameModeBase
{
GENERATED_BODY()
virtual void BeginPlay() override;
//checks the hud state and then calls applyhud to apply whatever hud we're using
void ApplyHUDChanges();
// hud state getter
EHUDState GetHUDState();
UFUNCTION(BlueprintCallable, Category = "HUD Functions")
void ChangeHUDState(EHUDState NewState);
// applies the hud to the screen. true if successful, false otherwise
bool ApplyHUD(TSubclassOf<class UUserWidget> WidgetToApply, bool ShowMouseCursor, bool EnableClickEvents);
public:
AMCUEGameMode();
protected:
// the current hudstate
EHUDState HUDState;
// the hud to be shown in game
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Blueptint Widgets", Meta = (BlueprintProtected = "true"))
TSubclassOf<class UUserWidget> IngameHUDClass;
// the hud to be shown in the inventory
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Blueptint Widgets", Meta = (BlueprintProtected = "true"))
TSubclassOf<class UUserWidget> InventoryHUDClass;
// the hud to be shown in the crafting menu
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Blueptint Widgets", Meta = (BlueprintProtected = "true"))
TSubclassOf<class UUserWidget> CraftMenuHUDClass;
// the current hud being display on the screen
class UUserWidget* CurrentWidget;
};