Chat In Gameplay Setting

This commit is contained in:
D1GQ committed 2024-08-24 06:22:35 -05:00
1 parent a04cf9daa0
commit 8eefea993a
3 files changed
+31 -2

No files matched your search

+6
View File
@@ -13,6 +13,7 @@ public static class OptionsMenuBehaviourPatch
private static ClientOptionItem BetterHost;
private static ClientOptionItem BetterRoleAlgorithma;
private static ClientOptionItem BetterNotifications;
private static ClientOptionItem ChatInGameplay;
private static ClientOptionItem LobbyPlayerInfo;
private static ClientOptionItem DisableLobbyTheme;
private static ClientOptionItem UnlockFPS;
@@ -79,6 +80,11 @@ public static class OptionsMenuBehaviourPatch
BetterNotificationManager.Notifying = false;
}
}
if (ChatInGameplay == null || ChatInGameplay.ToggleButton == null)
{
ChatInGameplay = ClientOptionItem.Create("Chat In Gameplay", Main.ChatInGameplay, __instance);
}
if (LobbyPlayerInfo == null || LobbyPlayerInfo.ToggleButton == null)
{
+23 -2
View File
@@ -53,8 +53,29 @@ public class HudManagerPatch
if (gameStart != null)
gameStart.transform.SetLocalY(-2.8f);
if (GameStates.InGame && __instance?.Chat?.gameObject.active != true)
__instance.Chat.gameObject.SetActive(true);
// Set chat
if (GameStates.InGame)
{
if (!Main.ChatInGameplay.Value)
{
if (!PlayerControl.LocalPlayer.IsAlive())
{
__instance.Chat.gameObject.SetActive(true);
}
else if (GameStates.IsInGamePlay && !(GameStates.IsMeeting || GameStates.IsExilling))
{
__instance.Chat.gameObject.SetActive(false);
}
}
else
{
if (__instance?.Chat?.gameObject.active == false)
{
__instance.Chat.gameObject.SetActive(true);
}
}
}
}
catch { }
}
+2
View File
@@ -176,6 +176,7 @@ public class Main : BasePlugin
public static ConfigEntry<bool> BetterHost { get; private set; }
public static ConfigEntry<bool> BetterRoleAlgorithma { get; private set; }
public static ConfigEntry<bool> BetterNotifications { get; private set; }
public static ConfigEntry<bool> ChatInGameplay { get; private set; }
public static ConfigEntry<bool> LobbyPlayerInfo { get; private set; }
public static ConfigEntry<bool> DisableLobbyTheme { get; private set; }
public static ConfigEntry<bool> UnlockFPS { get; private set; }
@@ -187,6 +188,7 @@ public class Main : BasePlugin
BetterHost = Config.Bind("Better Options", "BetterHost", false);
BetterRoleAlgorithma = Config.Bind("Better Options", "BetterRoleAlgorithma", true);
BetterNotifications = Config.Bind("Better Options", "BetterNotifications", true);
ChatInGameplay = Config.Bind("Better Options", "ChatInGameplay", true);
LobbyPlayerInfo = Config.Bind("Better Options", "LobbyPlayerInfo", true);
DisableLobbyTheme = Config.Bind("Better Options", "DisableLobbyTheme", true);
UnlockFPS = Config.Bind("Better Options", "UnlockFPS", false);