mirror of
https://github.com/ApeMV/AmongUsRevamped.git
synced 2026-10-20 01:46:28 +00:00
Setting fallbacks, GitHub templates, GM fix
This commit is contained in:
1 parent
f18dc3fa31
commit
f4d9d8101f
10 files changed
+77
-32
No files matched your search
@@ -7,7 +7,8 @@ namespace AmongUsRevamped;
|
||||
|
||||
public static class OptionManager
|
||||
{
|
||||
private static OptionBackupData CachedOptions;
|
||||
private static float OldKillCooldown;
|
||||
|
||||
public static void SyncGameOptions()
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
@@ -29,17 +30,19 @@ public static class OptionManager
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
CachedOptions = new OptionBackupData(GameOptionsManager.Instance.CurrentGameOptions);
|
||||
OldKillCooldown = Main.NormalOptions.KillCooldown;
|
||||
}
|
||||
|
||||
public static void RestoreOptions()
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost || CachedOptions == null) return;
|
||||
|
||||
var restored = CachedOptions.Restore(GameOptionsManager.Instance.CurrentGameOptions);
|
||||
|
||||
GameOptionsManager.Instance.CurrentGameOptions = restored;
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
if (Main.NormalOptions.KillCooldown != OldKillCooldown)
|
||||
{
|
||||
Main.NormalOptions.KillCooldown = OldKillCooldown;
|
||||
Logger.Info("Force overrided Kill Cooldown back to original", "RestoreOptions");
|
||||
}
|
||||
|
||||
SyncGameOptions();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user