From dda5522e7995e39d8c3e381a71afec59f150f6d3 Mon Sep 17 00:00:00 2001 From: Yannik F <73497566+reversum@users.noreply.github.com> Date: Tue, 16 Dec 2025 00:03:14 +0100 Subject: [PATCH 1/3] fix cassie MessageTranslated & remove obsolete "isHeld" --- EXILED/Exiled.API/Features/Cassie.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/EXILED/Exiled.API/Features/Cassie.cs b/EXILED/Exiled.API/Features/Cassie.cs index 42f0911dd..43bb1a802 100644 --- a/EXILED/Exiled.API/Features/Cassie.cs +++ b/EXILED/Exiled.API/Features/Cassie.cs @@ -47,7 +47,7 @@ public static class Cassie /// Indicates whether C.A.S.S.I.E has to make noises during the message. /// Indicates whether C.A.S.S.I.E has to make subtitles. public static void Message(string message, bool isHeld = false, bool isNoisy = true, bool isSubtitles = false) => - new CassieAnnouncement(new CassieTtsPayload(message, isSubtitles, isHeld), 0f, isNoisy ? 1 : 0).AddToQueue(); + new CassieAnnouncement(new CassieTtsPayload(message, isSubtitles, isNoisy), 0f, isNoisy ? 1 : 0).AddToQueue(); /// /// Reproduce a non-glitched C.A.S.S.I.E message with a possibility to custom the subtitles. @@ -65,7 +65,7 @@ public static void MessageTranslated(string message, string translation, bool is for (int i = 0; i < cassies.Length; i++) announcement.Append($"{translations[i].Replace(' ', ' ')} {cassies[i]} "); - new CassieAnnouncement(new CassieTtsPayload(message, isSubtitles, isHeld), 0f, isNoisy ? 1 : 0).AddToQueue(); + new CassieAnnouncement(new CassieTtsPayload(message, translation, isNoisy), 0f, isNoisy ? 1 : 0).AddToQueue(); StringBuilderPool.Pool.Return(announcement); } @@ -87,7 +87,7 @@ public static void GlitchyMessage(string message, float glitchChance, float jamC /// Indicates whether C.A.S.S.I.E has to make noises during the message. /// Indicates whether C.A.S.S.I.E has to make subtitles. public static void DelayedMessage(string message, float delay, bool isHeld = false, bool isNoisy = true, bool isSubtitles = false) => - Timing.CallDelayed(delay, () => new CassieAnnouncement(new CassieTtsPayload(message, isSubtitles, isHeld), 0f, isNoisy ? 1 : 0).AddToQueue()); + Timing.CallDelayed(delay, () => new CassieAnnouncement(new CassieTtsPayload(message, isSubtitles, isNoisy), 0f, isNoisy ? 1 : 0).AddToQueue()); /// /// Reproduce a glitchy C.A.S.S.I.E announcement after a certain period of seconds. From 5b3e941bf407c4298ba5b5097090543c9f411f00 Mon Sep 17 00:00:00 2001 From: Yannik F <73497566+reversum@users.noreply.github.com> Date: Tue, 16 Dec 2025 00:46:40 +0100 Subject: [PATCH 2/3] maybe use the translation with the split??? --- EXILED/Exiled.API/Features/Cassie.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXILED/Exiled.API/Features/Cassie.cs b/EXILED/Exiled.API/Features/Cassie.cs index 43bb1a802..86a851a8d 100644 --- a/EXILED/Exiled.API/Features/Cassie.cs +++ b/EXILED/Exiled.API/Features/Cassie.cs @@ -65,7 +65,7 @@ public static void MessageTranslated(string message, string translation, bool is for (int i = 0; i < cassies.Length; i++) announcement.Append($"{translations[i].Replace(' ', ' ')} {cassies[i]} "); - new CassieAnnouncement(new CassieTtsPayload(message, translation, isNoisy), 0f, isNoisy ? 1 : 0).AddToQueue(); + new CassieAnnouncement(new CassieTtsPayload(message, announcement.ToString(), isNoisy), 0f, isNoisy ? 1 : 0).AddToQueue(); StringBuilderPool.Pool.Return(announcement); } From ff1a7a056c01ea113cf860ef1476cf9e15f7af69 Mon Sep 17 00:00:00 2001 From: Yamato <66829532+louis1706@users.noreply.github.com> Date: Fri, 19 Dec 2025 01:02:48 +0100 Subject: [PATCH 3/3] Fix translation on ``Cassie:::MessageTranslated`` --- EXILED/Exiled.API/Features/Cassie.cs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/EXILED/Exiled.API/Features/Cassie.cs b/EXILED/Exiled.API/Features/Cassie.cs index 86a851a8d..b8664544a 100644 --- a/EXILED/Exiled.API/Features/Cassie.cs +++ b/EXILED/Exiled.API/Features/Cassie.cs @@ -47,7 +47,7 @@ public static class Cassie /// Indicates whether C.A.S.S.I.E has to make noises during the message. /// Indicates whether C.A.S.S.I.E has to make subtitles. public static void Message(string message, bool isHeld = false, bool isNoisy = true, bool isSubtitles = false) => - new CassieAnnouncement(new CassieTtsPayload(message, isSubtitles, isNoisy), 0f, isNoisy ? 1 : 0).AddToQueue(); + new CassieAnnouncement(new CassieTtsPayload(message, isSubtitles, isHeld), 0f, isNoisy ? 1 : 0).AddToQueue(); /// /// Reproduce a non-glitched C.A.S.S.I.E message with a possibility to custom the subtitles. @@ -59,14 +59,7 @@ public static void Message(string message, bool isHeld = false, bool isNoisy = t /// Indicates whether C.A.S.S.I.E has to make subtitles. public static void MessageTranslated(string message, string translation, bool isHeld = false, bool isNoisy = true, bool isSubtitles = true) { - StringBuilder announcement = StringBuilderPool.Pool.Get(); - string[] cassies = message.Split('\n'); - string[] translations = translation.Split('\n'); - for (int i = 0; i < cassies.Length; i++) - announcement.Append($"{translations[i].Replace(' ', ' ')} {cassies[i]} "); - - new CassieAnnouncement(new CassieTtsPayload(message, announcement.ToString(), isNoisy), 0f, isNoisy ? 1 : 0).AddToQueue(); - StringBuilderPool.Pool.Return(announcement); + new CassieAnnouncement(new CassieTtsPayload(message, translation, isHeld), 0f, isNoisy ? 1 : 0).AddToQueue(); } /// @@ -87,7 +80,7 @@ public static void GlitchyMessage(string message, float glitchChance, float jamC /// Indicates whether C.A.S.S.I.E has to make noises during the message. /// Indicates whether C.A.S.S.I.E has to make subtitles. public static void DelayedMessage(string message, float delay, bool isHeld = false, bool isNoisy = true, bool isSubtitles = false) => - Timing.CallDelayed(delay, () => new CassieAnnouncement(new CassieTtsPayload(message, isSubtitles, isNoisy), 0f, isNoisy ? 1 : 0).AddToQueue()); + Timing.CallDelayed(delay, () => new CassieAnnouncement(new CassieTtsPayload(message, isSubtitles, isHeld), 0f, isNoisy ? 1 : 0).AddToQueue()); /// /// Reproduce a glitchy C.A.S.S.I.E announcement after a certain period of seconds. @@ -106,7 +99,15 @@ public static void DelayedGlitchyMessage(string message, float delay, float glit /// An obsolete parameter. /// Another obsolete parameter. /// Duration (in seconds) of specified message. - public static float CalculateDuration(string message, bool obsolete1, float obsolete2) + [Obsolete("Please use CalculateDuration(string)", true)] + public static float CalculateDuration(string message, bool obsolete1, float obsolete2) => CalculateDuration(message); + + /// + /// Calculates the duration of a C.A.S.S.I.E message. + /// + /// The message, which duration will be calculated. + /// Duration (in seconds) of specified message. + public static float CalculateDuration(string message) { if (!CassieTtsAnnouncer.TryGetDatabase(out CassieLineDatabase cassieLineDatabase)) {