[fix] Remove excess emotions (ReFix) (#19)

This commit is contained in:
Kotovskiy34
2023-05-05 15:23:39 +03:00
committed by Aviu00
parent 0bd2ad5e38
commit 5a039bb558
3 changed files with 31 additions and 16 deletions

View File

@@ -35,11 +35,12 @@ public sealed class EmotionsUIController : UIController, IOnStateChanged<Gamepla
_window.OnClose += OnWindowClosed;
var emotions = _prototypeManager.EnumeratePrototypes<EmotePrototype>().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)
{
if (!emote.AllowToEmotionsMenu)
continue;
var control = new Button();
control.OnPressed += _ => UseEmote(_random.Pick(emote.ChatMessages));
control.Text = emote.ButtonText;