From 3a093ced928e7d4ae37a752a604c9a0e6625012c Mon Sep 17 00:00:00 2001 From: rhailrake <49613070+rhailrake@users.noreply.github.com> Date: Fri, 5 May 2023 15:14:17 +0600 Subject: [PATCH] [fix] emotion panel now takes White category --- .../Systems/Emotions/EmotionsUIController.cs | 9 +++----- .../Chat/Prototypes/EmotePrototype.cs | 3 ++- Resources/Prototypes/emotes.yml | 22 +++++++++---------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Emotions/EmotionsUIController.cs b/Content.Client/UserInterface/Systems/Emotions/EmotionsUIController.cs index 2c34076911..562438e3ed 100644 --- a/Content.Client/UserInterface/Systems/Emotions/EmotionsUIController.cs +++ b/Content.Client/UserInterface/Systems/Emotions/EmotionsUIController.cs @@ -6,13 +6,11 @@ using Content.Client.UserInterface.Systems.Emotions.Windows; using Content.Shared.Chat; using Content.Shared.Chat.Prototypes; using Content.Shared.Input; -using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controllers; using Robust.Client.UserInterface.Controls; using Robust.Shared.Input.Binding; using Robust.Shared.Prototypes; using Robust.Shared.Random; -using Robust.Shared.Utility; namespace Content.Client.UserInterface.Systems.Emotions; @@ -27,18 +25,17 @@ public sealed class EmotionsUIController : UIController, IOnStateChanged UIManager.GetActiveUIWidgetOrNull()?.EmotionsButton; private DateTime _lastEmotionTimeUse = DateTime.Now; - private float _emoteCooldown = 1.5f; + private const float EmoteCooldown = 1.5f; public void OnStateEntered(GameplayState state) { - DebugTools.Assert(_window == null); - _window = UIManager.CreateWindow(); _window.OnOpen += OnWindowOpened; _window.OnClose += OnWindowClosed; var emotions = _prototypeManager.EnumeratePrototypes().ToList(); + emotions = emotions.Where(emote => emote.Category == EmoteCategory.White).ToList(); emotions.Sort((a,b) => string.Compare(a.ButtonText, b.ButtonText.ToString(), StringComparison.Ordinal)); foreach (var emote in emotions) @@ -73,7 +70,7 @@ public sealed class EmotionsUIController : UIController, IOnStateChanged