103 lines
3.0 KiB
C++
103 lines
3.0 KiB
C++
// Copyright Pacificao. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Blueprint/UserWidget.h"
|
|
#include "AgrarianDemoNoticeWidget.generated.h"
|
|
|
|
UENUM(BlueprintType)
|
|
enum class EAgrarianStartupPresentationSegment : uint8
|
|
{
|
|
Splash,
|
|
Story,
|
|
Credits,
|
|
DemoNotice
|
|
};
|
|
|
|
UCLASS()
|
|
class AGRARIANGAME_API UAgrarianDemoNoticeWidget : public UUserWidget
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
virtual void NativeConstruct() override;
|
|
virtual FReply NativeOnKeyDown(const FGeometry& InGeometry, const FKeyEvent& InKeyEvent) override;
|
|
virtual FReply NativeOnMouseButtonDown(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent) override;
|
|
|
|
void SetPresentationSegment(EAgrarianStartupPresentationSegment NewSegment);
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Demo")
|
|
FText Motto = FText::FromString(TEXT("What survives after you are gone?"));
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Demo")
|
|
FText VersionLabel = FText::FromString(TEXT("Investor Demo v0.1.N - Build 2026.05.18"));
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Demo")
|
|
FText DemoNotice = FText::FromString(TEXT("Systems-first investor prototype - visual MVP gate pending"));
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Demo")
|
|
FText CopyrightNotice = FText::FromString(TEXT("Copyright (c) 2026 Agrarian Studio. All rights reserved."));
|
|
|
|
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:
|
|
EAgrarianStartupPresentationSegment PresentationSegment = EAgrarianStartupPresentationSegment::DemoNotice;
|
|
float SegmentStartTimeSeconds = 0.0f;
|
|
|
|
float GetSegmentElapsedSeconds() const;
|
|
void RequestSkipSegment() const;
|
|
|
|
void DrawSplash(
|
|
FSlateWindowElementList& OutDrawElements,
|
|
int32& LayerId,
|
|
const FGeometry& AllottedGeometry) const;
|
|
|
|
void DrawStory(
|
|
FSlateWindowElementList& OutDrawElements,
|
|
int32& LayerId,
|
|
const FGeometry& AllottedGeometry) const;
|
|
|
|
void DrawCenteredText(
|
|
FSlateWindowElementList& OutDrawElements,
|
|
int32& LayerId,
|
|
const FGeometry& AllottedGeometry,
|
|
const FText& Text,
|
|
float Y,
|
|
const FSlateFontInfo& Font,
|
|
const FLinearColor& Color) 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;
|
|
|
|
void DrawCinematicCredits(
|
|
FSlateWindowElementList& OutDrawElements,
|
|
int32& LayerId,
|
|
const FGeometry& AllottedGeometry) const;
|
|
|
|
void DrawCreditIllustration(
|
|
FSlateWindowElementList& OutDrawElements,
|
|
int32& LayerId,
|
|
const FGeometry& AllottedGeometry,
|
|
const FVector2D& Position,
|
|
const FVector2D& Size,
|
|
int32 IllustrationIndex,
|
|
const FLinearColor& AccentColor,
|
|
float Alpha) const;
|
|
};
|