mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
fix repeating options
This commit is contained in:
1 parent
c5c740d88d
commit
baae2393d7
2 files changed
+15
-1
No files matched your search
@@ -13,6 +13,8 @@ public static class OptionShower
|
||||
public static int CurrentPage;
|
||||
public static List<string> 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()
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user