statetree.displayitemids
statetree.displayitemids
#Overview
name: statetree.displayitemids
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Appends Id to task and state names in the treeview and expose Ids in the details view.
It is referenced in 8
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of statetree.displayitemids
is to control the display of item IDs in the StateTree editor interface within Unreal Engine 5. This setting variable is primarily used for debugging and development purposes in the StateTree system, which is part of the Runtime plugin for Unreal Engine.
This setting variable is used by the StateTree Editor module, which is responsible for providing the user interface and editing capabilities for StateTree assets in the Unreal Engine editor. Based on the callsites, it affects various parts of the StateTree editor, including the tree view, details panel, and custom property displays.
The value of this variable is set through a console variable (CVar) system. It’s initialized as a boolean value false
and can be changed at runtime using the console command statetree.displayitemids
.
The associated variable GbDisplayItemIds
directly interacts with statetree.displayitemids
. They share the same value, with GbDisplayItemIds
being the actual boolean variable used throughout the code to check the setting’s state.
Developers should be aware that:
- This variable affects the visibility of item IDs in various parts of the StateTree editor interface.
- It’s primarily intended for debugging and development purposes, not for end-user gameplay.
- Changing this value will affect the display of state and task names in the tree view and the visibility of ID properties in detail views.
Best practices when using this variable include:
- Use it during development and debugging phases to easily identify and track specific items in complex StateTree structures.
- Remember to disable it (set to false) before final builds or when sharing projects, as it may expose internal IDs that are not meant for end-users.
- Be aware that enabling this option might slightly increase the visual complexity of the StateTree editor interface.
Regarding the associated variable GbDisplayItemIds
:
- Its purpose is to serve as the in-code representation of the
statetree.displayitemids
console variable. - It’s used throughout the StateTree editor code to conditionally display or hide item IDs and related information.
- The value is set by the console variable system and should not be directly modified in code.
- Developers should use this variable for conditional logic in the StateTree editor UI code when item ID display is relevant.
- Best practice is to always refer to this variable when implementing ID-related display logic in the StateTree editor to ensure consistent behavior across the module.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/StateTree/Source/StateTreeEditorModule/Private/StateTreeEditor.cpp:50
Scope (from outer to inner):
file
namespace UE::StateTree::Editor
Source code excerpt:
FAutoConsoleVariableRef CVarDisplayItemIds(
TEXT("statetree.displayitemids"),
GbDisplayItemIds,
TEXT("Appends Id to task and state names in the treeview and expose Ids in the details view."));
}
void FStateTreeEditor::PostUndo(bool bSuccess)
{
#Associated Variable and Callsites
This variable is associated with another variable named GbDisplayItemIds
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/StateTree/Source/StateTreeEditorModule/Private/Customizations/StateTreeEditorNodeDetails.cpp:828
Scope (from outer to inner):
file
function void FStateTreeEditorNodeDetails::CustomizeChildren
Source code excerpt:
// ID
if (UE::StateTree::Editor::GbDisplayItemIds)
{
// ID
StructBuilder.AddProperty(IDProperty.ToSharedRef());
}
// Node
#Loc: <Workspace>/Engine/Plugins/Runtime/StateTree/Source/StateTreeEditorModule/Private/Customizations/StateTreeStateDetails.cpp:50
Scope (from outer to inner):
file
function void FStateTreeStateDetails::CustomizeDetails
Source code excerpt:
EnabledProperty->MarkHiddenByCustomization();
if (UE::StateTree::Editor::GbDisplayItemIds == false)
{
IDProperty->MarkHiddenByCustomization();
}
uint8 StateTypeValue = 0;
TypeProperty->GetValue(StateTypeValue);
#Loc: <Workspace>/Engine/Plugins/Runtime/StateTree/Source/StateTreeEditorModule/Private/Customizations/StateTreeTransitionDetails.cpp:105
Scope (from outer to inner):
file
function void FStateTreeTransitionDetails::CustomizeChildren
Source code excerpt:
};
if (UE::StateTree::Editor::GbDisplayItemIds)
{
StructBuilder.AddProperty(IDProperty.ToSharedRef());
}
// Trigger
StructBuilder.AddProperty(TriggerProperty.ToSharedRef());
#Loc: <Workspace>/Engine/Plugins/Runtime/StateTree/Source/StateTreeEditorModule/Private/SStateTreeViewRow.cpp:192
Scope (from outer to inner):
file
lambda-function
Source code excerpt:
.Visibility_Lambda([]()
{
return UE::StateTree::Editor::GbDisplayItemIds ? EVisibility::Visible : EVisibility::Collapsed;
})
.Text(this, &SStateTreeViewRow::GetStateIDDesc)
.TextStyle(FStateTreeEditorStyle::Get(), "StateTree.Details")
]
]
+ SOverlay::Slot()
#Loc: <Workspace>/Engine/Plugins/Runtime/StateTree/Source/StateTreeEditorModule/Private/SStateTreeViewRow.cpp:606
Scope (from outer to inner):
file
function TSharedRef<SHorizontalBox> SStateTreeViewRow::CreateTasksWidget
Source code excerpt:
FText TaskName;
if (UE::StateTree::Editor::GbDisplayItemIds)
{
TaskName = FText::FromString(FString::Printf(TEXT("%s (%s)"), *Task->Name.ToString(), *LexToString(TaskId)));
}
else
{
TaskName = FText::FromName(Task->Name);
#Loc: <Workspace>/Engine/Plugins/Runtime/StateTree/Source/StateTreeEditorModule/Private/StateTreeEditor.cpp:47
Scope (from outer to inner):
file
namespace UE::StateTree::Editor
Source code excerpt:
namespace UE::StateTree::Editor
{
bool GbDisplayItemIds = false;
FAutoConsoleVariableRef CVarDisplayItemIds(
TEXT("statetree.displayitemids"),
GbDisplayItemIds,
TEXT("Appends Id to task and state names in the treeview and expose Ids in the details view."));
}
void FStateTreeEditor::PostUndo(bool bSuccess)
{
}
#Loc: <Workspace>/Engine/Plugins/Runtime/StateTree/Source/StateTreeEditorModule/Private/StateTreeEditor.h:21
Scope (from outer to inner):
file
namespace UE::StateTree::Editor
Source code excerpt:
uint32 CalcAssetHash(const UStateTree& StateTree);
extern bool GbDisplayItemIds;
} // UE::StateTree::Editor
class FStateTreeEditor : public IStateTreeEditor, public FSelfRegisteringEditorUndoClient, public FGCObject
{
public: