Skip to content

Commit

Permalink
Update to 3.5s
Browse files Browse the repository at this point in the history
  • Loading branch information
Hardel-DW committed Mar 10, 2021
1 parent dde230c commit 6aa0c00
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 21 deletions.
Binary file removed Libs/Essentials-2020.12.9s.dll
Binary file not shown.
Binary file added Libs/Essentials-2021.3.5s.dll
Binary file not shown.
29 changes: 21 additions & 8 deletions RolesMods/Patch/GameSettingsPatch.cs
Original file line number Diff line number Diff line change
@@ -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<HudManager>.Instance.GameSettings.scale = 0.425f;
}
}

[HarmonyPatch]
class GameOptionsMenuPatch {
static float defaultBounds = 0f;
Expand All @@ -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;

}
}
}
2 changes: 1 addition & 1 deletion RolesMods/Patch/VersionShowerPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
}
2 changes: 0 additions & 2 deletions RolesMods/ResourceLoader.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Reflection;
using Reactor.Extensions;
using Reactor.Unstrip;
using UnityEngine;

namespace RolesMods {
Expand All @@ -15,7 +14,6 @@ public static void LoadAssets() {

Overlay = assetBundle.LoadAsset<GameObject>("Overlay.prefab").DontDestroy();
OverlaySprite = assetBundle.LoadAsset<Sprite>("Overlay").DontDestroy();
assetBundle.Dispose();
}
}
}
3 changes: 2 additions & 1 deletion RolesMods/RolesMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
27 changes: 18 additions & 9 deletions RolesMods/RolesMods.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>1.0.0</Version>
<GameVersion>2020.12.9s</GameVersion>
<Mappings>NuclearPowered/Mappings:0.1.0-alpha.2</Mappings>
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>1.0.0</Version>
<Mappings>NuclearPowered/Mappings:0.2.0</Mappings>

<Description>ToManyRolesMods by Hardel</Description>
<Authors>js6pak</Authors>
</PropertyGroup>
<Description>Too many roles mods</Description>
<Authors>Hardel</Authors>
</PropertyGroup>

<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
<GameVersion>2021.3.5s</GameVersion>
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
<GameVersion>2021.3.5i</GameVersion>
<DefineConstants>$(DefineConstants);ITCH</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Deobfuscate Include="$(AmongUs)\BepInEx\plugins\Reactor-$(GameVersion).dll" />
Expand All @@ -16,7 +25,7 @@
<EmbeddedResource Include="Resources\Footprint.png"></EmbeddedResource>
<EmbeddedResource Include="Resources\Overlay.png"></EmbeddedResource>
<EmbeddedResource Include="Resources\psychic"></EmbeddedResource>
<PackageReference Include="Reactor.OxygenFilter.MSBuild" Version="0.2.3" />
<PackageReference Include="Reactor.OxygenFilter.MSBuild" Version="0.2.9" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 6aa0c00

Please sign in to comment.