From dcd16345bb7d4266bd5268001e5b60679b67c80d Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:24:00 +0300 Subject: [PATCH] AI rewiew --- .../UI/Emotions/EmotionsUIController.cs | 22 ++++++++++++------- .../en-US/_white/emotes/speech-emotes.ftl | 10 ++++----- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Content.Client/_White/UI/Emotions/EmotionsUIController.cs b/Content.Client/_White/UI/Emotions/EmotionsUIController.cs index d39bad6f15..d11b27e88c 100644 --- a/Content.Client/_White/UI/Emotions/EmotionsUIController.cs +++ b/Content.Client/_White/UI/Emotions/EmotionsUIController.cs @@ -42,14 +42,8 @@ public void OnStateEntered(GameplayState state) if (!emote.AllowToEmotionsMenu) continue; - var control = new Button(); - control.OnPressed += _ => UseEmote(Loc.GetString(_random.Pick(emote.ChatMessages))); - control.Text = Loc.GetString(emote.ButtonText); - control.HorizontalExpand = true; - control.VerticalExpand = true; - control.MaxWidth = 250; - control.MaxHeight = 50; - _window.EmotionsContainer.AddChild(control); + var button = CreateEmoteButton(emote); + _window.EmotionsContainer.AddChild(button); } CommandBinds.Builder @@ -128,4 +122,16 @@ private void UseEmote(string emote) _lastEmotionTimeUse = DateTime.Now; _chatManager.SendMessage(emote, ChatSelectChannel.Emotes); } + + private Button CreateEmoteButton(EmotePrototype emote) + { + var control = new Button(); + control.OnPressed += _ => UseEmote(Loc.GetString(_random.Pick(emote.ChatMessages))); + control.Text = Loc.GetString(emote.ButtonText); + control.HorizontalExpand = true; + control.VerticalExpand = true; + control.MaxWidth = 250; + control.MaxHeight = 50; + return control; + } } diff --git a/Resources/Locale/en-US/_white/emotes/speech-emotes.ftl b/Resources/Locale/en-US/_white/emotes/speech-emotes.ftl index cbb1b1e964..b62e05d60f 100644 --- a/Resources/Locale/en-US/_white/emotes/speech-emotes.ftl +++ b/Resources/Locale/en-US/_white/emotes/speech-emotes.ftl @@ -23,12 +23,12 @@ emote-chat-button-text-sigh = Sigh emote-chat-messages-sigh-1 = sighs #Whistle -emote-chat-button-text-whistle = Цhistle +emote-chat-button-text-whistle = Whistle emote-chat-messages-whistle-1 = whistles #Crying -emote-chat-button-text-crying = Сrie +emote-chat-button-text-crying = Сry emote-chat-messages-crying-1 = cries @@ -36,7 +36,7 @@ emote-chat-messages-crying-1 = cries emote-chat-messages-squish-1 = squishes #Chitter -emote-chat-messages-chitter-1 = squishes +emote-chat-messages-chitter-1 = chitters #Squeak emote-chat-messages-squeak-1 = squeaks @@ -114,6 +114,6 @@ emote-chat-button-text-frown = Frown emote-chat-messages-frown-1 = frowns #Smile -emote-chat-button-text-smile = Улыбаться +emote-chat-button-text-smile = Smile -emote-chat-messages-smile-1 = улыбается \ No newline at end of file +emote-chat-messages-smile-1 = smiles \ No newline at end of file