Space Plunder
Loading...
Searching...
No Matches
LobbyMenuSystem.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Blueprint/UserWidget.h"
7#include "Data/BaseData.h"
8#include "LobbyMenuSystem.generated.h"
9
10UCLASS()
11class MENUSYSTEM_API ULobbyMenuSystem : public UUserWidget
12{
13 GENERATED_BODY()
14
15public:
16
17 virtual void NativePreConstruct() override;
18 virtual void NativeConstruct() override;
19
20 UFUNCTION(BlueprintCallable, Category="Menu System|Lobby")
21 void SetPlayers(const TArray<FUserProfile>& Players) const;
22 UFUNCTION(BlueprintCallable, Category="Menu System|Lobby")
23 void AddPlayer(const FUserProfile& Player) const;
24 UFUNCTION(BlueprintCallable, Category="Menu System|Lobby")
25 void StartCountdown(const int32 Delay);
26 UFUNCTION(BlueprintCallable, Category="Menu System|Lobby")
27 void CancelCountdown();//@TODO Add in FUserProfile? to tell who cancelled it
28
29 UFUNCTION(BlueprintCallable, Category="Menu System|Lobby")
30 void LeaveLobby();
31
32 UFUNCTION(BlueprintCallable, Category="Menu System|Lobby")
33 bool GetIsLoading() const{return bIsLoading;};
34 UFUNCTION(BlueprintCallable, Category="Menu System|Lobby")
35 bool GetIsHostLobby() const{return bHostLobby;};
36
37
38protected:
39
40 virtual bool Initialize() override;
41
42 UFUNCTION(BlueprintImplementableEvent, Category="Menu System|Lobby")
43 void LoadingStarted();
44 UFUNCTION(BlueprintImplementableEvent, Category="Menu System|Lobby")
45 void CountdownStarted();
46 UFUNCTION(BlueprintImplementableEvent, Category="Menu System|Lobby")
47 void CountdownCanceled();
48
49 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Menu System")
50 FString StartButtonText = "Start Game";
51 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Menu System")
52 FString StartButtonAltText = "Cancel";
53
54 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="In Game Menu")
55 TArray<bool> ClientButtons = { true, false, false, false, false };
56
57
58 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Menu System", meta = (BindWidget))
59 class USingleMenuSystemWidget* LobbyMenu = nullptr;
60 // UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Menu System", meta = (BindWidget))
61 // class USingleMenuSystemWidget* ClientLobbyMenu = nullptr;
62
63 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Menu System", meta = (BindWidget))
64 class UPlayerCardList* PlayerCardList = nullptr;
65
66 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Menu System", meta = (BindWidget))
67 class UTextBlock* CountDownTextBlock = nullptr;
68
69private:
70 UFUNCTION()
71 void MenuButtonSelected(const int32 Index);
72 UFUNCTION()
73 void ClientMenuButtonSelected(const int32 Index);
74
75
76 void SetCountdownTextBlock() const;
77
78 void Countdown();
79 bool bIsLoading = false;
80 bool bCounting = false;
81
82 bool bHostLobby = false;
83 int32 CountdownTime = 10;
84 int32 CountdownTimeTotal = 15;
85
86 FTimerHandle CountdownTimerHandle;
87};
88
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition LobbyMenuSystem.h:12
Definition PlayerCardList.h:15
Definition SingleMenuSystemWidget.h:15
Definition BaseData.h:1239