Small name changes
This commit is contained in:
@@ -86,14 +86,14 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
{
|
||||
base.Initialize(layout);
|
||||
|
||||
LinkValuesTogether = Editor.Instance.Windows.PropertiesWin.ScaleLocked;
|
||||
LinkValues = Editor.Instance.Windows.PropertiesWin.ScaleLinked;
|
||||
|
||||
_linkImage = new Image
|
||||
{
|
||||
Parent = LinkedLabel,
|
||||
Width = 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,
|
||||
TooltipText = "Scale values are linked together.",
|
||||
};
|
||||
@@ -103,7 +103,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
LinkedLabel.SetupContextMenu += (label, menu, editor) =>
|
||||
{
|
||||
menu.AddSeparator();
|
||||
menu.AddButton(LinkValuesTogether ? "Unlink" : "Link", ToggleLink);
|
||||
menu.AddButton(LinkValues ? "Unlink" : "Link", ToggleLink);
|
||||
};
|
||||
|
||||
// Override colors
|
||||
@@ -122,9 +122,9 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// </summary>
|
||||
public void ToggleLink()
|
||||
{
|
||||
LinkValuesTogether = !LinkValuesTogether;
|
||||
Editor.Instance.Windows.PropertiesWin.ScaleLocked = LinkValuesTogether;
|
||||
_linkImage.Brush = LinkValuesTogether ? new SpriteBrush(Editor.Instance.Icons.Link32) : new SpriteBrush();
|
||||
LinkValues = !LinkValues;
|
||||
Editor.Instance.Windows.PropertiesWin.ScaleLinked = LinkValues;
|
||||
_linkImage.Brush = LinkValues ? new SpriteBrush(Editor.Instance.Icons.Link32) : new SpriteBrush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <summary>
|
||||
/// If true, when one value is changed, the other 2 will change as well.
|
||||
/// </summary>
|
||||
public bool LinkValuesTogether = false;
|
||||
public bool LinkValues = false;
|
||||
|
||||
private enum ValueChanged
|
||||
{
|
||||
@@ -95,7 +95,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
{
|
||||
if (IsSetBlocked)
|
||||
return;
|
||||
if (LinkValuesTogether)
|
||||
if (LinkValues)
|
||||
_valueChanged = ValueChanged.X;
|
||||
|
||||
OnValueChanged();
|
||||
@@ -105,7 +105,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
{
|
||||
if (IsSetBlocked)
|
||||
return;
|
||||
if (LinkValuesTogether)
|
||||
if (LinkValues)
|
||||
_valueChanged = ValueChanged.Y;
|
||||
|
||||
OnValueChanged();
|
||||
@@ -115,7 +115,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
{
|
||||
if (IsSetBlocked)
|
||||
return;
|
||||
if (LinkValuesTogether)
|
||||
if (LinkValues)
|
||||
_valueChanged = ValueChanged.Z;
|
||||
|
||||
OnValueChanged();
|
||||
@@ -130,7 +130,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
var yValue = YElement.ValueBox.Value;
|
||||
var zValue = ZElement.ValueBox.Value;
|
||||
|
||||
if (LinkValuesTogether)
|
||||
if (LinkValues)
|
||||
{
|
||||
var valueChange = 0.0f;
|
||||
switch (_valueChanged)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace FlaxEditor.Windows
|
||||
/// <summary>
|
||||
/// Indication of if the scale is locked.
|
||||
/// </summary>
|
||||
public bool ScaleLocked = false;
|
||||
public bool ScaleLinked = false;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PropertiesWindow"/> class.
|
||||
@@ -65,14 +65,14 @@ namespace FlaxEditor.Windows
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutSerialize(XmlWriter writer)
|
||||
{
|
||||
writer.WriteAttributeString("ScaleLocked", ScaleLocked.ToString());
|
||||
writer.WriteAttributeString("ScaleLinked", ScaleLinked.ToString());
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
if (bool.TryParse(node.GetAttribute("ScaleLocked"), out bool value1))
|
||||
ScaleLocked = value1;
|
||||
if (bool.TryParse(node.GetAttribute("ScaleLinked"), out bool value1))
|
||||
ScaleLinked = value1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user