From 8767a80c411c01128d32c3409c4968c1ec7844b0 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sun, 26 Jul 2020 17:28:28 +0200 Subject: [PATCH] Show entity UIDs in the right-click menu if F3 is enabled. (#1490) --- .../GameObjects/EntitySystems/VerbSystem.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs index 0009680a3a..80ebb33036 100644 --- a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs @@ -150,7 +150,8 @@ namespace Content.Client.GameObjects.EntitySystems }); } - _currentEntityList.List.AddChild(new EntityButton(this, entity)); + var debugEnabled = _userInterfaceManager.DebugMonitors.Visible; + _currentEntityList.List.AddChild(new EntityButton(this, entity, debugEnabled)); first = false; } @@ -407,7 +408,7 @@ namespace Content.Client.GameObjects.EntitySystems private readonly VerbSystem _master; private readonly IEntity _entity; - public EntityButton(VerbSystem master, IEntity entity) + public EntityButton(VerbSystem master, IEntity entity, bool showUid) { _master = master; _entity = entity; @@ -420,11 +421,16 @@ namespace Content.Client.GameObjects.EntitySystems control.AddChild(new SpriteView {Sprite = sprite}); } + var text = entity.Name; + if (showUid) + { + text = $"{text} ({entity.Uid})"; + } control.AddChild(new MarginContainer { MarginLeftOverride = 4, MarginRightOverride = 4, - Children = {new Label {Text = entity.Name}} + Children = {new Label {Text = text}} }); AddChild(control);