// Console commands of the look (DESIGN_UE.md section 9.3): Descent.Look.Set . #include "Debug/DescentCommandUtil.h" #include "Render/DescentEnvironment.h" #include "TheDescent.h" #include "Engine/World.h" #include "HAL/IConsoleManager.h" namespace { void CmdLookSet(const TArray& Args, UWorld* World) { TArray N; ADescentEnvironment* Env = ADescentEnvironment::Get(World); if (Args.Num() < 2 || !Descent::Cmd::ParseNumbers(Args, 1, 1, N)) { Descent::Cmd::Fail(World, TEXT("Descent.Look.Set"), TEXT("usage: Descent.Look.Set ")); return; } FString Error; if (!Env) { // Exposure and Bloom are cvars and work without a world. if (Args[0].Equals(TEXT("Exposure"), ESearchCase::IgnoreCase) || Args[0].Equals(TEXT("Bloom"), ESearchCase::IgnoreCase)) { IConsoleVariable* V = IConsoleManager::Get().FindConsoleVariable(Args[0].Equals(TEXT("Exposure"), ESearchCase::IgnoreCase) ? TEXT("descent.Look.ExposureEV") : TEXT("descent.Look.Bloom")); if (V) { V->Set(static_cast(N[0]), ECVF_SetByConsole); return; } } Descent::Cmd::Fail(World, TEXT("Descent.Look.Set"), TEXT("there is no environment actor (needs a running game)")); return; } if (!Env->SetLookParam(Args[0], N[0], Error)) { Descent::Cmd::Fail(World, TEXT("Descent.Look.Set"), Error); return; } UE_LOG(LogDescent, Display, TEXT("Look.Set %s = %g"), *Args[0], N[0]); } FAutoConsoleCommandWithWorldAndArgs GLookCmdSet(TEXT("Descent.Look.Set"), TEXT("Descent.Look.Set - look switches for tests"), FConsoleCommandWithWorldAndArgsDelegate::CreateStatic(&CmdLookSet)); }