Add MVP main menu placeholder

This commit is contained in:
2026-05-18 20:48:37 -07:00
parent 63c6adc4ac
commit 4aec203ba6
6 changed files with 273 additions and 1 deletions
@@ -7,6 +7,7 @@
#include "AgrarianGameCharacter.h"
#include "AgrarianInventoryComponent.h"
#include "AgrarianItemPickup.h"
#include "AgrarianMvpFrontendWidget.h"
#include "AgrarianPersistenceSubsystem.h"
#include "AgrarianShelterActor.h"
#include "AgrarianSurvivalComponent.h"
@@ -77,6 +78,21 @@ void AAgrarianGamePlayerController::BeginPlay()
{
Super::BeginPlay();
if (IsLocalPlayerController())
{
if (!MvpFrontendWidgetClass)
{
MvpFrontendWidgetClass = UAgrarianMvpFrontendWidget::StaticClass();
}
MvpFrontendWidget = CreateWidget<UAgrarianMvpFrontendWidget>(this, MvpFrontendWidgetClass);
if (MvpFrontendWidget)
{
MvpFrontendWidget->SetActiveScreen(EAgrarianMvpFrontendScreen::MainMenu);
MvpFrontendWidget->AddToPlayerScreen(10);
}
}
// only spawn touch controls on local player controllers
if (ShouldUseTouchControls() && IsLocalPlayerController())
{