[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; _window.OnClose += OnWindowClosed;
var emotions = _prototypeManager.EnumeratePrototypes<EmotePrototype>().ToList(); 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)); emotions.Sort((a,b) => string.Compare(a.ButtonText, b.ButtonText.ToString(), StringComparison.Ordinal));
foreach (var emote in emotions) foreach (var emote in emotions)
{ {
if (!emote.AllowToEmotionsMenu)
continue;
var control = new Button(); var control = new Button();
control.OnPressed += _ => UseEmote(_random.Pick(emote.ChatMessages)); control.OnPressed += _ => UseEmote(_random.Pick(emote.ChatMessages));
control.Text = emote.ButtonText; control.Text = emote.ButtonText;

View File

@@ -35,12 +35,16 @@ public sealed partial class EmotePrototype : IPrototype
[DataField("chatTriggers")] [DataField("chatTriggers")]
public HashSet<string>? ChatTriggers = new(); public HashSet<string>? ChatTriggers = new();
/// <summary> /// <summary> White Dream EDIT Start
/// Текст для кнопки в эмоут меню. /// Текст для кнопки в эмоут меню.
/// Бля ну или как это описать, вы поняли короче. ¯\_(ツ)_/¯ /// Бля ну или как это описать, вы поняли короче. ¯\_(ツ)_/¯
/// </summary> /// </summary>
[DataField("buttonText")] [DataField("buttonText")]
public string ButtonText { get; } = "Unknown"; public string ButtonText { get; } = "Unknown";
[DataField("allowMenu")]
public bool AllowToEmotionsMenu { get; } = false;
// White Dream EDIT end
} }
/// <summary> /// <summary>
@@ -53,7 +57,6 @@ public enum EmoteCategory : byte
{ {
Invalid = 0, Invalid = 0,
Vocal = 1 << 0, Vocal = 1 << 0,
Gesture = 1 << 1, Gesture = 1 << 1, // White Dream EDIT
General = byte.MaxValue, General = byte.MaxValue
White = byte.MaxValue
} }

View File

@@ -1,6 +1,6 @@
- type: emote - type: emote
id: Scream id: Scream
category: White category: Vocal
buttonText: Кричать buttonText: Кричать
chatMessages: [кричит, орет, вопит, рявкает] chatMessages: [кричит, орет, вопит, рявкает]
chatTriggers: chatTriggers:
@@ -19,10 +19,11 @@
- рявкнул - рявкнул
- рявкнула - рявкнула
- вопит - вопит
allowMenu: true
- type: emote - type: emote
id: Laugh id: Laugh
category: White category: Vocal
buttonText: Смеяться buttonText: Смеяться
chatMessages: [смеется, ржет, усмехается, хохочет, гогочет] chatMessages: [смеется, ржет, усмехается, хохочет, гогочет]
chatTriggers: chatTriggers:
@@ -40,10 +41,11 @@
- усмехнулся - усмехнулся
- хохочет - хохочет
- гогочет - гогочет
allowMenu: true
- type: emote - type: emote
id: Clap id: Clap
category: White category: Gesture
buttonText: Хлопать buttonText: Хлопать
chatMessages: [хлопает] chatMessages: [хлопает]
chatTriggers: chatTriggers:
@@ -51,10 +53,11 @@
- захлопала - захлопала
- захлопал - захлопал
- похлопал - похлопал
allowMenu: true
- type: emote - type: emote
id: Snap id: Snap
category: White category: Gesture
buttonText: Щелкать пальцами buttonText: Щелкать пальцами
chatMessages: [щелкает пальцами] chatMessages: [щелкает пальцами]
chatTriggers: chatTriggers:
@@ -64,45 +67,53 @@
- щелкнула - щелкнула
- щелкунл пальцами - щелкунл пальцами
- щелкунла пальцами - щелкунла пальцами
allowMenu: true
- type: emote - type: emote
id: WaveHand id: WaveHand
category: White category: Gesture
buttonText: Махать рукой buttonText: Махать рукой
chatMessages: [машет рукой] chatMessages: [машет рукой]
allowMenu: true
- type: emote - type: emote
id: Nod id: Nod
category: White category: Gesture
buttonText: Кивать buttonText: Кивать
chatMessages: [кивает] chatMessages: [кивает]
allowMenu: true
- type: emote - type: emote
id: ShakeHead id: ShakeHead
category: White category: Gesture
buttonText: Покачать головой buttonText: Покачать головой
chatMessages: [качает головой] chatMessages: [качает головой]
allowMenu: true
- type: emote - type: emote
id: Frown id: Frown
category: White category: Gesture
buttonText: Хмуриться buttonText: Хмуриться
chatMessages: [хмурится] chatMessages: [хмурится]
allowMenu: true
- type: emote - type: emote
id: Smile id: Smile
category: White category: Gesture
buttonText: Улыбаться buttonText: Улыбаться
chatMessages: [улыбается] chatMessages: [улыбается]
allowMenu: true
- type: emote - type: emote
id: Sniff id: Sniff
category: White category: Gesture
buttonText: Принюхиваться buttonText: Принюхиваться
chatMessages: [принюхивается] chatMessages: [принюхивается]
allowMenu: true
- type: emote - type: emote
id: LickLips id: LickLips
category: White category: Gesture
buttonText: Облизываться buttonText: Облизываться
chatMessages: [облизывается] chatMessages: [облизывается]
allowMenu: true