74 lines
2.1 KiB
C++
74 lines
2.1 KiB
C++
// Copyright Pacificao. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Blueprint/UserWidget.h"
|
|
#include "AgrarianMvpFrontendWidget.generated.h"
|
|
|
|
UENUM(BlueprintType)
|
|
enum class EAgrarianMvpFrontendScreen : uint8
|
|
{
|
|
MainMenu,
|
|
CharacterSelection,
|
|
JoinServer,
|
|
Loading
|
|
};
|
|
|
|
UCLASS()
|
|
class AGRARIANGAME_API UAgrarianMvpFrontendWidget : public UUserWidget
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|MVP UI")
|
|
EAgrarianMvpFrontendScreen ActiveScreen = EAgrarianMvpFrontendScreen::MainMenu;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|MVP UI")
|
|
FText MainMenuTitle = FText::FromString(TEXT("Agrarian"));
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|MVP UI")
|
|
FText MainMenuSubtitle = FText::FromString(TEXT("MVP investor build"));
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|MVP UI")
|
|
FText PrimaryActionLabel = FText::FromString(TEXT("Begin"));
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|MVP UI")
|
|
FText JoinServerAddress = FText::FromString(TEXT("play.agrariangame.com:7777"));
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|MVP UI", meta = (ClampMin = "0.75", ClampMax = "1.5"))
|
|
float UiScale = 1.0f;
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "Agrarian|MVP UI")
|
|
void SetActiveScreen(EAgrarianMvpFrontendScreen NewScreen);
|
|
|
|
protected:
|
|
virtual int32 NativePaint(
|
|
const FPaintArgs& Args,
|
|
const FGeometry& AllottedGeometry,
|
|
const FSlateRect& MyCullingRect,
|
|
FSlateWindowElementList& OutDrawElements,
|
|
int32 LayerId,
|
|
const FWidgetStyle& InWidgetStyle,
|
|
bool bParentEnabled) const override;
|
|
|
|
private:
|
|
void DrawMainMenu(
|
|
FSlateWindowElementList& OutDrawElements,
|
|
int32& LayerId,
|
|
const FGeometry& AllottedGeometry,
|
|
const FVector2D& PanelPosition,
|
|
const FVector2D& PanelSize,
|
|
float Scale) const;
|
|
|
|
void DrawTextAt(
|
|
FSlateWindowElementList& OutDrawElements,
|
|
int32& LayerId,
|
|
const FGeometry& AllottedGeometry,
|
|
const FText& Text,
|
|
const FVector2D& Position,
|
|
float Width,
|
|
const FSlateFontInfo& Font,
|
|
const FLinearColor& Color) const;
|
|
};
|