Minor cleanup

This commit is contained in:
Wojtek Figat
2023-08-27 16:36:37 +02:00
parent 94bd4d39f7
commit 3b163b6c4b
2 changed files with 10 additions and 4 deletions

View File

@@ -308,9 +308,9 @@ namespace FlaxEditor.GUI.Timeline.Tracks
b.ButtonClicked += OnAddAnimEvent;
}
if (!addEvent.ContextMenu.Items.Any())
addEvent.ContextMenu.AddButton("No Anim Events Found.").CloseMenuOnClick = false;
addEvent.ContextMenu.AddButton("No Anim Events found").CloseMenuOnClick = false;
if (!addContinuousEvent.ContextMenu.Items.Any())
addContinuousEvent.ContextMenu.AddButton("No Continuous Anim Events Found.").CloseMenuOnClick = false;
addContinuousEvent.ContextMenu.AddButton("No Continuous Anim Events found").CloseMenuOnClick = false;
}

View File

@@ -23,6 +23,7 @@ namespace FlaxEditor.Windows.Assets
private readonly Undo _undo;
private object _object;
private bool _isRegisteredForScriptsReload;
private Label _typeText;
/// <summary>
/// Gets the instance of the Json asset object that is being edited.
@@ -137,16 +138,20 @@ namespace FlaxEditor.Windows.Assets
}
_presenter.Select(_object);
var typeText = new Label
if (_typeText != null)
_typeText.Dispose();
var typeText = new ClickableLabel
{
Text = $"{Asset.DataTypeName}",
TooltipText = "The Asset Type.",
TooltipText = "Asset data type (full name)",
AnchorPreset = AnchorPresets.TopRight,
AutoWidth = true,
Parent = this,
};
typeText.LocalX += -(typeText.Width + 4);
typeText.LocalY += (_toolstrip.Height - typeText.Height) * 0.5f;
typeText.RightClick = () => Clipboard.Text = Asset.DataTypeName;
_typeText = typeText;
_undo.Clear();
ClearEditedFlag();
@@ -187,6 +192,7 @@ namespace FlaxEditor.Windows.Assets
_isRegisteredForScriptsReload = false;
ScriptsBuilder.ScriptsReloadBegin -= OnScriptsReloadBegin;
}
_typeText = null;
base.OnDestroy();
}