diff --git a/Libs/Essentials-2020.12.9s.dll b/Libs/Essentials-2020.12.9s.dll deleted file mode 100644 index bcf0885..0000000 Binary files a/Libs/Essentials-2020.12.9s.dll and /dev/null differ diff --git a/Libs/Essentials-2021.3.5s.dll b/Libs/Essentials-2021.3.5s.dll new file mode 100644 index 0000000..ea51406 Binary files /dev/null and b/Libs/Essentials-2021.3.5s.dll differ diff --git a/RolesMods/Patch/GameSettingsPatch.cs b/RolesMods/Patch/GameSettingsPatch.cs index 46a33e4..1416720 100644 --- a/RolesMods/Patch/GameSettingsPatch.cs +++ b/RolesMods/Patch/GameSettingsPatch.cs @@ -1,14 +1,7 @@ using HarmonyLib; +using UnityEngine; namespace RolesMods.Patch { - - [HarmonyPatch(typeof(GameOptionsData), nameof(GameOptionsData.Method_24))] - class GameSettingsPatch { - static void Postfix(ref string __result) { - DestroyableSingleton.Instance.GameSettings.scale = 0.425f; - } - } - [HarmonyPatch] class GameOptionsMenuPatch { static float defaultBounds = 0f; @@ -27,4 +20,24 @@ static void Postfix(ref GameOptionsMenu __instance) { } } } + + [HarmonyPatch(typeof(HudManager), nameof(HudManager.Update))] + public static class HudGameOptionsPatch { + public const float increment = 0.2f; + public static FloatRange scrollBounds = new FloatRange(2.9f, 7.2f); + + public static void Postfix(HudManager __instance) { + if (PlayerControl.LocalPlayer == null || !PlayerControl.LocalPlayer.CanMove) + return; + + var pos = __instance.GameSettings.transform.localPosition; + if (Input.mouseScrollDelta.y > 0F) + pos = new Vector3(pos.x, Mathf.Clamp(pos.y - increment, scrollBounds.min, scrollBounds.max), pos.z); + else if (Input.mouseScrollDelta.y < 0f) + pos = new Vector3(pos.x, Mathf.Clamp(pos.y + increment, scrollBounds.min, scrollBounds.max), pos.z); + + __instance.GameSettings.transform.localPosition = pos; + + } + } } diff --git a/RolesMods/Patch/VersionShowerPatch.cs b/RolesMods/Patch/VersionShowerPatch.cs index d92c91a..fd4a9fc 100644 --- a/RolesMods/Patch/VersionShowerPatch.cs +++ b/RolesMods/Patch/VersionShowerPatch.cs @@ -5,7 +5,7 @@ namespace RolesMods.Patch { [HarmonyPatch(typeof(VersionShower), nameof(VersionShower.Start))] public static class VersionShowerPatch { public static void Postfix(VersionShower __instance) { - __instance.text.Text += " + [2EADFFFF]RolesMods[] by Hardel"; + Reactor.Patches.ReactorVersionShower.Text.Text += "\n[2EADFFFF]Too Many Roles[] by Hardel"; } } } \ No newline at end of file diff --git a/RolesMods/ResourceLoader.cs b/RolesMods/ResourceLoader.cs index 29c4f70..b1e9786 100644 --- a/RolesMods/ResourceLoader.cs +++ b/RolesMods/ResourceLoader.cs @@ -1,6 +1,5 @@ using System.Reflection; using Reactor.Extensions; -using Reactor.Unstrip; using UnityEngine; namespace RolesMods { @@ -15,7 +14,6 @@ public static void LoadAssets() { Overlay = assetBundle.LoadAsset("Overlay.prefab").DontDestroy(); OverlaySprite = assetBundle.LoadAsset("Overlay").DontDestroy(); - assetBundle.Dispose(); } } } diff --git a/RolesMods/RolesMods.cs b/RolesMods/RolesMods.cs index 7534a43..deafcf4 100644 --- a/RolesMods/RolesMods.cs +++ b/RolesMods/RolesMods.cs @@ -2,10 +2,11 @@ using BepInEx.IL2CPP; using HarmonyLib; using Reactor; -using Essentials.CustomOptions; using BepInEx.Logging; +using Essentials.Options; namespace RolesMods { + [BepInPlugin(Id)] [BepInProcess("Among Us.exe")] [BepInDependency(ReactorPlugin.Id)] diff --git a/RolesMods/RolesMods.csproj b/RolesMods/RolesMods.csproj index 72c91b3..d2e77ef 100644 --- a/RolesMods/RolesMods.csproj +++ b/RolesMods/RolesMods.csproj @@ -1,13 +1,22 @@  - - netstandard2.1 - 1.0.0 - 2020.12.9s - NuclearPowered/Mappings:0.1.0-alpha.2 + + netstandard2.1 + 1.0.0 + NuclearPowered/Mappings:0.2.0 - ToManyRolesMods by Hardel - js6pak - + Too many roles mods + Hardel + + + + 2021.3.5s + $(DefineConstants);STEAM + + + + 2021.3.5i + $(DefineConstants);ITCH + @@ -16,7 +25,7 @@ - +