mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Replace DestroyableSingleton with direct access
This commit is contained in:
1 parent
1c0f8f93d9
commit
026bd1e05b
30 files changed
+123
-144
No files matched your search
@@ -63,7 +63,7 @@ public static class TextBoxPatch
|
||||
}
|
||||
}
|
||||
|
||||
if (!__instance.tempTxt.ToString().Equals(FastDestroyableSingleton<TranslationController>.Instance.GetString(StringNames.EnterName), StringComparison.OrdinalIgnoreCase) && __instance.characterLimit > 0)
|
||||
if (!__instance.tempTxt.ToString().Equals(TranslationController.Instance.GetString(StringNames.EnterName), StringComparison.OrdinalIgnoreCase) && __instance.characterLimit > 0)
|
||||
{
|
||||
int length = __instance.tempTxt.Length;
|
||||
__instance.tempTxt.Length = Math.Min(__instance.tempTxt.Length, __instance.characterLimit);
|
||||
@@ -185,7 +185,7 @@ public static class TextBoxPatch
|
||||
}
|
||||
|
||||
IsInvalidCommand = false;
|
||||
HudManager hud = FastDestroyableSingleton<HudManager>.Instance;
|
||||
HudManager hud = HudManager.Instance;
|
||||
|
||||
if (PlaceHolderText == null)
|
||||
{
|
||||
@@ -341,7 +341,7 @@ public static class TextBoxPatch
|
||||
|
||||
if (AdditionalInfoText != null)
|
||||
{
|
||||
bool showLobbyCode = FastDestroyableSingleton<HudManager>.Instance?.Chat?.IsOpenOrOpening == true && GameStates.IsLobby && Options.GetSuffixMode() == SuffixModes.Streaming && !Options.HideGameSettings.GetBool() && !DataManager.Settings.Gameplay.StreamerMode;
|
||||
bool showLobbyCode = HudManager.Instance?.Chat?.IsOpenOrOpening == true && GameStates.IsLobby && Options.GetSuffixMode() == SuffixModes.Streaming && !Options.HideGameSettings.GetBool() && !DataManager.Settings.Gameplay.StreamerMode;
|
||||
AdditionalInfoText.enabled = showLobbyCode;
|
||||
if (showLobbyCode) AdditionalInfoText.text = $"\n\n{Translator.GetString("LobbyCode")}:\n<size=250%><b>{GameCode.IntToGameName(AmongUsClient.Instance.GameId)}</b></size>";
|
||||
}
|
||||
@@ -363,7 +363,7 @@ public static class TextBoxPatch
|
||||
{
|
||||
try
|
||||
{
|
||||
bool open = HudManager.InstanceExists && (FastDestroyableSingleton<HudManager>.Instance?.Chat?.IsOpenOrOpening ?? false);
|
||||
bool open = HudManager.InstanceExists && (HudManager.Instance?.Chat?.IsOpenOrOpening ?? false);
|
||||
PlaceHolderText?.gameObject.SetActive(open);
|
||||
CommandInfoText?.gameObject.SetActive(open);
|
||||
AdditionalInfoText?.gameObject.SetActive(open);
|
||||
|
||||
Reference in new issue
Block a user