Compare commits

...
4 Commits
Author SHA1 Message Date
Ape 2ac4728f8a 1.4.0 2026-01-23 19:09:40 +01:00
Ape 88599a0680 ? ? ? ? ? ? ? ? ? ? 2026-01-23 18:44:07 +01:00
Ape 5ae6d648e3 ??????????????????????? 2026-01-23 17:39:24 +01:00
Ape 21dec84e64 I cast null reference exception 2026-01-23 00:41:37 +01:00
8 changed files with 66 additions and 50 deletions

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ public partial class Main : BasePlugin
public static NormalGameOptionsV10 NormalOptions => GameOptionsManager.Instance != null ? GameOptionsManager.Instance.currentNormalGameOptions : null;
public static bool HasArgumentException;
public static string CredentialsText;
public const string ModVersion = "v1.3.3";
public const string ModVersion = "v1.4.0";
public static float GameTimer;
+1 -1
View File
@@ -44,7 +44,7 @@ internal class Hotkeys
PlayerControl.LocalPlayer.Collider.enabled = !Ctrl;
}
if (Input.GetKeyDown(KeyCode.C) && GameStartManager.Instance.startState == GameStartManager.StartingStates.Countdown && !HudManager.Instance.Chat.IsOpenOrOpening && Utils.IsLobby)
if (Input.GetKeyDown(KeyCode.C) && GameStartManager.InstanceExists && GameStartManager.Instance != null && GameStartManager.Instance.startState == GameStartManager.StartingStates.Countdown && !HudManager.Instance.Chat.IsOpenOrOpening && Utils.IsLobby)
{
Logger.Info("Resetted start countdown", "KeyCommand");
GameStartManager.Instance.ResetStartState();
+13 -8
View File
@@ -14,6 +14,9 @@ internal static class ChatControllerUpdatePatch
public static void Postfix(ChatController __instance)
{
if (!__instance||!__instance.freeChatField||!__instance.freeChatField.textArea||!__instance.freeChatField.background||__instance.freeChatField.textArea.compoText == null||!__instance.freeChatField.textArea.outputText) return;
if (!__instance.quickChatField||!__instance.quickChatField.background||__instance.quickChatField.text==null) return;
if (Main.DarkTheme.Value)
{
__instance.freeChatField.background.color = new Color32(40, 40, 40, byte.MaxValue);
@@ -40,13 +43,15 @@ internal static class ChatBubbleSetNamePatch
{
public static void Postfix(ChatBubble __instance, [HarmonyArgument(2)] bool voted)
{
PlayerControl seer = PlayerControl.LocalPlayer;
if (!__instance||!__instance.playerInfo||!__instance.playerInfo.Object||!__instance.playerInfo.Object.Data||!__instance.TextArea||!__instance.Background) return;
PlayerControl target = __instance.playerInfo.Object;
if (Main.DarkTheme.Value)
{
__instance.Background.color = new(0.1f, 0.1f, 0.1f, 1f);
__instance.TextArea.color = Color.white;
if (__instance.playerInfo.Object.Data.IsDead && Utils.InGame) __instance.Background.color = new(0.1f, 0.1f, 0.1f, 0.7f);
}
}
@@ -55,14 +60,14 @@ internal static class ChatBubbleSetNamePatch
[HarmonyPatch(typeof(ChatController), nameof(ChatController.SendChat))]
internal static class SendChatPatch
{
public static string noKcdMode = "0 Kill Cooldown:\n\nImpostors have no kill cooldown, Crewmates have low tasks\nThink fast and pay attention!";
public static string SnSModeOne = "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nSabotages & Meetings = Off";
public static string SnSModeTwo = $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImp wins by killing\nOne wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n{Utils.BasicIntToWord(Options.MisfiresToSuicide.GetInt())} wrong kills = suicide";
public static string speedrunMode = $"Speedrun:\n\nEveryone is a crewmate The 1st player to finish tasks wins the game Game auto ends after {Options.GameAutoEndsAfter.GetInt()}s";
public static string noKcdMode => "0 Kill Cooldown:\n\nImpostors have no kill cooldown, Crewmates have low tasks\nThink fast and pay attention!";
public static string SnSModeOne => "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nSabotages & Meetings = Off";
public static string SnSModeTwo => $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImp wins by killing\nOne wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n{Utils.BasicIntToWord(Options.MisfiresToSuicide.GetInt())} wrong kills = suicide";
public static string speedrunMode => $"Speedrun:\n\nEveryone is a crewmate The 1st player to finish tasks wins the game Game auto ends after {Options.GameAutoEndsAfter.GetInt()}s";
public static string allCommandsFull = "Commands:\n/r - Current mode description\n/0kc, /sns, /sp - Specific mode description\n/l - Shows last winner info\n/kick, /ban - Bans or kicks a player by name\n/ckick, /cban - Bans or kicks a player by color";
public static string allCommandsOne = "Commands:\n/r - Current mode description\n/0kc, /sns, /sp - Specific mode description\n/l - Shows last winner info";
public static string allCommandsTwo = "/kick, /ban - Bans or kicks a player by name\n/ckick, /cban - Bans or kicks a player by color";
public static string allCommandsFull => "Commands:\n/r - Current mode description\n/0kc, /sns, /sp - Specific mode description\n/l - Shows last winner info\n/kick, /ban - Bans or kicks a player by name\n/ckick, /cban - Bans or kicks a player by color";
public static string allCommandsOne => "Commands:\n/r - Current mode description\n/0kc, /sns, /sp - Specific mode description\n/l - Shows last winner info";
public static string allCommandsTwo => "/kick, /ban - Bans or kicks a player by name\n/ckick, /cban - Bans or kicks a player by color";
public static bool Prefix(ChatController __instance)
{
+15 -28
View File
@@ -12,22 +12,18 @@ public static class GameStartManagerUpdatePatch
public static void Prefix(GameStartManager __instance)
{
if (!GameStartManager.InstanceExists || AmongUsClient.Instance == null || !AmongUsClient.Instance.AmHost) return;
if (__instance == null || MeetingHud.Instance != null) return;
if (AmongUsClient.Instance == null || !AmongUsClient.Instance.AmHost) return;
var data = GameData.Instance;
if (__instance.StartButton == null || __instance.GameStartText == null) return;
__instance.MinPlayers = 1;
if (Main.AutoStart.Value && OnGameJoinedPatch.AutoStartCheck && GameStartManager.InstanceExists && GameStartManager.Instance.startState != GameStartManager.StartingStates.Countdown && data != null && data.PlayerCount >= Options.PlayerAutoStart.GetInt())
if (Main.AutoStart.Value && OnGameJoinedPatch.AutoStartCheck && GameStartManager.InstanceExists && __instance.startState != GameStartManager.StartingStates.Countdown && GameData.Instance?.PlayerCount >= Options.PlayerAutoStart.GetInt())
{
GameStartManager.Instance.startState = GameStartManager.StartingStates.Countdown;
GameStartManager.Instance.countDownTimer = Options.AutoStartTimer.GetFloat();
var sb = GameStartManager.Instance?.StartButton;
if (sb != null)
{
sb.gameObject.SetActive(false);
}
__instance.startState = GameStartManager.StartingStates.Countdown;
__instance.countDownTimer = Options.AutoStartTimer.GetFloat();
__instance.StartButton.gameObject.SetActive(false);
Autostarting = true;
}
@@ -35,7 +31,6 @@ public static class GameStartManagerUpdatePatch
{
__instance.countDownTimer = Options.StartCountdown.GetInt();
CustomTimerApplied = true;
}
if (__instance.startState != GameStartManager.StartingStates.Countdown)
@@ -49,7 +44,7 @@ public static class GameStartManagerUpdatePatch
{
string warningMessage = "";
if (!AmongUsClient.Instance.AmHost) return;
if (!AmongUsClient.Instance.AmHost || __instance.GameStartText == null) return;
if (GameStartManagerStartPatch.warningText != null)
{
@@ -80,40 +75,32 @@ public static class GameStartManagerUpdatePatch
public class GameStartManagerStartPatch
{
public static TextMeshPro warningText;
private static Vector3 GameStartTextlocalPosition;
public static PassiveButton cancelButton;
public static void Postfix(GameStartManager __instance)
{
if (__instance == null || !Utils.IsLobby) return;
warningText = UnityEngine.Object.Instantiate(__instance.GameStartText, __instance.transform.parent);
warningText.name = "WarningText";
warningText.transform.localPosition = new(0f, __instance.transform.localPosition.y + 3f, -1f);
warningText.transform.localPosition = new Vector3(0f, __instance.transform.localPosition.y + 3f, -1f);
warningText.gameObject.SetActive(false);
cancelButton = UnityEngine.Object.Instantiate(__instance.StartButton, __instance.transform);
cancelButton.name = "CancelButton";
var cancelLabel = cancelButton.buttonText;
cancelLabel.DestroyTranslator();
cancelLabel.text = "Cancel";
//cancelButton.transform.localScale = new(0.5f, 0.5f, 1f);
var cancelButtonInactiveRenderer = cancelButton.inactiveSprites.GetComponent<SpriteRenderer>();
cancelButtonInactiveRenderer.color = new(0.8f, 0f, 0f, 1f);
var cancelButtonActiveRenderer = cancelButton.activeSprites.GetComponent<SpriteRenderer>();
cancelButtonActiveRenderer.color = Color.red;
var cancelButtonInactiveShine = cancelButton.inactiveSprites.transform.Find("Shine");
if (cancelButtonInactiveShine)
{
cancelButtonInactiveShine.gameObject.SetActive(false);
}
cancelButton.activeTextColor = cancelButton.inactiveTextColor = Color.white;
//cancelButton.transform.localPosition = new(2f, 0.13f, 0f);
GameStartTextlocalPosition = __instance.GameStartText.transform.localPosition;
cancelButton.gameObject.SetActive(false);
cancelButton.OnClick = new();
cancelButton.OnClick.AddListener((UnityEngine.Events.UnityAction)(() =>
{
__instance.ResetStartState();
}));
cancelButton.gameObject.SetActive(false);
}
}
+2
View File
@@ -14,6 +14,8 @@ internal static class OnGameJoinedPatch
public static bool AutoStartCheck;
public static void Postfix()
{
Logger.Info(" -------- JOINED GAME --------", "OnGameJoined");
if (!AmongUsClient.Instance.AmHost) return;
WaitingForChat = false;
+2 -2
View File
@@ -12,9 +12,9 @@ class ReportDeadBodyPatch
{
public static bool Prefix(PlayerControl __instance, [HarmonyArgument(0)] NetworkedPlayerInfo target)
{
if (!AmongUsClient.Instance.AmHost) return true;
if (!AmongUsClient.Instance.AmHost || target == null || __instance == null) return true;
if (Options.DisableReport.GetBool() && target != null || Options.Gamemode.GetValue() == 2 || Options.Gamemode.GetValue() == 3)
if (Options.DisableReport.GetBool() || Options.Gamemode.GetValue() == 2 || Options.Gamemode.GetValue() == 3)
{
Logger.Info($" Stopped {__instance.Data.PlayerName} reporting the body of {target.PlayerName}", "ReportDeadBodyPatch");
return false;
+1 -1
View File
@@ -21,7 +21,7 @@ internal static class AddVotePatch
Logger.Info($" Kicked {target.Data.PlayerName}, {target.Data.FriendCode}", "KickPatch");
}
return false;
return true;
}
}
+31 -9
View File
@@ -29,7 +29,7 @@
<img src="https://github.com/astra1dev/AUnlocker/assets/90265231/14226f03-a003-4efc-b27b-6df53fb394d6" width=410 height=240>****
‎
# 🎮 Features (v1.2.1):
# 🎮 Features (v1.4.0):
- <b>🔶 Client Side settings:</b>
- Game Master
- Unlock FPS
@@ -45,6 +45,7 @@
- Moderator system
- Banlist system
- Enable No Game End
- Custom starting countdown
- <b>🔶 Automation settings:</b>
- Auto start game and conditions for it
- Auto rejoin lobby
@@ -53,30 +54,51 @@
- Disable critical sabotages
- Disable door sabotages
- Disable body reporting
- Enable/Disable any desired tasks
- Enable/Disable any task
- All players have same tasks
- Hide and Seek: Custom Impostor count
- <b>🔶 Custom Gamemodes:</b>
- 0 Kill Cooldown
- Shift and Seek
- Speedrun
- <b>🔷 Extra features:</b>
- Shift + L + Enter - Force End Game
- Shift + M + Enter - Force Call/Close Meeting
- /help command
- Specific gamemode info commands -> /0kc, /sns, /sp
- Current gamemode info command -> /r
- <b>🔷 Other:</b>
- Ability to cancel starting countdown
- Improved main menu
- Custom anticheat system
- Zoom out in lobby or when dead
- Unlimited default Option ranges
- Logging for useful information
- <b>🎉 And this all without Modded Protocol!</b>
### Hotkeys
| HotKey | Function | Usable Scene |
| ------------------- | ------------------------------------------- | ---------------------------------- |
| `Shift`+`L`+`Enter` | Force End Game | In Game |
| `Shift`+`M`+`Enter` | Skip meeting or call meeting | In Game |
| `C` | Cancel game start | In Countdown |
| `Shift` | Start the game immediately | In Countdown |
| `Ctrl` | Noclip in lobby | In Lobby |
### Chat Commands
| Command | Function |
| ------------------------------------------- | ------------------------------------------------- |
| /h<br>/help | Show command help |
| /l<br>/win | Show winner |
| /r | Show current gamemode/roles description |
| /0kc<br>/sns</br>/sp | Show respective gamemode description |
| /ban <name> | Ban a player by name |
| /kick <name> | Kick a player by name |
| /cban <color> | Ban a player by color |
| /ckick <color> | Kick a player by color |
| /dump | Copy your LogOutput file |
| /color <color> | Set color |
‎
**Credit to these mods and their developers for their code:**
### :star: [AUnlocker](https://github.com/astra1dev/AUnlocker)
> - NumberOptionsPatch
### :star: [EHR (Formerly TOHE+)](https://github.com/Gurge44/EndlessHostRoles)
> - Dark Theme
> - Task Patching
### :star: [TOH](https://github.com/tukasa0001/TownOfHost) :
> - Ban Manager