PlacementMode.ItemInternalsInTooltip

PlacementMode.ItemInternalsInTooltip

#Overview

name: PlacementMode.ItemInternalsInTooltip

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of PlacementMode.ItemInternalsInTooltip is to control the display of internal information for placeable items in their tooltips within the Unreal Engine 5 editor’s Placement Mode.

This setting variable is primarily used in the PlacementMode module, which is part of the Unreal Engine 5 editor’s functionality for placing assets in the game world.

The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through the console or configuration files. It’s initialized as false by default.

The associated variable bItemInternalsInTooltip directly interacts with PlacementMode.ItemInternalsInTooltip. They share the same value, with bItemInternalsInTooltip being the actual boolean variable used in the code to control the behavior.

Developers must be aware that enabling this variable will expose internal information about placeable items in their tooltips. This includes the native name, asset path, and factory class of the item. While this can be useful for debugging or advanced users, it may not be suitable for all development scenarios or builds.

Best practices when using this variable include:

  1. Use it primarily for debugging or development purposes.
  2. Ensure it’s disabled in release builds to avoid exposing unnecessary information to end-users.
  3. Be cautious about performance implications when enabled, as it may increase the amount of information processed and displayed in tooltips.

Regarding the associated variable bItemInternalsInTooltip:

The purpose of bItemInternalsInTooltip is to serve as the actual boolean flag used in the code to determine whether to show internal information in placeable item tooltips.

It’s used within the PlacementMode module, specifically in the SPlacementModeTools class, which is part of the editor’s UI for placing assets.

The value of bItemInternalsInTooltip is set through the PlacementMode.ItemInternalsInTooltip console variable, allowing for runtime modification.

This variable directly controls the content of the tooltips for placeable items. When true, it adds additional internal information to the tooltips.

Developers should be aware that this variable directly affects the user interface of the Placement Mode in the editor. Enabling it will make the tooltips more verbose but potentially more informative for technical users.

Best practices for using bItemInternalsInTooltip include:

  1. Use it in conjunction with the PlacementMode.ItemInternalsInTooltip console variable for consistency.
  2. Consider exposing this option in the editor settings for easy toggling by developers.
  3. Document its usage and effects for other team members working on the editor UI or asset placement systems.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Editor/PlacementMode/Private/SPlacementModeTools.cpp:30

Scope (from outer to inner):

file
namespace    PlacementModeTools

Source code excerpt:

{
	bool bItemInternalsInTooltip = false;
	FAutoConsoleVariableRef CVarItemInternalsInTooltip(TEXT("PlacementMode.ItemInternalsInTooltip"), bItemInternalsInTooltip, TEXT("Shows placeable item internal information in its tooltip"));
}

struct FSortPlaceableItems
{
	static bool SortItemsByOrderThenName(const TSharedPtr<FPlaceableItem>& A, const TSharedPtr<FPlaceableItem>& B)
	{

#Associated Variable and Callsites

This variable is associated with another variable named bItemInternalsInTooltip. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Editor/PlacementMode/Private/SPlacementModeTools.cpp:29

Scope (from outer to inner):

file
namespace    PlacementModeTools

Source code excerpt:

namespace PlacementModeTools
{
	bool bItemInternalsInTooltip = false;
	FAutoConsoleVariableRef CVarItemInternalsInTooltip(TEXT("PlacementMode.ItemInternalsInTooltip"), bItemInternalsInTooltip, TEXT("Shows placeable item internal information in its tooltip"));
}

struct FSortPlaceableItems
{
	static bool SortItemsByOrderThenName(const TSharedPtr<FPlaceableItem>& A, const TSharedPtr<FPlaceableItem>& B)
	{

#Loc: <Workspace>/Engine/Source/Editor/PlacementMode/Private/SPlacementModeTools.cpp:154

Scope (from outer to inner):

file
function     void SPlacementAssetEntry::Construct

Source code excerpt:


	TSharedPtr<IToolTip> AssetEntryToolTip;
	if (PlacementModeTools::bItemInternalsInTooltip)
	{
		AssetEntryToolTip = FSlateApplicationBase::Get().MakeToolTip(
			FText::Format(LOCTEXT("ItemInternalsTooltip", "Native Name: {0}\nAsset Path: {1}\nFactory Class: {2}"), 
			FText::FromString(Item->NativeName), 
			FText::FromString(Item->AssetData.GetObjectPathString()),
			FText::FromString(Item->Factory ? Item->Factory->GetClass()->GetName() : TEXT("None"))));