LastExecutedLaunchModeType
LastExecutedLaunchModeType
#Overview
name: LastExecutedLaunchModeType
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of LastExecutedLaunchModeType is to store and track the most recently used launch mode for play sessions in the Unreal Engine editor. This setting is part of the editor’s play-in-editor functionality and helps maintain consistency between play sessions.
This setting variable is primarily used by the Unreal Engine’s editor subsystem, specifically within the LevelEditor and TurnkeySupport modules. It’s also referenced in the CookOnTheFlyServer, which suggests it has implications for cooking content for different platforms.
The value of this variable is set in multiple places:
- In the TurnkeyEditorSupport module when preparing to launch a running map on a device.
- In the DebuggerCommands module, likely when initiating a play session.
LastExecutedLaunchModeType interacts with other variables such as LastExecutedLaunchDevice and LastExecutedLaunchName, which together provide a complete picture of the last play session configuration.
Developers should be aware that this variable affects the behavior of subsequent play sessions. It’s used to determine the default launch mode when starting a new play session, so changing it can affect the workflow of content creators and level designers.
Best practices when using this variable include:
- Ensure it’s properly updated whenever the launch mode is changed to maintain consistency.
- Consider this variable when implementing features that depend on the current or last used launch mode.
- Be cautious when manually modifying this value, as it could lead to unexpected behavior in the editor.
- Use the provided setter function (SetLastExecutedLaunchMode) when updating this value to ensure proper saving and notification of changes.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:237, section: [/Script/UnrealEd.LevelEditorPlaySettings]
- INI Section:
/Script/UnrealEd.LevelEditorPlaySettings
- Raw value:
LaunchMode_OnDevice
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/TurnkeySupport/Private/TurnkeyEditorSupport.cpp:80
Scope (from outer to inner):
file
function void FTurnkeyEditorSupport::PrepareToLaunchRunningMap
Source code excerpt:
ULevelEditorPlaySettings* PlaySettings = GetMutableDefault<ULevelEditorPlaySettings>();
PlaySettings->LastExecutedLaunchModeType = LaunchMode_OnDevice;
PlaySettings->LastExecutedLaunchDevice = DeviceId;
PlaySettings->LastExecutedLaunchName = DeviceName;
PlaySettings->PostEditChange();
PlaySettings->SaveConfig();
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorPlaySettings.h:545
Scope (from outer to inner):
file
class class ULevelEditorPlaySettings : public UObject
Source code excerpt:
/** The last type of play-on session the user ran. */
UPROPERTY(config)
TEnumAsByte<ELaunchModeType> LastExecutedLaunchModeType;
/** The last type of play location the user ran. */
UPROPERTY(config)
TEnumAsByte<EPlayModeLocations> LastExecutedPlayModeLocation;
/** The last type of play session the user ran. */
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/CookOnTheFlyServer.cpp:537
Scope (from outer to inner):
file
function void UCookOnTheFlyServer::Tick
Source code excerpt:
TArray<const ITargetPlatform*> CacheTargetPlatforms;
const ULevelEditorPlaySettings* PlaySettings = GetDefault<ULevelEditorPlaySettings>();
if (PlaySettings && (PlaySettings->LastExecutedLaunchModeType == LaunchMode_OnDevice))
{
FString DeviceName = PlaySettings->LastExecutedLaunchDevice.Left(PlaySettings->LastExecutedLaunchDevice.Find(TEXT("@")));
CacheTargetPlatforms.Add(GetTargetPlatformManager()->FindTargetPlatform(DeviceName));
}
if (CacheTargetPlatforms.Num() > 0)
{
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Kismet2/DebuggerCommands.cpp:1362
Scope (from outer to inner):
file
function void SetLastExecutedLaunchMode
Source code excerpt:
{
ULevelEditorPlaySettings* PlaySettings = GetMutableDefault<ULevelEditorPlaySettings>();
PlaySettings->LastExecutedLaunchModeType = LaunchMode;
PlaySettings->PostEditChange();
PlaySettings->SaveConfig();
}