From 7a4a7f16e9840322182244d8bf5acbeb0453e2a9 Mon Sep 17 00:00:00 2001 From: dffdff2423 Date: Sun, 19 May 2024 03:23:44 +0300 Subject: [PATCH] Fix Flavor Text editor not saving correctly (#28122) * Check for flavor text equality in profile. * Fix some characters being deleted from flavor text Sometimes the last few characters of the flavor text would get deleted. This fixes this issue. (cherry picked from commit 9f1d95e3353493f28d579b562de348a322312885) --- Content.Client/FlavorText/FlavorText.xaml.cs | 2 +- Content.Shared/Preferences/HumanoidCharacterProfile.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Client/FlavorText/FlavorText.xaml.cs b/Content.Client/FlavorText/FlavorText.xaml.cs index ffcf653f119..91b59046a47 100644 --- a/Content.Client/FlavorText/FlavorText.xaml.cs +++ b/Content.Client/FlavorText/FlavorText.xaml.cs @@ -17,7 +17,7 @@ public FlavorText() var loc = IoCManager.Resolve(); CFlavorTextInput.Placeholder = new Rope.Leaf(loc.GetString("flavor-text-placeholder")); - CFlavorTextInput.OnKeyBindDown += _ => FlavorTextChanged(); + CFlavorTextInput.OnTextChanged += _ => FlavorTextChanged(); } public void FlavorTextChanged() diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index f7518a5eb54..69bee8f8a83 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -336,7 +336,8 @@ public bool MemberwiseEquals(ICharacterProfile maybeOther) && _antagPreferences.SequenceEqual(other._antagPreferences) && _traitPreferences.SequenceEqual(other._traitPreferences) && LoadoutPreferences.SequenceEqual(other.LoadoutPreferences) - && Appearance.MemberwiseEquals(other.Appearance); + && Appearance.MemberwiseEquals(other.Appearance) + && FlavorText == other.FlavorText; } public void EnsureValid(ICommonSession session, IDependencyCollection collection)