mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-21 05:37:36 +00:00
Integrate better role algorithm
This commit is contained in:
1 parent
1c9ffa7c13
commit
a537db207f
6 files changed
+8
-25
No files matched your search
@@ -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 "$(TargetDir)BetterAmongUs.dll" "C:\Program Files (x86)\Steam\steamapps\common\Among Us\Among Us - Mods\Among Us - BetterAmongUs\BepInEx\plugins"" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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, "", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user