mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
some fixes
This commit is contained in:
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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -1361,6 +1361,10 @@ internal static class MeetingHudOnDestroyPatch
|
||||
}
|
||||
|
||||
if (Main.LIMap) Main.Instance.StartCoroutine(WaitForExileFinish());
|
||||
|
||||
GC.Collect();
|
||||
Resources.UnloadUnusedAssets();
|
||||
GC.Collect();
|
||||
return;
|
||||
|
||||
IEnumerator WaitForExileFinish()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -347,6 +347,7 @@ internal static class ChangeRoleSettings
|
||||
|
||||
GC.Collect();
|
||||
Resources.UnloadUnusedAssets();
|
||||
GC.Collect();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user