AutoCompleteCommandColor

AutoCompleteCommandColor

#Overview

name: AutoCompleteCommandColor

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 10 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of AutoCompleteCommandColor is to define the color used for displaying executable commands in the Unreal Engine console’s autocomplete feature. This setting variable is part of the console user interface system and helps to visually distinguish different types of commands in the autocomplete list.

AutoCompleteCommandColor is primarily used by the Engine’s console subsystem, as well as various plugins and modules that integrate with the console’s autocomplete functionality. Based on the callsites, we can see it’s used in:

  1. The Engine’s core console implementation
  2. The Pixel Streaming plugin
  3. The Common UI plugin
  4. The Significance Manager plugin

The value of this variable is typically set in the ConsoleSettings object, which is a configuration class for console-related settings. It can be modified through project settings or programmatically.

This variable interacts with other console-related variables, such as AutoCompleteCVarColor, which is used for mutable console variables. Together, these color settings help create a visually organized autocomplete list in the console.

Developers should be aware that this variable affects the visual appearance of the console’s autocomplete feature. Changing this color can impact the readability and user experience of the console interface.

Best practices when using this variable include:

  1. Choose a color that contrasts well with the console background and other autocomplete colors for better readability.
  2. Maintain consistency with the engine’s default color scheme unless there’s a specific need to change it.
  3. Consider accessibility guidelines when selecting colors to ensure the console remains usable for all users.
  4. If modifying this value, test the changes in various lighting conditions and on different display types to ensure visibility.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseInput.ini:253, section: [/Script/EngineSettings.ConsoleSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Media/PixelStreaming/Source/PixelStreaming/Private/Stats.cpp:209

Scope (from outer to inner):

file
namespace    UE::PixelStreaming
function     void FStats::UpdateConsoleAutoComplete

Source code excerpt:

		AutoCompleteCommand.Command = TEXT("Stat PixelStreaming");
		AutoCompleteCommand.Desc = TEXT("Displays stats about Pixel Streaming on screen.");
		AutoCompleteCommand.Color = ConsoleSettings->AutoCompleteCommandColor;

		AutoCompleteList.AddDefaulted();
		FAutoCompleteCommand& AutoCompleteGraphCommand = AutoCompleteList.Last();
		AutoCompleteGraphCommand.Command = TEXT("Stat PixelStreamingGraphs");
		AutoCompleteGraphCommand.Desc = TEXT("Displays graphs about Pixel Streaming on screen.");
		AutoCompleteGraphCommand.Color = ConsoleSettings->AutoCompleteCommandColor;
	}

	int32 FStats::OnRenderStats(UWorld* World, FViewport* Viewport, FCanvas* Canvas, int32 X, int32 Y, const FVector* ViewLocation, const FRotator* ViewRotation)
	{
		if (GAreScreenMessagesEnabled)
		{

#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonUI/Private/Input/CommonUIActionRouterBase.cpp:1123

Scope (from outer to inner):

file
function     void UCommonUIActionRouterBase::PopulateAutoCompleteEntries

Source code excerpt:

	AutoCompleteCommand.Command = TEXT("showdebug ActionRouter");
	AutoCompleteCommand.Desc = TEXT("Toggles display of Action Router");
	AutoCompleteCommand.Color = ConsoleSettings->AutoCompleteCommandColor;
}

bool UCommonUIActionRouterBase::CanProcessNormalGameInput() const
{
	if (GetActiveInputMode() == ECommonInputMode::Menu)
	{

#Loc: <Workspace>/Engine/Plugins/Runtime/SignificanceManager/Source/SignificanceManager/Private/SignificanceManager.cpp:166

Scope (from outer to inner):

file
function     void FSignificanceManagerModule::PopulateAutoCompleteEntries

Source code excerpt:

	AutoCompleteCommand.Command = TEXT("showdebug SIGNIFICANCEMANAGER");
	AutoCompleteCommand.Desc = TEXT("Toggles display of significance manager calculations");
	AutoCompleteCommand.Color = ConsoleSettings->AutoCompleteCommandColor;
}
#endif // ALLOW_CONSOLE

USignificanceManager::USignificanceManager()
	: Super()
{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UserInterface/Console.cpp:127

Scope (from outer to inner):

file
class        class FConsoleVariableAutoCompleteVisitor
function     static void OnConsoleVariable

Source code excerpt:

		else
		{
			Cmd.Color = ConsoleSettings->AutoCompleteCommandColor;
		}
	}
};

UConsole::UConsole(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UserInterface/Console.cpp:213

Scope (from outer to inner):

file
function     void UConsole::BuildRuntimeAutoCompleteList

Source code excerpt:

	{
		AutoCompleteList[Idx] = ConsoleSettings->ManualAutoCompleteList[Idx];
		AutoCompleteList[Idx].Color = ConsoleSettings->AutoCompleteCommandColor;
	}

	// systems that have registered to want to introduce entries
	RegisterConsoleAutoCompleteEntries.Broadcast(AutoCompleteList);

	// console variables

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UserInterface/Console.cpp:265

Scope (from outer to inner):

file
function     void UConsole::BuildRuntimeAutoCompleteList

Source code excerpt:

			const int32 NewIdx = (Idx < AutoCompleteList.Num()) ? Idx : AutoCompleteList.AddDefaulted();
			AutoCompleteList[NewIdx].Command = FuncName;
			AutoCompleteList[NewIdx].Color = ConsoleSettings->AutoCompleteCommandColor;

			FString Desc;

			// build a help string
			// append each property (and it's type) to the help string
			for (TFieldIterator<FProperty> PropIt(Func); PropIt && (PropIt->PropertyFlags & CPF_Parm); ++PropIt)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UserInterface/Console.cpp:338

Scope (from outer to inner):

file
function     void UConsole::BuildRuntimeAutoCompleteList

Source code excerpt:


			AutoCompleteList[NewIdx].Command = FString::Printf(TEXT("open %s"), *MapName);
			AutoCompleteList[NewIdx].Color = ConsoleSettings->AutoCompleteCommandColor;
			AutoCompleteList[NewIdx + 1].Command = FString::Printf(TEXT("travel %s"), *MapName);
			AutoCompleteList[NewIdx + 1].Color = ConsoleSettings->AutoCompleteCommandColor;
			AutoCompleteList[NewIdx + 2].Command = FString::Printf(TEXT("servertravel %s"), *MapName);
			AutoCompleteList[NewIdx + 2].Color = ConsoleSettings->AutoCompleteCommandColor;
		}
	}

	// misc commands
	{
		const int32 NewIdx = AutoCompleteList.AddDefaulted();
		AutoCompleteList[NewIdx].Command = FString(TEXT("open 127.0.0.1"));
		AutoCompleteList[NewIdx].Desc = FString(TEXT("(opens connection to localhost)"));
		AutoCompleteList[NewIdx].Color = ConsoleSettings->AutoCompleteCommandColor;
	}

#if STATS
	// stat commands
	{
		const TSet<FName>& StatGroupNames = FStatGroupGameThreadNotifier::Get().StatGroupNames;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UserInterface/Console.cpp:374

Scope (from outer to inner):

file
function     void UConsole::BuildRuntimeAutoCompleteList

Source code excerpt:

			Idx = (Idx < AutoCompleteList.Num()) ? Idx : AutoCompleteList.AddDefaulted();
			AutoCompleteList[Idx].Command = Command;
			AutoCompleteList[Idx].Color = ConsoleSettings->AutoCompleteCommandColor;
		}
	}
#endif

	// Add all showflag commands.
	{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UserInterface/Console.cpp:397

Scope (from outer to inner):

file
function     void UConsole::BuildRuntimeAutoCompleteList
function     bool HandleShowFlag

Source code excerpt:

				AutoCompleteList[NewIdx].Command = TEXT("show ") + InName;
				AutoCompleteList[NewIdx].Desc = FString::Printf(TEXT("(toggles the %s showflag)"), *LocName.ToString());
				AutoCompleteList[NewIdx].Color = GetDefault<UConsoleSettings>()->AutoCompleteCommandColor;

				return true;
			}
			
			bool OnEngineShowFlag(uint32 InIndex, const FString& InName)
			{

#Loc: <Workspace>/Engine/Source/Runtime/EngineSettings/Classes/ConsoleSettings.h:96

Scope (from outer to inner):

file
class        class UConsoleSettings : public UObject

Source code excerpt:

	/** The autocomplete color used for executable commands. */
	UPROPERTY(config, EditAnywhere, Category=Colors)
	FColor AutoCompleteCommandColor;

	/** The autocomplete color used for mutable CVars. */
	UPROPERTY(config, EditAnywhere, Category=Colors)
	FColor AutoCompleteCVarColor;

	/** The autocomplete color used for command descriptions and read-only CVars. */