statetree.displayitemids

statetree.displayitemids

#Overview

name: statetree.displayitemids

This variable is created as a Console Variable (cvar).

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:

  1. This variable affects the visibility of item IDs in various parts of the StateTree editor interface.
  2. It’s primarily intended for debugging and development purposes, not for end-user gameplay.
  3. 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:

  1. Use it during development and debugging phases to easily identify and track specific items in complex StateTree structures.
  2. 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.
  3. Be aware that enabling this option might slightly increase the visual complexity of the StateTree editor interface.

Regarding the associated variable GbDisplayItemIds:

#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: