mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-06-09 10:06:34 +02:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user