diff --git a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs index cd0b534e0..27be8e538 100644 --- a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs @@ -589,25 +589,27 @@ namespace FlaxEditor.CustomEditors.Dedicated LayoutElementsContainer yEl; LayoutElementsContainer hEl; LayoutElementsContainer vEl; + Color axisColorX = ActorTransformEditor.AxisColorX; + Color axisColorY = ActorTransformEditor.AxisColorY; if (xEq) { - xEl = UniformPanelCapsuleForObjectWithText(horUp, "X: ", xItem.GetValues(Values)); - vEl = UniformPanelCapsuleForObjectWithText(horDown, "Width: ", widthItem.GetValues(Values)); + xEl = UniformPanelCapsuleForObjectWithText(horUp, "X: ", xItem.GetValues(Values), axisColorX); + vEl = UniformPanelCapsuleForObjectWithText(horDown, "Width: ", widthItem.GetValues(Values), axisColorX); } else { - xEl = UniformPanelCapsuleForObjectWithText(horUp, "Left: ", leftItem.GetValues(Values)); - vEl = UniformPanelCapsuleForObjectWithText(horDown, "Right: ", rightItem.GetValues(Values)); + xEl = UniformPanelCapsuleForObjectWithText(horUp, "Left: ", leftItem.GetValues(Values), axisColorX); + vEl = UniformPanelCapsuleForObjectWithText(horDown, "Right: ", rightItem.GetValues(Values), axisColorX); } if (yEq) { - yEl = UniformPanelCapsuleForObjectWithText(horUp, "Y: ", yItem.GetValues(Values)); - hEl = UniformPanelCapsuleForObjectWithText(horDown, "Height: ", heightItem.GetValues(Values)); + yEl = UniformPanelCapsuleForObjectWithText(horUp, "Y: ", yItem.GetValues(Values), axisColorY); + hEl = UniformPanelCapsuleForObjectWithText(horDown, "Height: ", heightItem.GetValues(Values), axisColorY); } else { - yEl = UniformPanelCapsuleForObjectWithText(horUp, "Top: ", topItem.GetValues(Values)); - hEl = UniformPanelCapsuleForObjectWithText(horDown, "Bottom: ", bottomItem.GetValues(Values)); + yEl = UniformPanelCapsuleForObjectWithText(horUp, "Top: ", topItem.GetValues(Values), axisColorY); + hEl = UniformPanelCapsuleForObjectWithText(horDown, "Bottom: ", bottomItem.GetValues(Values), axisColorY); } xEl.Control.AnchorMin = new Float2(0, xEl.Control.AnchorMin.Y); xEl.Control.AnchorMax = new Float2(0.5f, xEl.Control.AnchorMax.Y); @@ -624,28 +626,34 @@ namespace FlaxEditor.CustomEditors.Dedicated private VerticalPanelElement VerticalPanelWithoutMargin(LayoutElementsContainer cont) { - var horUp = cont.VerticalPanel(); - horUp.Panel.Margin = Margin.Zero; - return horUp; + var panel = cont.VerticalPanel(); + panel.Panel.Margin = Margin.Zero; + return panel; } private CustomElementsContainer UniformGridTwoByOne(LayoutElementsContainer cont) { - var horUp = cont.CustomContainer(); - horUp.CustomControl.SlotsHorizontally = 2; - horUp.CustomControl.SlotsVertically = 1; - horUp.CustomControl.SlotPadding = Margin.Zero; - horUp.CustomControl.ClipChildren = false; - return horUp; + var grid = cont.CustomContainer(); + grid.CustomControl.SlotsHorizontally = 2; + grid.CustomControl.SlotsVertically = 1; + grid.CustomControl.SlotPadding = Margin.Zero; + grid.CustomControl.ClipChildren = false; + return grid; } - private CustomElementsContainer UniformPanelCapsuleForObjectWithText(LayoutElementsContainer el, string text, ValueContainer values) + private CustomElementsContainer UniformPanelCapsuleForObjectWithText(LayoutElementsContainer el, string text, ValueContainer values, Color borderColor) { - CustomElementsContainer hor = UniformGridTwoByOne(el); - hor.CustomControl.SlotPadding = new Margin(5, 5, 0, 0); - LabelElement lab = hor.Label(text); - hor.Object(values); - return hor; + var grid = UniformGridTwoByOne(el); + grid.CustomControl.SlotPadding = new Margin(5, 5, 1, 1); + var label = grid.Label(text); + var editor = grid.Object(values); + if (editor is FloatEditor floatEditor && floatEditor.Element is FloatValueElement floatEditorElement) + { + var back = FlaxEngine.GUI.Style.Current.TextBoxBackground; + floatEditorElement.ValueBox.BorderColor = Color.Lerp(borderColor, back, ActorTransformEditor.AxisGreyOutFactor); + floatEditorElement.ValueBox.BorderSelectedColor = borderColor; + } + return grid; } private bool _cachedXEq; diff --git a/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs b/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs index 29a9f45e8..fb33d470c 100644 --- a/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs +++ b/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs @@ -26,6 +26,11 @@ namespace FlaxEditor.CustomEditors.Editors /// public static Color AxisColorZ = new Color(0.0f, 0.0235294f, 1.0f, 1.0f); + /// + /// The axes colors grey out scale when input field is not focused. + /// + public static float AxisGreyOutFactor = 0.6f; + /// /// Custom editor for actor position property. /// @@ -39,12 +44,11 @@ namespace FlaxEditor.CustomEditors.Editors // Override colors var back = FlaxEngine.GUI.Style.Current.TextBoxBackground; - var grayOutFactor = 0.6f; - XElement.ValueBox.BorderColor = Color.Lerp(AxisColorX, back, grayOutFactor); + XElement.ValueBox.BorderColor = Color.Lerp(AxisColorX, back, AxisGreyOutFactor); XElement.ValueBox.BorderSelectedColor = AxisColorX; - YElement.ValueBox.BorderColor = Color.Lerp(AxisColorY, back, grayOutFactor); + YElement.ValueBox.BorderColor = Color.Lerp(AxisColorY, back, AxisGreyOutFactor); YElement.ValueBox.BorderSelectedColor = AxisColorY; - ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, grayOutFactor); + ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, AxisGreyOutFactor); ZElement.ValueBox.BorderSelectedColor = AxisColorZ; } } @@ -62,12 +66,11 @@ namespace FlaxEditor.CustomEditors.Editors // Override colors var back = FlaxEngine.GUI.Style.Current.TextBoxBackground; - var grayOutFactor = 0.6f; - XElement.ValueBox.BorderColor = Color.Lerp(AxisColorX, back, grayOutFactor); + XElement.ValueBox.BorderColor = Color.Lerp(AxisColorX, back, AxisGreyOutFactor); XElement.ValueBox.BorderSelectedColor = AxisColorX; - YElement.ValueBox.BorderColor = Color.Lerp(AxisColorY, back, grayOutFactor); + YElement.ValueBox.BorderColor = Color.Lerp(AxisColorY, back, AxisGreyOutFactor); YElement.ValueBox.BorderSelectedColor = AxisColorY; - ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, grayOutFactor); + ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, AxisGreyOutFactor); ZElement.ValueBox.BorderSelectedColor = AxisColorZ; } } diff --git a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs index 5eb289e0a..797a0a044 100644 --- a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs +++ b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs @@ -904,7 +904,7 @@ namespace FlaxEditor.GUI var k = new Keyframe { Time = keyframesPos.X, - Value = DefaultValue, + Value = Utilities.Utils.CloneValue(DefaultValue), }; OnEditingStart(); AddKeyframe(k); diff --git a/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs index 95b5dc57f..795674289 100644 --- a/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs @@ -204,7 +204,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks b.TooltipText = Utilities.Utils.GetTooltip(actorNode.Actor); } } - menu.AddButton("Select...", OnClickedSelect).TooltipText = "Opens actor picker dialog to select the target actor for this track"; + menu.AddButton("Retarget...", OnClickedSelect).TooltipText = "Opens actor picker dialog to select the target actor for this track"; } /// diff --git a/Source/Engine/Level/Actor.cs b/Source/Engine/Level/Actor.cs index ca8485ffc..f7f03afff 100644 --- a/Source/Engine/Level/Actor.cs +++ b/Source/Engine/Level/Actor.cs @@ -390,7 +390,7 @@ namespace FlaxEngine } #if FLAX_EDITOR - internal bool ShowTransform => !(this is UIControl); + private bool ShowTransform => !(this is UIControl); #endif } }