some fixes

This commit is contained in:
Gurge44 committed 2026-06-15 10:47:38 +02:00
1 parent 0d94760321
commit fe5096c701
15 files changed
+31 -31

No files matched your search

@@ -740,9 +740,6 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
case RoleTypes.Engineer:
AURoleOptions.EngineerCooldown *= 0.75f;
break;
case RoleTypes.GuardianAngel:
AURoleOptions.GuardianAngelCooldown *= 0.75f;
break;
case RoleTypes.Shapeshifter:
AURoleOptions.ShapeshifterCooldown *= 0.75f;
break;
+3 -1
View File
@@ -32,13 +32,15 @@ internal static class GhostRolesManager
IGhostRole instance = CreateGhostRoleInstance(suitableRole);
pc.RpcSetCustomRole(suitableRole);
pc.RpcSetRoleDesync(instance.RoleTypes, pc.OwnerId);
pc.AddAbilityCD(instance.Cooldown);
instance.OnAssign(pc);
Main.ResetCamPlayerList.Add(pc.PlayerId);
AssignedGhostRoles[pc.PlayerId] = (suitableRole, instance);
if (suitableRole == CustomRoles.Haunter)
GhostRoles.Remove(suitableRole);
if (instance.RoleTypes == RoleTypes.GuardianAngel)
pc.AddAbilityCD(instance.Cooldown);
NotifyAboutGhostRole(pc, true);
}
+3 -1
View File
@@ -162,7 +162,6 @@ internal static class ExitGamePatch
GameStates.InGame = false;
GameEndChecker.LoadingEndScreen = false;
Main.RealOptionsData?.Restore(GameOptionsManager.Instance.CurrentGameOptions);
DataFlagRateLimiter.DropQueue();
if (SetUpRoleTextPatch.IsInIntro)
@@ -170,6 +169,9 @@ internal static class ExitGamePatch
SetUpRoleTextPatch.IsInIntro = false;
Utils.NotifyRoles(ForceLoop: true);
}
if (GameSettingMenu.Instance)
GameSettingMenuPatch.Close_Prefix();
}
public static void Postfix(InnerNetClient __instance)
+1 -1
View File
@@ -156,7 +156,7 @@ public static class OnlinePresetsManager
GameSettingMenu.Instance.ChangeTab(tabIndex, Controller.currentTouchType == Controller.TouchType.Joystick);
ModGameOptionsMenu.TabIndex = tabIndex;
}, 0.4f);
});
}, showBackButton: false);
}));
TextMeshPro minusText = row.MinusBtn.GetComponentInChildren<TextMeshPro>();
minusText.DestroyTranslator();
+1 -1
View File
@@ -14,7 +14,7 @@ public static class Prompt
private static string CurrentQuestion = string.Empty;
private static bool ShowBackButton;
public static void Show(string question, Action onYes, Action onNo, bool showBackButton = false)
public static void Show(string question, Action onYes, Action onNo, bool showBackButton = true)
{
try
{
+3 -1
View File
@@ -71,7 +71,9 @@ public class SimpleButton
{
if (BaseButton || !passiveButton) return;
BaseButton = Object.Instantiate(passiveButton);
GameObject parent = new GameObject("BaseButton parent");
Object.DontDestroyOnLoad(parent);
BaseButton = Object.Instantiate(passiveButton, parent.transform);
var label = BaseButton.transform.Find("FontPlacer/Text_TMP").GetComponent<TextMeshPro>();
BaseButton.gameObject.SetActive(false);
+2 -3
View File
@@ -5076,8 +5076,7 @@ public static class Utils
Prompt.Show(
string.Format(GetString("Promt.EnableRole"), count, all, rotStr, role.ToColoredString(), infoLong),
(() => option.SetValue(1)) + increment,
(() => option.SetValue(0)) + increment,
showBackButton: true);
(() => option.SetValue(0)) + increment);
}
if (addons) return;
@@ -5249,4 +5248,4 @@ public enum MessageImportance
Low,
Medium,
High
}
}
+7 -11
View File
@@ -25,20 +25,9 @@ public static class ModGameOptionsMenu
public static readonly Dictionary<int, CategoryHeaderMasked> CategoryHeaderList = new();
public static readonly System.Collections.Generic.Dictionary<CustomRoles, Transform> HelpIconList = [];
public static readonly System.Collections.Generic.Dictionary<OptionItem, BaseGameSetting> BaseGameSettingCache = [];
public static readonly HashSet<GameObject> SpawnedUI = new();
public static T Track<T>(T obj) where T : Object
{
switch (obj)
{
case GameObject go:
SpawnedUI.Add(go);
break;
case Component c:
SpawnedUI.Add(c.gameObject);
break;
}
return obj;
}
@@ -1000,6 +989,7 @@ public static class GameSettingMenuPatch
public static readonly System.Collections.Generic.Dictionary<TabGroup, GameOptionsMenu> ModSettingsTabs = [];
public static long LastPresetChange;
public static bool ChangingPreset;
public static FreeChatInputField InputField;
private static System.Collections.Generic.List<OptionItem> HiddenBySearch = [];
@@ -1135,6 +1125,7 @@ public static class GameSettingMenuPatch
minus.OnClick.AddListener((Action)(() =>
{
ChangingPreset = true;
LastPresetChange = Utils.TimeStamp;
Options.Preset--;
Main.TabGroupValues.Do(GameOptionsMenuPatch.ReCreateSettings);
@@ -1142,6 +1133,8 @@ public static class GameSettingMenuPatch
GameOptionsMenuPatch.RefreshTabButtons();
presetTmp.SetText(Translator.GetString($"Preset_{OptionItem.CurrentPreset + 1}"));
Logger.Info($"Current preset: {OptionItem.CurrentPreset + 1}", "GameOptionsMenuPatch");
ChangingPreset = false;
NotificationPopperPatch.AddSettingsChangeMessage(Options.Preset, true);
}));
minus.activeTextColor = minus.inactiveTextColor = minus.disabledTextColor = minus.selectedTextColor = Color.white;
@@ -1181,6 +1174,7 @@ public static class GameSettingMenuPatch
plus.OnClick.AddListener((Action)(() =>
{
ChangingPreset = true;
LastPresetChange = Utils.TimeStamp;
Options.Preset++;
Main.TabGroupValues.Do(GameOptionsMenuPatch.ReCreateSettings);
@@ -1188,6 +1182,8 @@ public static class GameSettingMenuPatch
GameOptionsMenuPatch.RefreshTabButtons();
presetTmp.SetText(Translator.GetString($"Preset_{OptionItem.CurrentPreset + 1}"));
Logger.Info($"Current preset: {OptionItem.CurrentPreset + 1}", "GameOptionsMenuPatch");
ChangingPreset = false;
NotificationPopperPatch.AddSettingsChangeMessage(Options.Preset, true);
}));
plus.activeTextColor = plus.inactiveTextColor = plus.disabledTextColor = plus.selectedTextColor = Color.white;
+4
View File
@@ -1361,6 +1361,10 @@ internal static class MeetingHudOnDestroyPatch
}
if (Main.LIMap) Main.Instance.StartCoroutine(WaitForExileFinish());
GC.Collect();
Resources.UnloadUnusedAssets();
GC.Collect();
return;
IEnumerator WaitForExileFinish()
+1 -1
View File
@@ -22,7 +22,7 @@ internal static class NotificationPopperPatch
public static void AddSettingsChangeMessage(OptionItem option, bool playSound = false)
{
if (Utils.TimeStamp == GameSettingMenuPatch.LastPresetChange) return;
if (GameSettingMenuPatch.ChangingPreset) return;
string optValue = option.GetString();
if (optValue == "STRMISS") return;
+1
View File
@@ -347,6 +347,7 @@ internal static class ChangeRoleSettings
GC.Collect();
Resources.UnloadUnusedAssets();
GC.Collect();
}
catch (Exception ex)
{
+2 -1
View File
@@ -487,8 +487,9 @@ internal static class SetEverythingUpPatch
yield return null;
// Clear unused assets
GC.Collect();
Resources.UnloadUnusedAssets();
GC.Collect();
yield return null;
Vector3 pos = main.ViewportToWorldPoint(new(0f, 1f, main.nearClipPlane));
+2
View File
@@ -86,6 +86,8 @@ internal static class OnGameJoinedPatch
LateTask.New(() =>
{
JoiningGame = false;
Main.RealOptionsData?.Restore(GameOptionsManager.Instance.CurrentGameOptions);
Options.AutoSetFactionMinMaxSettings();
@@ -60,9 +60,6 @@ public class Vacuum : RoleBase
AURoleOptions.EngineerCooldown = AbilityCooldown.GetFloat();
AURoleOptions.EngineerInVentMaxTime = 1f;
try { AURoleOptions.GuardianAngelCooldown = 900f; }
catch { }
}
public override void OnEnterVent(PlayerControl pc, Vent vent)
@@ -99,7 +96,7 @@ public class Vacuum : RoleBase
{
if (instance.Timer == null) continue;
PlayerControl vacuum = instance.VacuumId.GetPlayer();
if (vacuum == null || !vacuum.IsAlive()) continue;
if (!vacuum || !vacuum.IsAlive()) continue;
target.TP(vacuum);
return false;
}
-3
View File
@@ -52,9 +52,6 @@ public class Astral : RoleBase
AURoleOptions.EngineerCooldown = AbilityCooldown.GetFloat();
AURoleOptions.EngineerInVentMaxTime = 1f;
try { AURoleOptions.GuardianAngelCooldown = 900f; }
catch { }
}
public override void OnEnterVent(PlayerControl pc, Vent vent)