From baae2393d7de1d309e8fe171f3aef76ec573b164 Mon Sep 17 00:00:00 2001 From: Gurge44 Date: Wed, 17 Dec 2025 09:58:49 +0100 Subject: [PATCH] fix repeating options --- Modules/OptionShower.cs | 14 ++++++++++++++ Modules/RPC.cs | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Modules/OptionShower.cs b/Modules/OptionShower.cs index 8f780394f..bc5bec32b 100644 --- a/Modules/OptionShower.cs +++ b/Modules/OptionShower.cs @@ -13,6 +13,8 @@ public static class OptionShower public static int CurrentPage; public static List Pages = []; public static string LastText = string.Empty; + private static bool Running; + private static bool InQueue; static OptionShower() { } @@ -33,6 +35,16 @@ public static class OptionShower public static IEnumerator GetText() { + if (Running) + { + if (InQueue) yield break; + InQueue = true; + while (Running) yield return null; + InQueue = false; + } + + Running = true; + StringBuilder sb = new(); Pages = @@ -122,6 +134,8 @@ public static class OptionShower } if (CurrentPage >= Pages.Count) CurrentPage = Pages.Count - 1; + + Running = false; } public static void Next() diff --git a/Modules/RPC.cs b/Modules/RPC.cs index 073e386de..797849efc 100644 --- a/Modules/RPC.cs +++ b/Modules/RPC.cs @@ -473,7 +473,7 @@ internal static class RPCHandlerPatch // Sync Settings foreach (OptionItem option in listOptions) { - try { option.SetValue(reader.ReadPackedInt32()); } + try { option.SetValue(reader.ReadPackedInt32(), false, false); } catch { } try