Stabilize investor visual smoke build
This commit is contained in:
@@ -14,11 +14,9 @@
|
||||
#include "AgrarianSurvivalComponent.h"
|
||||
#include "Camera/CameraActor.h"
|
||||
#include "Components/SkeletalMeshComponent.h"
|
||||
#include "Components/StaticMeshComponent.h"
|
||||
#include "EnhancedInputSubsystems.h"
|
||||
#include "Engine/LocalPlayer.h"
|
||||
#include "Engine/SkeletalMesh.h"
|
||||
#include "Engine/StaticMesh.h"
|
||||
#include "GameFramework/Character.h"
|
||||
#include "GameFramework/CharacterMovementComponent.h"
|
||||
#include "InputCoreTypes.h"
|
||||
@@ -96,57 +94,6 @@ namespace
|
||||
: TEXT("/Game/Agrarian/Characters/Materials/M_AGR_CharacterProxy_Workwear_Male.M_AGR_CharacterProxy_Workwear_Male");
|
||||
}
|
||||
|
||||
UStaticMeshComponent* EnsureMvpPresentationComponent(
|
||||
AAgrarianGameCharacter* Character,
|
||||
const FName ComponentName,
|
||||
UStaticMesh* Mesh,
|
||||
UMaterialInterface* Material,
|
||||
const FVector& RelativeLocation,
|
||||
const FRotator& RelativeRotation,
|
||||
const FVector& RelativeScale)
|
||||
{
|
||||
if (!Character || !Mesh)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UStaticMeshComponent* Component = nullptr;
|
||||
TArray<UStaticMeshComponent*> ExistingComponents;
|
||||
Character->GetComponents<UStaticMeshComponent>(ExistingComponents);
|
||||
for (UStaticMeshComponent* ExistingComponent : ExistingComponents)
|
||||
{
|
||||
if (ExistingComponent && ExistingComponent->GetFName() == ComponentName)
|
||||
{
|
||||
Component = ExistingComponent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Component)
|
||||
{
|
||||
Component = NewObject<UStaticMeshComponent>(Character, ComponentName);
|
||||
if (!Component)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
Component->SetupAttachment(Character->GetRootComponent());
|
||||
Component->RegisterComponent();
|
||||
Character->AddInstanceComponent(Component);
|
||||
}
|
||||
|
||||
Component->SetStaticMesh(Mesh);
|
||||
if (Material)
|
||||
{
|
||||
Component->SetMaterial(0, Material);
|
||||
}
|
||||
Component->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||
Component->SetGenerateOverlapEvents(false);
|
||||
Component->SetRelativeLocation(RelativeLocation);
|
||||
Component->SetRelativeRotation(RelativeRotation);
|
||||
Component->SetRelativeScale3D(RelativeScale);
|
||||
Component->SetHiddenInGame(false);
|
||||
return Component;
|
||||
}
|
||||
}
|
||||
|
||||
void AAgrarianGamePlayerController::BeginPlay()
|
||||
@@ -496,60 +443,7 @@ void AAgrarianGamePlayerController::ApplyMvpCharacterProxyToPawn()
|
||||
}
|
||||
}
|
||||
|
||||
UStaticMesh* ChamferMesh = LoadObject<UStaticMesh>(
|
||||
nullptr,
|
||||
TEXT("/Game/Agrarian/Environment/PlaceholderMeshes/SM_AGR_Placeholder_ChamferCube.SM_AGR_Placeholder_ChamferCube"));
|
||||
UStaticMesh* CubeMesh = LoadObject<UStaticMesh>(
|
||||
nullptr,
|
||||
TEXT("/Game/Agrarian/Environment/PlaceholderMeshes/SM_AGR_Placeholder_Cube.SM_AGR_Placeholder_Cube"));
|
||||
UStaticMesh* CylinderMesh = LoadObject<UStaticMesh>(
|
||||
nullptr,
|
||||
TEXT("/Game/Agrarian/Environment/PlaceholderMeshes/SM_AGR_Placeholder_Cylinder.SM_AGR_Placeholder_Cylinder"));
|
||||
UMaterialInterface* WorkwearMaterial = LoadObject<UMaterialInterface>(nullptr, GetMvpCharacterProxyMaterialPath(SelectedMvpCharacterProxyId));
|
||||
UMaterialInterface* PackMaterial = LoadObject<UMaterialInterface>(
|
||||
nullptr,
|
||||
TEXT("/Game/Agrarian/Materials/M_AGR_GZ_Fiber_Resource.M_AGR_GZ_Fiber_Resource"));
|
||||
UMaterialInterface* BootMaterial = LoadObject<UMaterialInterface>(
|
||||
nullptr,
|
||||
TEXT("/Game/Agrarian/Materials/M_AGR_GZ_Wood_Resource.M_AGR_GZ_Wood_Resource"));
|
||||
|
||||
const bool bFemaleProxy = SelectedMvpCharacterProxyId == TEXT("female");
|
||||
const float TorsoWidth = bFemaleProxy ? 0.33f : 0.38f;
|
||||
const float TorsoDepth = bFemaleProxy ? 0.18f : 0.22f;
|
||||
const float PackWidth = bFemaleProxy ? 0.24f : 0.28f;
|
||||
|
||||
EnsureMvpPresentationComponent(
|
||||
AgrarianCharacter,
|
||||
TEXT("MvpWorkwearTorsoProxy"),
|
||||
ChamferMesh,
|
||||
WorkwearMaterial,
|
||||
FVector(2.0f, 0.0f, 102.0f),
|
||||
FRotator(0.0f, 0.0f, 0.0f),
|
||||
FVector(TorsoWidth, TorsoDepth, 0.62f));
|
||||
EnsureMvpPresentationComponent(
|
||||
AgrarianCharacter,
|
||||
TEXT("MvpWorkwearBackpackProxy"),
|
||||
ChamferMesh,
|
||||
PackMaterial,
|
||||
FVector(-24.0f, 0.0f, 106.0f),
|
||||
FRotator(0.0f, 0.0f, 0.0f),
|
||||
FVector(PackWidth, 0.16f, 0.48f));
|
||||
EnsureMvpPresentationComponent(
|
||||
AgrarianCharacter,
|
||||
TEXT("MvpWorkwearBedrollProxy"),
|
||||
CylinderMesh,
|
||||
PackMaterial,
|
||||
FVector(-30.0f, 0.0f, 134.0f),
|
||||
FRotator(0.0f, 90.0f, 0.0f),
|
||||
FVector(0.12f, 0.12f, 0.58f));
|
||||
EnsureMvpPresentationComponent(
|
||||
AgrarianCharacter,
|
||||
TEXT("MvpWorkwearBootsProxy"),
|
||||
ChamferMesh,
|
||||
BootMaterial,
|
||||
FVector(0.0f, 0.0f, 26.0f),
|
||||
FRotator(0.0f, 0.0f, 0.0f),
|
||||
FVector(0.34f, 0.20f, 0.18f));
|
||||
// Blockout clothing and pack geometry was removed because it read as broken placeholder art in the investor build.
|
||||
}
|
||||
|
||||
void AAgrarianGamePlayerController::AgrarianGrantItem(FName ItemId, int32 Quantity)
|
||||
@@ -817,6 +711,11 @@ void AAgrarianGamePlayerController::AgrarianCompleteFrontend()
|
||||
SetMvpFrontendPresentationActive(false);
|
||||
SetInputMode(FInputModeGameOnly());
|
||||
bShowMouseCursor = false;
|
||||
|
||||
if (const APawn* ControlledPawn = GetPawn())
|
||||
{
|
||||
SetControlRotation(FRotator(-8.0f, ControlledPawn->GetActorRotation().Yaw, 0.0f));
|
||||
}
|
||||
}
|
||||
|
||||
void AAgrarianGamePlayerController::AgrarianShowMvpScreen(FName ScreenName)
|
||||
@@ -865,6 +764,78 @@ void AAgrarianGamePlayerController::AgrarianShowMvpScreen(FName ScreenName)
|
||||
ClientMessage(TEXT("Usage: AgrarianShowMvpScreen main|character|join|loading|saving"));
|
||||
}
|
||||
|
||||
void AAgrarianGamePlayerController::AgrarianInvestorSmokeTest(float CaptureDelaySeconds, float QuitDelaySeconds)
|
||||
{
|
||||
if (!IsLocalPlayerController())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const float ClampedCaptureDelaySeconds = FMath::Max(2.0f, CaptureDelaySeconds);
|
||||
const float ClampedQuitDelaySeconds = FMath::Max(ClampedCaptureDelaySeconds + 4.0f, QuitDelaySeconds);
|
||||
|
||||
FTimerDelegate EnterWorldDelegate;
|
||||
EnterWorldDelegate.BindWeakLambda(this, [this]()
|
||||
{
|
||||
if (!MvpFrontendWidget)
|
||||
{
|
||||
ShowMvpFrontend();
|
||||
}
|
||||
|
||||
SelectedMvpCharacterProxyId = TEXT("female");
|
||||
if (MvpFrontendWidget)
|
||||
{
|
||||
MvpFrontendWidget->SetSelectedCharacterArchetype(EAgrarianMvpCharacterArchetype::YoungAdultFemale);
|
||||
}
|
||||
|
||||
AgrarianCompleteFrontend();
|
||||
if (AAgrarianDebugHUD* AgrarianHUD = GetHUD<AAgrarianDebugHUD>())
|
||||
{
|
||||
AgrarianHUD->bShowDebugHUD = false;
|
||||
AgrarianHUD->bShowCriticalStatsHUD = false;
|
||||
AgrarianHUD->bShowInventoryHUD = false;
|
||||
AgrarianHUD->bShowCraftingHUD = false;
|
||||
}
|
||||
|
||||
if (APawn* ControlledPawn = GetPawn())
|
||||
{
|
||||
const FRotator InvestorViewRotation(-4.0f, 42.0f, 0.0f);
|
||||
ControlledPawn->SetActorRotation(FRotator(0.0f, InvestorViewRotation.Yaw, 0.0f));
|
||||
SetControlRotation(InvestorViewRotation);
|
||||
}
|
||||
|
||||
ClientMessage(TEXT("Investor smoke test entered Ground Zero as the female MVP character proxy."));
|
||||
});
|
||||
|
||||
FTimerHandle EnterWorldTimerHandle;
|
||||
GetWorldTimerManager().SetTimer(EnterWorldTimerHandle, EnterWorldDelegate, 0.75f, false);
|
||||
|
||||
FTimerDelegate ScreenshotDelegate;
|
||||
ScreenshotDelegate.BindWeakLambda(this, [this]()
|
||||
{
|
||||
ClientMessage(TEXT("Investor smoke test capturing gameplay screenshot."));
|
||||
ConsoleCommand(TEXT("HighResShot 1"));
|
||||
});
|
||||
|
||||
FTimerHandle ScreenshotTimerHandle;
|
||||
GetWorldTimerManager().SetTimer(ScreenshotTimerHandle, ScreenshotDelegate, ClampedCaptureDelaySeconds, false);
|
||||
|
||||
FTimerDelegate QuitDelegate;
|
||||
QuitDelegate.BindWeakLambda(this, [this]()
|
||||
{
|
||||
ClientMessage(TEXT("Investor smoke test completed; quitting packaged client."));
|
||||
ConsoleCommand(TEXT("quit"));
|
||||
});
|
||||
|
||||
FTimerHandle QuitTimerHandle;
|
||||
GetWorldTimerManager().SetTimer(QuitTimerHandle, QuitDelegate, ClampedQuitDelaySeconds, false);
|
||||
|
||||
ClientMessage(FString::Printf(
|
||||
TEXT("Investor smoke test scheduled: screenshot in %.1fs, quit in %.1fs."),
|
||||
ClampedCaptureDelaySeconds,
|
||||
ClampedQuitDelaySeconds));
|
||||
}
|
||||
|
||||
void AAgrarianGamePlayerController::AgrarianTravel(float X, float Y, float Z)
|
||||
{
|
||||
ServerAgrarianTravel(FVector(X, Y, Z));
|
||||
|
||||
Reference in New Issue
Block a user