Small name changes

This commit is contained in:
Chandler Cox
2023-02-05 20:17:21 -06:00
parent 0f38fdda30
commit d5d5fb698f
3 changed files with 15 additions and 15 deletions

View File

@@ -86,14 +86,14 @@ namespace FlaxEditor.CustomEditors.Editors
{ {
base.Initialize(layout); base.Initialize(layout);
LinkValuesTogether = Editor.Instance.Windows.PropertiesWin.ScaleLocked; LinkValues = Editor.Instance.Windows.PropertiesWin.ScaleLinked;
_linkImage = new Image _linkImage = new Image
{ {
Parent = LinkedLabel, Parent = LinkedLabel,
Width = 18, Width = 18,
Height = 18, Height = 18,
Brush = LinkValuesTogether ? new SpriteBrush(Editor.Instance.Icons.Link32) : new SpriteBrush(), Brush = LinkValues ? new SpriteBrush(Editor.Instance.Icons.Link32) : new SpriteBrush(),
AnchorPreset = AnchorPresets.TopLeft, AnchorPreset = AnchorPresets.TopLeft,
TooltipText = "Scale values are linked together.", TooltipText = "Scale values are linked together.",
}; };
@@ -103,7 +103,7 @@ namespace FlaxEditor.CustomEditors.Editors
LinkedLabel.SetupContextMenu += (label, menu, editor) => LinkedLabel.SetupContextMenu += (label, menu, editor) =>
{ {
menu.AddSeparator(); menu.AddSeparator();
menu.AddButton(LinkValuesTogether ? "Unlink" : "Link", ToggleLink); menu.AddButton(LinkValues ? "Unlink" : "Link", ToggleLink);
}; };
// Override colors // Override colors
@@ -122,9 +122,9 @@ namespace FlaxEditor.CustomEditors.Editors
/// </summary> /// </summary>
public void ToggleLink() public void ToggleLink()
{ {
LinkValuesTogether = !LinkValuesTogether; LinkValues = !LinkValues;
Editor.Instance.Windows.PropertiesWin.ScaleLocked = LinkValuesTogether; Editor.Instance.Windows.PropertiesWin.ScaleLinked = LinkValues;
_linkImage.Brush = LinkValuesTogether ? new SpriteBrush(Editor.Instance.Icons.Link32) : new SpriteBrush(); _linkImage.Brush = LinkValues ? new SpriteBrush(Editor.Instance.Icons.Link32) : new SpriteBrush();
} }
} }
} }

View File

@@ -47,7 +47,7 @@ namespace FlaxEditor.CustomEditors.Editors
/// <summary> /// <summary>
/// If true, when one value is changed, the other 2 will change as well. /// If true, when one value is changed, the other 2 will change as well.
/// </summary> /// </summary>
public bool LinkValuesTogether = false; public bool LinkValues = false;
private enum ValueChanged private enum ValueChanged
{ {
@@ -95,7 +95,7 @@ namespace FlaxEditor.CustomEditors.Editors
{ {
if (IsSetBlocked) if (IsSetBlocked)
return; return;
if (LinkValuesTogether) if (LinkValues)
_valueChanged = ValueChanged.X; _valueChanged = ValueChanged.X;
OnValueChanged(); OnValueChanged();
@@ -105,7 +105,7 @@ namespace FlaxEditor.CustomEditors.Editors
{ {
if (IsSetBlocked) if (IsSetBlocked)
return; return;
if (LinkValuesTogether) if (LinkValues)
_valueChanged = ValueChanged.Y; _valueChanged = ValueChanged.Y;
OnValueChanged(); OnValueChanged();
@@ -115,7 +115,7 @@ namespace FlaxEditor.CustomEditors.Editors
{ {
if (IsSetBlocked) if (IsSetBlocked)
return; return;
if (LinkValuesTogether) if (LinkValues)
_valueChanged = ValueChanged.Z; _valueChanged = ValueChanged.Z;
OnValueChanged(); OnValueChanged();
@@ -130,7 +130,7 @@ namespace FlaxEditor.CustomEditors.Editors
var yValue = YElement.ValueBox.Value; var yValue = YElement.ValueBox.Value;
var zValue = ZElement.ValueBox.Value; var zValue = ZElement.ValueBox.Value;
if (LinkValuesTogether) if (LinkValues)
{ {
var valueChange = 0.0f; var valueChange = 0.0f;
switch (_valueChanged) switch (_valueChanged)

View File

@@ -28,7 +28,7 @@ namespace FlaxEditor.Windows
/// <summary> /// <summary>
/// Indication of if the scale is locked. /// Indication of if the scale is locked.
/// </summary> /// </summary>
public bool ScaleLocked = false; public bool ScaleLinked = false;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="PropertiesWindow"/> class. /// Initializes a new instance of the <see cref="PropertiesWindow"/> class.
@@ -65,14 +65,14 @@ namespace FlaxEditor.Windows
/// <inheritdoc /> /// <inheritdoc />
public override void OnLayoutSerialize(XmlWriter writer) public override void OnLayoutSerialize(XmlWriter writer)
{ {
writer.WriteAttributeString("ScaleLocked", ScaleLocked.ToString()); writer.WriteAttributeString("ScaleLinked", ScaleLinked.ToString());
} }
/// <inheritdoc /> /// <inheritdoc />
public override void OnLayoutDeserialize(XmlElement node) public override void OnLayoutDeserialize(XmlElement node)
{ {
if (bool.TryParse(node.GetAttribute("ScaleLocked"), out bool value1)) if (bool.TryParse(node.GetAttribute("ScaleLinked"), out bool value1))
ScaleLocked = value1; ScaleLinked = value1;
} }
} }
} }