few fixes

This commit is contained in:
Gurge44 committed 2026-10-09 09:11:27 +02:00
1 parent ed6ebed013
commit bedb16d1a1
7 files changed
+42 -16

No files matched your search

+10 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using AmongUs.GameOptions;
using EHR.Modules;
@@ -510,6 +511,8 @@ public static class Deathrace
public static class FixedUpdatePatch
{
private static Stopwatch NotifyTimer = new();
public static void Postfix()
{
if (!AmongUsClient.Instance.AmHost || !GameGoing || GameStates.IsEnded) return;
@@ -612,6 +615,12 @@ public static class Deathrace
}
Data.Remove(removeId);
if (NotifyTimer.Elapsed.TotalSeconds >= 1)
{
NotifyTimer.Reset();
Utils.NotifyRoles();
}
}
private static void CheckAndNotify(PlayerData data)
@@ -620,7 +629,7 @@ public static class Deathrace
if (data.LastSuffix != suffix)
{
Utils.NotifyRoles(SpecifySeer: data.Player, SpecifyTarget: data.Player);
NotifyTimer.Start();
data.LastSuffix = suffix;
}
}
+2 -2
View File
@@ -53,8 +53,8 @@ public class Main : BaseUnityPlugin
private const string DebugKeyHash = "c0fd562955ba56af3ae20d7ec9e64c664f0facecef4b3e366e109306adeae29d";
private const string DebugKeySalt = "59687b";
public const string PluginGuid = "com.gurge44.endlesshostroles";
public const string PluginVersion = "8.0.2";
public const string PluginDisplayVersion = "8.0.2";
public const string PluginVersion = "8.0.3";
public const string PluginDisplayVersion = "8.0.3";
public const int TestBuildNumber = 0; // 0 = Release
public const string NeutralColor = "#ffab1b";
+8 -1
View File
@@ -1,5 +1,7 @@
using System;
#if !IL2CPP
using System.Collections;
#endif
using System.Collections.Generic;
using System.Linq;
using AmongUs.Data;
@@ -15,9 +17,11 @@ namespace EHR;
[HarmonyPatch(typeof(ChatController), nameof(ChatController.Awake))]
static class ChatControllerAwakePatch
{
#if !IL2CPP
private static SpriteRenderer QuickChatIcon;
private static SpriteRenderer OpenBanMenuIcon;
private static SpriteRenderer OpenKeyboardIcon;
#endif
public static readonly Color32 DarkBackgroundColor = new(40, 40, 40, byte.MaxValue);
@@ -36,6 +40,7 @@ static class ChatControllerAwakePatch
chatBubble.TextArea.color = Color.white;
chatBubble.Background.color = new(0.1f, 0.1f, 0.1f, 1f);
#if !IL2CPP
__instance.freeChatField.background.color = DarkBackgroundColor;
if (!TextBoxPatch.IsInvalidCommand)
@@ -48,10 +53,11 @@ static class ChatControllerAwakePatch
__instance.quickChatField.text.color = Color.white;
Main.Instance.StartCoroutine(Coroutine());
#endif
}
else
__instance.freeChatField.textArea.outputText.color = Color.black;
#if !IL2CPP
return;
IEnumerator Coroutine()
@@ -81,6 +87,7 @@ static class ChatControllerAwakePatch
yield return null;
}
}
#endif
}
}
+2 -5
View File
@@ -959,7 +959,9 @@ internal static class MapRoomDoorsStartPatch
}
}
}
#if !IL2CPP
[HarmonyPatch(typeof(MapRoom), nameof(MapRoom.DoorsUpdate))]
#endif
internal static class MapRoomDoorsUpdatePatch
{
public static Dictionary<SystemTypes, TextMeshPro> DoorTimerTexts = [];
@@ -1002,10 +1004,6 @@ internal static class MapRoomDoorsUpdatePatch
goto Skip;
}
foreach (OpenableDoor door in shipStatusInstance.AllDoors)
{
if (door.Room != room) continue;
if (AutoOpenDoors.TryGetValue(room, out AutoOpenDoor autoOpenDoor) && autoOpenDoor)
{
total = 30f;
@@ -1013,7 +1011,6 @@ internal static class MapRoomDoorsUpdatePatch
goto Skip;
}
}
}
total = 0f;
timer = 0f;
+1
View File
@@ -1384,6 +1384,7 @@ internal static class MeetingHudOnDestroyPatch
try
{
if (CheckForEndVotingPatch.CommsWasCalled || Utils.IsAnySabotageActive())
foreach (PlayerControl pc in Main.CachedAlivePlayerControls())
if (pc.Is(CustomRoles.Evader))
pc.RpcMakeInvisible();
+13 -6
View File
@@ -58,9 +58,7 @@ public static class TextBoxPatch
{
Destroy();
IsInvalidCommand = false;
Color textColor = Main.DarkTheme.Value ? Color.white : Color.black;
__instance.compoText.Color(textColor);
__instance.outputText.color = textColor;
ResetTextColor(__instance);
return;
}
@@ -126,9 +124,7 @@ public static class TextBoxPatch
if (IsInvalidCommand)
{
IsInvalidCommand = false;
Color textColor = Main.DarkTheme.Value ? Color.white : Color.black;
__instance.compoText.Color(textColor);
__instance.outputText.color = textColor;
ResetTextColor(__instance);
}
HudManager hud = HudManager.Instance;
@@ -300,6 +296,17 @@ public static class TextBoxPatch
}
}
private static void ResetTextColor(TextBoxTMP __instance)
{
#if IL2CPP
Color textColor = Color.black;
#else
Color textColor = Main.DarkTheme.Value ? Color.white : Color.black;
#endif
__instance.compoText.Color(textColor);
__instance.outputText.color = textColor;
}
public static void OnTabPress(ChatController __instance)
{
if (!PlaceHolderText || PlaceHolderText.text == "") return;
+6 -1
View File
@@ -36,6 +36,11 @@ public class Hypocrite : RoleBase
HypocritePC = playerId.GetPlayer();
}
public override bool CanUseKillButton(PlayerControl pc)
{
return false;
}
public override void OnTaskComplete(PlayerControl pc, int completedTaskCount, int totalTaskCount)
{
if (!pc.IsAlive()) return;
@@ -63,7 +68,7 @@ public class Hypocrite : RoleBase
public override string GetSuffix(PlayerControl seer, PlayerControl target, bool hud = false, bool meeting = false)
{
if (seer.PlayerId != target.PlayerId || hud || seer.Is(Team.Impostor) || meeting || HypocritePC == null || !HypocritePC.IsAlive() || !seer.IsAlive()) return string.Empty;
if (seer.PlayerId != target.PlayerId || hud || seer.Is(Team.Impostor) || meeting || !HypocritePC || !HypocritePC.IsAlive() || !seer.IsAlive()) return string.Empty;
TaskState ts = HypocritePC.GetTaskState();
if (!NonImpGetsNotifyWhenLowTasks.GetBool() || ts.RemainingTasksCount > NotifyAtXTasksLeft.GetInt()) return string.Empty;