Add various usability improvements to the Editor
This commit is contained in:
@@ -331,17 +331,12 @@ namespace FlaxEditor.CustomEditors
|
||||
{
|
||||
if (LinkedLabel != null)
|
||||
{
|
||||
// Prefab value diff
|
||||
if (Values.HasReferenceValue)
|
||||
{
|
||||
var style = FlaxEngine.GUI.Style.Current;
|
||||
LinkedLabel.HighlightStripColor = CanRevertReferenceValue ? style.BackgroundSelected * 0.8f : Color.Transparent;
|
||||
}
|
||||
// Default value diff
|
||||
else if (Values.HasDefaultValue)
|
||||
{
|
||||
LinkedLabel.HighlightStripColor = CanRevertDefaultValue ? Color.Yellow * 0.8f : Color.Transparent;
|
||||
}
|
||||
var color = Color.Transparent;
|
||||
if (Values.HasReferenceValue && CanRevertReferenceValue)
|
||||
color = FlaxEngine.GUI.Style.Current.BackgroundSelected;
|
||||
else if (Values.HasDefaultValue && CanRevertDefaultValue)
|
||||
color = Color.Yellow * 0.8f;
|
||||
LinkedLabel.HighlightStripColor = color;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,10 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
public override void Refresh()
|
||||
{
|
||||
if (_isValid != IsValid)
|
||||
{
|
||||
RebuildLayout();
|
||||
return;
|
||||
}
|
||||
|
||||
base.Refresh();
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace FlaxEditor.GUI.Dialogs
|
||||
hsv.Y = Mathf.Saturate(distance / (_wheelRect.Width * 0.5f));
|
||||
|
||||
// Auto set Value to 1 when color is black. Makes editing easier.
|
||||
if (_color == Color.Black && hsv.Z <= 0.001f)
|
||||
if ((_color == Color.Black || _color == Color.Transparent) && hsv.Z <= 0.001f)
|
||||
hsv.Z = 1.0f;
|
||||
|
||||
var color = Color.FromHSV(hsv);
|
||||
|
||||
@@ -568,7 +568,7 @@ namespace FlaxEditor.Viewport
|
||||
// Selected UI controls outline
|
||||
for (var i = 0; i < _window.Selection.Count; i++)
|
||||
{
|
||||
if (_window.Selection[i].EditableObject is UIControl controlActor && controlActor && controlActor.Control != null)
|
||||
if (_window.Selection[i]?.EditableObject is UIControl controlActor && controlActor && controlActor.Control != null)
|
||||
{
|
||||
var control = controlActor.Control;
|
||||
var bounds = Rectangle.FromPoints(control.PointToParent(this, Vector2.Zero), control.PointToParent(this, control.Size));
|
||||
|
||||
Reference in New Issue
Block a user