Add entity ProtoId to spawn panel tooltip (#6424)

* Add entity ProtoId to spawn panel tooltip

* Add backup message for entities with no description

* Release notes
This commit is contained in:
Tayrtahn
2026-02-22 15:23:48 -05:00
committed by GitHub
parent 48dbcf7fd4
commit 9c4dd7a5e7
3 changed files with 8 additions and 1 deletions
+1
View File
@@ -42,6 +42,7 @@ END TEMPLATE-->
* If a sandbox error is caused by a compiler-generated method, the engine will now attempt to point out which using code is responsible.
* Added `OrderedDictionary<TKey, TValue>` and `System.StringComparer` to the sandbox whitelist.
* Added more overloads to `MapLoaderSystem` taking `TextReader`/`TextWriter` where appropriate.
* The tooltip when hovering an entry in the entity spawn panel now contains the entity's protoid as well as its description.
### Bugfixes
@@ -3,6 +3,7 @@
entity-spawn-window-title = Entity Spawn Panel
entity-spawn-window-replace-button-text = Replace
entity-spawn-window-override-menu-tooltip = Override placement
entity-spawn-window-no-description = No description
## TileSpawnWindow
@@ -8,6 +8,7 @@ using Robust.Client.Placement;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Graphics;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
@@ -16,6 +17,9 @@ namespace Robust.Client.UserInterface.CustomControls
[GenerateTypedNameReferences]
public sealed partial class EntitySpawnWindow : DefaultWindow
{
private static readonly LocId NoDescriptionMessage = "entity-spawn-window-no-description";
[Dependency] private readonly ILocalizationManager _loc = default!;
[Dependency] private readonly IPlacementManager _placement = default!;
public EntitySpawnButton? SelectedButton;
@@ -53,7 +57,8 @@ namespace Robust.Client.UserInterface.CustomControls
}
button.EntityLabel.Text = entityLabelText;
button.ActualButton.ToolTip = prototype.Description;
var desc = string.IsNullOrEmpty(prototype.Description) ? _loc.GetString(NoDescriptionMessage) : prototype.Description;
button.ActualButton.ToolTip = $"{prototype.ID}\n{desc}";
if (prototype == SelectedPrototype)
{