// Project Lab - NHTV Igad #pragma once #include "Blueprint/UserWidget.h" #include "MenuButton.h" #include #include "LobbySlot.generated.h" UCLASS() class UNREALPROJECT_API ULobbySlot : public UMenuButton { GENERATED_BODY() public: virtual void NativeConstruct() override; virtual void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override; void SetTeamIndex(uint32 idx); // Must be called from blueprint to setup this element UFUNCTION(BlueprintCallable, Category = "Lobby") void Init(UTextBlock* teamName, UVerticalBox* playerList); void UpdatePlayers(TArray players); void SetState(bool open); UFUNCTION(BlueprintCallable, Category = "Lobby") bool OnSlotSelected(); UPROPERTY(EditDefaultsOnly, Category = "Lobby") UFont* font; UPROPERTY(EditDefaultsOnly, Category="Lobby") TSubclassOf lobbyPlayerSlotClass; private: ULobbySlot(const FObjectInitializer& init); void m_UpdateTeamTitle(); UPROPERTY() UTextBlock* m_teamName; UPROPERTY() UVerticalBox* m_playerList; UPROPERTY() TArray m_playerSlots; UPROPERTY() UButton* m_joinButton; uint32 m_teamIndex; UPROPERTY() TArray m_players; bool m_open; };