From fc7ad61afea90b8ea9ea011966721cf8d1677f83 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Sun, 14 Mar 2021 23:21:52 +0100 Subject: [PATCH] Fix funky nullability making rotatable verbs not show up Fixes #3656 --- .../GameObjects/EntitySystems/VerbSystem.cs | 11 +++++------ Resources/Changelog/Parts/rotatable.yml | 4 ++++ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 Resources/Changelog/Parts/rotatable.yml diff --git a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs index 403cc6f6a3..05fc585389 100644 --- a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs @@ -223,10 +223,9 @@ namespace Content.Client.GameObjects.EntitySystems first = false; - if (groupIcons.TryGetValue(category, out var icon)) - { - vBox.AddChild(CreateCategoryButton(category, verbs, icon)); - } + groupIcons.TryGetValue(category, out var icon); + + vBox.AddChild(CreateCategoryButton(category, verbs, icon)); } if (buttons.ContainsKey("")) @@ -290,7 +289,7 @@ namespace Content.Client.GameObjects.EntitySystems return button; } - private Control CreateCategoryButton(string text, List verbButtons, SpriteSpecifier icon) + private Control CreateCategoryButton(string text, List verbButtons, SpriteSpecifier? icon) { verbButtons.Sort((a, b) => string.Compare(a.Text, b.Text, StringComparison.CurrentCulture)); @@ -411,7 +410,7 @@ namespace Content.Client.GameObjects.EntitySystems set => _icon.Texture = value; } - public VerbGroupButton(VerbSystem system, List verbButtons, SpriteSpecifier icon) + public VerbGroupButton(VerbSystem system, List verbButtons, SpriteSpecifier? icon) { _system = system; VerbButtons = verbButtons; diff --git a/Resources/Changelog/Parts/rotatable.yml b/Resources/Changelog/Parts/rotatable.yml new file mode 100644 index 0000000000..381654a2c4 --- /dev/null +++ b/Resources/Changelog/Parts/rotatable.yml @@ -0,0 +1,4 @@ +author: Zumorica +changes: + - type: Fix + message: Fixes rotatable verbs not showing in the context menu.