Players can host or join via Steam or LAN, pick maps, and connect by address; dedicated servers expose an HTTP panel for port and game rules. Co-authored-by: Cursor <cursoragent@cursor.com>
106 lines
1.9 KiB
C++
106 lines
1.9 KiB
C++
// Copyright VocationLife Project. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Blueprint/UserWidget.h"
|
|
#include "VocationSessionSubsystem.h"
|
|
#include "VocationMainMenuWidget.generated.h"
|
|
|
|
class UEditableTextBox;
|
|
class UComboBoxString;
|
|
class UButton;
|
|
class UTextBlock;
|
|
class UVerticalBox;
|
|
class UHorizontalBox;
|
|
|
|
/**
|
|
* In-game multiplayer menu: map select, Steam/LAN host, IP:Port join.
|
|
*/
|
|
UCLASS()
|
|
class VOCATIONLIFE_API UVocationMainMenuWidget : public UUserWidget
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
virtual void NativeConstruct() override;
|
|
virtual void NativeDestruct() override;
|
|
|
|
protected:
|
|
void BuildUI();
|
|
void RefreshMaps();
|
|
void SetStatus(const FString& Message);
|
|
|
|
UFUNCTION()
|
|
void OnHostClicked();
|
|
|
|
UFUNCTION()
|
|
void OnFindSteamClicked();
|
|
|
|
UFUNCTION()
|
|
void OnFindLanClicked();
|
|
|
|
UFUNCTION()
|
|
void OnJoinSelectedClicked();
|
|
|
|
UFUNCTION()
|
|
void OnConnectIpClicked();
|
|
|
|
UFUNCTION()
|
|
void OnSoloClicked();
|
|
|
|
UFUNCTION()
|
|
void OnSessionSearchDetailed(const TArray<FVocationSessionSearchEntry>& Sessions);
|
|
|
|
UFUNCTION()
|
|
void OnSessionJoined(bool bSuccess);
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UComboBoxString> MapCombo;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UComboBoxString> BackendCombo;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UComboBoxString> SessionCombo;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UEditableTextBox> ServerNameBox;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UEditableTextBox> PortBox;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UEditableTextBox> IpBox;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UEditableTextBox> JoinPortBox;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UEditableTextBox> MaxPlayersBox;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UTextBlock> StatusText;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UButton> HostButton;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UButton> FindSteamButton;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UButton> FindLanButton;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UButton> JoinButton;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UButton> ConnectIpButton;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UButton> SoloButton;
|
|
|
|
TArray<FVocationMapOption> CachedMaps;
|
|
TArray<FVocationSessionSearchEntry> CachedSessions;
|
|
};
|