add Disable_ServerDropDown and Disable_DiscordRP

This commit is contained in:
D1GQ committed 2026-01-30 00:21:32 -06:00
1 parent 05737db862
commit b07779189f
3 files changed
+20 -5

No files matched your search

@@ -37,6 +37,16 @@ public static class BAUModdedSupportFlags
/// </summary>
public static string Disable_CustomModStamp = "client.disable.custommodstamp";
/// <summary>
/// Flag to disable custom ServerDropDown. When set by another mod, BetterAmongUs will disable its custom ServerDropDown.
/// </summary>
public static string Disable_ServerDropDown = "client.disable.serverdropdown";
/// <summary>
/// Flag to disable custom DiscordRP. When set by another mod, BetterAmongUs will disable its custom DiscordRP for BAU.
/// </summary>
public static string Disable_DiscordRP = "client.disable.discordrp";
// ============================================
// Anti-Cheat Features
// ============================================
@@ -1,5 +1,6 @@
using AmongUs.Data;
using BetterAmongUs.Modules;
using BetterAmongUs.Modules.Support;
using Discord;
using HarmonyLib;
@@ -15,6 +16,7 @@ internal static class DiscordPatch
[HarmonyPrefix]
private static void ActivityManager_UpdateActivity_Prefix(Activity activity)
{
if (BAUModdedSupportFlags.HasFlag(BAUModdedSupportFlags.Disable_DiscordRP)) return;
if (activity == null) return;
string details = $"BAU {BAUPlugin.GetVersionText()}";
@@ -1,4 +1,5 @@
using HarmonyLib;
using BetterAmongUs.Modules.Support;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -8,11 +9,12 @@ namespace BetterAmongUs.Patches.Gameplay.UI;
[HarmonyPatch]
internal static class ServerDropdownPatch
{
[HarmonyPatch(typeof(FindAGameManager))]
[HarmonyPatch(nameof(FindAGameManager.Start))]
[HarmonyPatch(typeof(FindAGameManager), nameof(FindAGameManager.Start))]
[HarmonyPrefix]
private static void FindAGameManager_Start_Prefix(FindAGameManager __instance)
{
if (BAUModdedSupportFlags.HasFlag(BAUModdedSupportFlags.Disable_ServerDropDown)) return;
var aspectPosition = __instance.serverDropdown.transform.parent.GetComponent<AspectPosition>();
if (aspectPosition != null)
{
@@ -25,11 +27,12 @@ internal static class ServerDropdownPatch
__instance.modeText.transform.localPosition -= new Vector3(0.4f, 0f, 0f);
}
[HarmonyPatch(typeof(ServerDropdown))]
[HarmonyPatch(nameof(ServerDropdown.FillServerOptions))]
[HarmonyPatch(typeof(ServerDropdown), nameof(ServerDropdown.FillServerOptions))]
[HarmonyPrefix]
private static bool ServerDropdown_FillServerOptions_Prefix(ServerDropdown __instance)
{
if (BAUModdedSupportFlags.HasFlag(BAUModdedSupportFlags.Disable_ServerDropDown)) return true;
__instance.background.size = new Vector2(5, 1);
int num = 0;