SelectedKeyColor
SelectedKeyColor
#Overview
name: SelectedKeyColor
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 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of SelectedKeyColor is to define the color used to highlight selected keys in curve editors within Unreal Engine 5. This variable is primarily used in the rendering system, specifically for user interface elements related to curve editing.
Based on the provided callsites, this setting variable is used in the following Unreal Engine subsystems and modules:
- Niagara FX Plugin (NiagaraEditor module)
- Distribution Curve Editor (DistCurveEditor module)
- Unreal Editor (UnrealEd module)
The value of this variable is typically set in the UCurveEdOptions class, which is a configuration object for curve editor preferences. It is defined as an UPROPERTY with the EditAnywhere and config specifiers, allowing it to be edited in the editor and saved in configuration files.
SelectedKeyColor interacts with other variables related to curve editing, such as:
- KeyColor: Used for non-selected keys
- CurveColor: Used for the curve itself
- GridTextColor and LabelBlockBkgColor: Used for other UI elements in the curve editor
Developers should be aware of the following when using this variable:
- It affects the visual appearance of selected keys in various curve editors throughout the engine.
- Changing this color may impact the user experience and readability of curve editors.
- It is used in both 2D and 3D curve editing contexts.
Best practices when using this variable include:
- Ensure the selected key color provides sufficient contrast against the background and non-selected keys for easy identification.
- Consider accessibility guidelines when choosing colors to accommodate users with color vision deficiencies.
- Maintain consistency with other UI elements and the overall engine theme.
- If modifying this value programmatically, update it through the appropriate configuration or settings interfaces rather than hard-coding values in multiple locations.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:536, section: [/Script/UnrealEd.CurveEdOptions]
- INI Section:
/Script/UnrealEd.CurveEdOptions
- Raw value:
(R=1.0,G=1.0,B=0.0,A=1.0)
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Private/Widgets/SNiagaraDistributionCurveEditor.cpp:38
Scope (from outer to inner):
file
class class SNiagaraCompactCurveView : public SLeafWidget
function void Construct
Source code excerpt:
KeyColor = FSlateColor(EStyleColor::AccentGray);
SelectedKeyColor = FSlateColor(EStyleColor::Select);
}
virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override
{
FKeyHandle NewSelectedKeyHandle = SelectedKeyHandle.Get();
int32 NewCurveStateSerialNumber = CurveStateSerialNumber.Get(0);
#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Private/Widgets/SNiagaraDistributionCurveEditor.cpp:64
Scope (from outer to inner):
file
class class SNiagaraCompactCurveView : public SLeafWidget
function virtual int32 OnPaint
Source code excerpt:
FSlateDrawElement::MakeLines(OutDrawElements, LayerId, AllottedGeometry.ToPaintGeometry(), KeyLinePoints, ESlateDrawEffect::None, KeyColor.GetColor(InWidgetStyle), true, 2.0f);
}
FSlateDrawElement::MakeLines(OutDrawElements, LayerId, AllottedGeometry.ToPaintGeometry(), SelectedKeyLineCache, ESlateDrawEffect::None, SelectedKeyColor.GetColor(InWidgetStyle), true, 3.0f);
return LayerId;
}
virtual FVector2D ComputeDesiredSize(float) const override
{
return FVector2D(Width, Height);
#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Private/Widgets/SNiagaraDistributionCurveEditor.cpp:149
Scope (from outer to inner):
file
class class SNiagaraCompactCurveView : public SLeafWidget
Source code excerpt:
FSlateColor CurveColor;
FSlateColor KeyColor;
FSlateColor SelectedKeyColor;
TAttribute<FKeyHandle> SelectedKeyHandle;
TAttribute<int32> CurveStateSerialNumber;
};
class SNiagaraCompactCurveKeyHandle : public SBorder
{
#Loc: <Workspace>/Engine/Source/Editor/DistCurveEditor/Private/CurveEditorViewportClient.cpp:84
Scope (from outer to inner):
file
function FCurveEditorViewportClient::FCurveEditorViewportClient
Source code excerpt:
GridTextColor = SharedData->EditorOptions->GridTextColor;
LabelBlockBkgColor = SharedData->EditorOptions->LabelBlockBkgColor;
SelectedKeyColor = SharedData->EditorOptions->SelectedKeyColor;
MouseOverCurveIndex = INDEX_NONE;
MouseOverSubIndex = INDEX_NONE;
MouseOverKeyIndex = INDEX_NONE;
HandleCurveIndex = INDEX_NONE;
#Loc: <Workspace>/Engine/Source/Editor/DistCurveEditor/Private/CurveEditorViewportClient.cpp:1144
Scope (from outer to inner):
file
function void FCurveEditorViewportClient::DrawEntry
Source code excerpt:
bool bSelectedKey = SharedData->SelectedKeys.Contains(TestKey);
FColor BorderColor = EdInterface->GetKeyColor(SubIdx, KeyIdx, Entry.CurveColor);
FColor CenterColor = bSelectedKey ? SelectedKeyColor.ToFColor(true) : Entry.CurveColor;
if(Canvas->IsHitTesting()) Canvas->SetHitProxy(new HCurveEditorKeyProxy(CurveIndex, SubIdx, KeyIdx));
Canvas->DrawTile( NewKeyPos.X-3, NewKeyPos.Y-3, 7, 7, 0.f, 0.f, 1.f, 1.f, BorderColor);
Canvas->DrawTile( NewKeyPos.X-2, NewKeyPos.Y-2, 5, 5, 0.f, 0.f, 1.f, 1.f, CenterColor);
if(Canvas->IsHitTesting()) Canvas->SetHitProxy(NULL);
#Loc: <Workspace>/Engine/Source/Editor/DistCurveEditor/Private/CurveEditorViewportClient.h:155
Scope (from outer to inner):
file
class class FCurveEditorViewportClient : public FCommonViewportClient
Source code excerpt:
FLinearColor GridTextColor;
FLinearColor LabelBlockBkgColor;
FLinearColor SelectedKeyColor;
int32 MouseOverCurveIndex;
int32 MouseOverSubIndex;
int32 MouseOverKeyIndex;
int32 HandleCurveIndex;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Preferences/CurveEdOptions.h:44
Scope (from outer to inner):
file
class class UCurveEdOptions : public UObject
Source code excerpt:
UPROPERTY(EditAnywhere, config, Category=Options)
FLinearColor SelectedKeyColor;
};