Merge pull request #49 from D1GQ/dev

v1.3.0 hotfix 3
This commit is contained in:
D1GQ authored and GitHub committed 2025-10-28 18:50:03 -05:00
commit 31292201e8
4 files changed
+11 -18

No files matched your search

+1 -2
View File
@@ -155,7 +155,6 @@ internal static class Utils
} }
SoundManager.Instance.PlaySound(chat.messageSound, false, 1f, null).pitch = 0.5f + data.PlayerId / 15f; SoundManager.Instance.PlaySound(chat.messageSound, false, 1f, null).pitch = 0.5f + data.PlayerId / 15f;
ChatPatch.ChatControllerPatch.SetChatPoolTheme(pooledBubble);
} }
catch catch
{ {
@@ -370,7 +369,7 @@ internal static class Utils
// Platform utilities // Platform utilities
internal static string GetPlatformName(PlayerControl player, bool useTag = false) internal static string GetPlatformName(PlayerControl player, bool useTag = false)
{ {
if (player?.GetClient() == null) return string.Empty; if (player?.GetClient()?.PlatformData == null) return string.Empty;
return GetPlatformName(player.GetClient().PlatformData.Platform, useTag); return GetPlatformName(player.GetClient().PlatformData.Platform, useTag);
} }
+1 -1
View File
@@ -4,7 +4,7 @@ internal static class ModInfo
{ {
internal static readonly ReleaseTypes ReleaseBuildType = ReleaseTypes.Release; internal static readonly ReleaseTypes ReleaseBuildType = ReleaseTypes.Release;
internal const string BetaNum = "0"; internal const string BetaNum = "0";
internal const string HotfixNum = "2"; internal const string HotfixNum = "3";
internal const bool IsHotFix = true; internal const bool IsHotFix = true;
internal const string PluginName = "BetterAmongUs"; internal const string PluginName = "BetterAmongUs";
internal const string PluginGuid = "com.d1gq.betteramongus"; internal const string PluginGuid = "com.d1gq.betteramongus";
+1 -1
View File
@@ -183,7 +183,7 @@ internal class PlayerInfoDisplay : MonoBehaviour
string newText = Utils.FormatInfo(sb); string newText = Utils.FormatInfo(sb);
if (newText != lastValue) if (newText != lastValue)
{ {
textMesh.SetText(newText); textMesh?.SetText(newText);
lastValue = newText; lastValue = newText;
} }
} }
+8 -14
View File
@@ -124,8 +124,10 @@ internal static class ChatPatch
[HarmonyPatch(nameof(ChatController.SetChatBubbleName))] [HarmonyPatch(nameof(ChatController.SetChatBubbleName))]
[HarmonyPostfix] [HarmonyPostfix]
private static void SetChatBubbleName_Postfix(ChatController __instance, ChatBubble bubble, NetworkedPlayerInfo playerInfo) private static void SetChatBubbleName_Postfix(ChatController __instance, ChatBubble bubble, NetworkedPlayerInfo playerInfo, bool isDead, bool didVote)
{ {
if (didVote) return;
StringBuilder sbTag = new(); StringBuilder sbTag = new();
StringBuilder sbInfo = new(); StringBuilder sbInfo = new();
@@ -196,21 +198,13 @@ internal static class ChatPatch
} }
bubble.NameText.SetText(playerName); bubble.NameText.SetText(playerName);
SetChatPoolTheme(bubble);
} }
[HarmonyPatch(nameof(ChatController.AddChatNote))] [HarmonyPatch(nameof(ChatController.GetPooledBubble))]
[HarmonyPostfix] [HarmonyPostfix]
private static void AddChatNote_Postfix(ChatController __instance) private static void GetPooledBubble_Postfix(ChatController __instance, ChatBubble __result)
{ {
SetChatPoolTheme(); SetChatPoolTheme(__result);
}
[HarmonyPatch(nameof(ChatController.AddChatWarning))]
[HarmonyPostfix]
private static void AddChatWarning_Postfix(ChatController __instance)
{
SetChatPoolTheme();
} }
internal static void SetChatTheme() internal static void SetChatTheme()
@@ -245,9 +239,9 @@ internal static class ChatPatch
} }
// Set chat theme // Set chat theme
internal static ChatBubble SetChatPoolTheme(ChatBubble? asChatBubble = null) internal static ChatBubble SetChatPoolTheme(ChatBubble asChatBubble)
{ {
ChatBubble chatBubble = asChatBubble ?? HudManager.Instance.Chat.GetPooledBubble(); ChatBubble chatBubble = asChatBubble;
if (BAUPlugin.ChatDarkMode.Value) if (BAUPlugin.ChatDarkMode.Value)
{ {