mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Show name of selected object in property window title
This commit is contained in:
@@ -21,6 +21,22 @@ class PropertiesWindow : ClosableWindow
|
|||||||
|
|
||||||
protected override void InternalShow()
|
protected override void InternalShow()
|
||||||
{
|
{
|
||||||
|
UpdateTitle();
|
||||||
|
|
||||||
InspectorWindow.ShowSelectedObject(_selectedObject, _editor);
|
InspectorWindow.ShowSelectedObject(_selectedObject, _editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateTitle()
|
||||||
|
{
|
||||||
|
if (_selectedObject case .Entity(let entityId) &&
|
||||||
|
_editor.CurrentScene.GetEntityByID(entityId) case .Ok(let entity))
|
||||||
|
{
|
||||||
|
WindowTitle = scope $"Properties: {entity.Name}";
|
||||||
|
}
|
||||||
|
else if (_selectedObject case .Asset(let assetHandle) &&
|
||||||
|
_editor.ContentManager.AssetHierarchy.GetNodeFromAssetHandle(assetHandle) case .Ok(let assetNode))
|
||||||
|
{
|
||||||
|
WindowTitle = scope $"Properties: {assetNode->AssetFile?.AssetFile?.Identifier}";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user