Integrate better role algorithm

This commit is contained in:
D1GQ committed 2024-08-25 15:07:20 -05:00
1 parent 1c9ffa7c13
commit a537db207f
6 files changed
+8 -25

No files matched your search

+6
View File
@@ -25,4 +25,10 @@
<!-- Embed all files in the Resources folder -->
<EmbeddedResource Include="Resources\**\*" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\ModNews\BAU.v1.1.0.txt" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy &quot;$(TargetDir)BetterAmongUs.dll&quot; &quot;C:\Program Files (x86)\Steam\steamapps\common\Among Us\Among Us - Mods\Among Us - BetterAmongUs\BepInEx\plugins&quot;" />
</Target>
</Project>
-6
View File
@@ -10,7 +10,6 @@ public static class OptionsMenuBehaviourPatch
{
private static ClientOptionItem AntiCheat;
private static ClientOptionItem BetterHost;
private static ClientOptionItem BetterRoleAlgorithma;
private static ClientOptionItem BetterNotifications;
private static ClientOptionItem ChatInGameplay;
private static ClientOptionItem LobbyPlayerInfo;
@@ -63,11 +62,6 @@ public static class OptionsMenuBehaviourPatch
}
}
if (BetterRoleAlgorithma == null || BetterRoleAlgorithma.ToggleButton == null)
{
BetterRoleAlgorithma = ClientOptionItem.Create("<color=#4f92ff>Better Role Algorithma</color>", Main.BetterRoleAlgorithma, __instance, toggleCheck: () => !toggleCheckInGamePlay("<color=#4f92ff>Better Role Algorithma</color>"));
}
if (BetterNotifications == null || BetterNotifications.ToggleButton == null)
{
BetterNotifications = ClientOptionItem.Create("<color=#4f92ff>Better Notifications</color>", Main.BetterNotifications, __instance, BetterNotificationsToggle);
-5
View File
@@ -303,11 +303,6 @@ class CommandsPatch
case "role" or "setrole":
if (HandleIsHost(command) == true)
{
if (!Main.BetterRoleAlgorithma.Value)
{
Utils.AddChatPrivate($"<color=#730000>{error}\nBetter Role Algorithma in better options must be turned on to use this command");
return;
}
if (command[0][1..].ToLower().Trim() == "role")
{
var player = PlayerControl.LocalPlayer;
+2 -8
View File
@@ -69,14 +69,8 @@ static class GameSettingMenuPatch
else if (IsPreload || GameStates.IsHideNSeek)
{
new BetterOptionHeaderItem().Create(BetterSettingsTab, "<color=#d7d700>Hide & Seek Settings</color>");
if (IsPreload || Main.BetterRoleAlgorithma.Value)
{
new BetterOptionTitleItem().Create(BetterSettingsTab, $"<color=#4f92ff>Better Role Algorithma</color>");
BetterOptionItem.SpacingNum += 0.2f;
new BetterOptionTitleItem().Create(BetterSettingsTab, $"<color={Utils.GetRoleColor(RoleTypes.Impostor)}>Imposter</color>");
BetterGameSettings.HideAndSeekImpNum = new BetterOptionIntItem().Create(1000, BetterSettingsTab, "# Seekers", [1, 5, 1], 1, "", "");
}
new BetterOptionTitleItem().Create(BetterSettingsTab, $"<color={Utils.GetRoleColor(RoleTypes.Impostor)}>Imposter</color>");
BetterGameSettings.HideAndSeekImpNum = new BetterOptionIntItem().Create(1000, BetterSettingsTab, "# Seekers", [1, 5, 1], 1, "", "");
}
}
}
-4
View File
@@ -21,8 +21,6 @@ public class RoleManagerPatch
[HarmonyPrefix]
public static bool RoleManager_Prefix(/*RoleManager __instance*/)
{
if (!Main.BetterRoleAlgorithma.Value) return true;
if (!GameStates.IsHideNSeek)
{
RegularBetterRoleAssignment();
@@ -377,8 +375,6 @@ public class RoleManagerPatch
[HarmonyPrefix]
public static bool AssignRoleOnDeath_Prefix(/*RoleManager __instance*/ [HarmonyArgument(0)] PlayerControl player)
{
if (!Main.BetterRoleAlgorithma.Value) return true;
Dictionary<RoleTypes, int> GhostRoles = new() // Role, Amount
{
{ RoleTypes.GuardianAngel, 0 },
-2
View File
@@ -174,7 +174,6 @@ public class Main : BasePlugin
public static ConfigEntry<bool> AntiCheat { get; private set; }
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; }
@@ -186,7 +185,6 @@ public class Main : BasePlugin
{
AntiCheat = Config.Bind("Better Options", "AntiCheat", true);
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);