From a2f707fe160710a89765ec4821a3e46104e5f99c Mon Sep 17 00:00:00 2001 From: js6pak Date: Thu, 18 Mar 2021 21:36:16 +0100 Subject: [PATCH] 2021.3.5 fixes --- Reactor/CustomStringName.cs | 25 +++++++++++++++++++++++++ Reactor/Extensions/MessageExtensions.cs | 4 ++-- build/Build.csproj | 2 +- build/Program.cs | 3 ++- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Reactor/CustomStringName.cs b/Reactor/CustomStringName.cs index 285b379..ba2adc9 100644 --- a/Reactor/CustomStringName.cs +++ b/Reactor/CustomStringName.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using System.Linq; +using System.Reflection; using HarmonyLib; +using Reactor.Extensions; using UnhollowerBaseLib; namespace Reactor @@ -50,5 +52,28 @@ namespace Reactor return true; } } + + // [HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), typeof(StringNames), typeof(string), typeof(Il2CppReferenceArray))] + [HarmonyPatch] + private static class GetStringOrDefaultPatch + { + public static IEnumerable TargetMethods() + { + return typeof(TranslationController).GetMethods(typeof(string), typeof(StringNames), typeof(string), typeof(Il2CppReferenceArray)); + } + + public static bool Prefix([HarmonyArgument(0)] StringNames stringId, [HarmonyArgument(2)] Il2CppReferenceArray parts, ref string __result) + { + var customStringName = (CustomStringName) stringId; + + if (customStringName != null) + { + __result = string.Format(customStringName.Value, parts); + return false; + } + + return true; + } + } } } diff --git a/Reactor/Extensions/MessageExtensions.cs b/Reactor/Extensions/MessageExtensions.cs index 1597522..163ac41 100644 --- a/Reactor/Extensions/MessageExtensions.cs +++ b/Reactor/Extensions/MessageExtensions.cs @@ -5,8 +5,8 @@ namespace Reactor.Extensions { public static class MessageExtensions { - private const float MIN = -40f; - private const float MAX = 40f; + private const float MIN = -50f; + private const float MAX = 50f; private static float ReverseLerp(float t) { diff --git a/build/Build.csproj b/build/Build.csproj index 5c3e294..78c3318 100644 --- a/build/Build.csproj +++ b/build/Build.csproj @@ -5,7 +5,7 @@ $(MSBuildProjectDirectory)/.. - + diff --git a/build/Program.cs b/build/Program.cs index 9a38dbc..102235f 100644 --- a/build/Program.cs +++ b/build/Program.cs @@ -38,6 +38,7 @@ public sealed class SetupAmongUsTask : AsyncFrostingTask { public const uint AppId = 945360; public const uint DepotId = 945361; + public const ulong ManifestId = 5200448423569257054; // 2021.3.5s public override async Task RunAsync(BuildContext context) { @@ -50,7 +51,7 @@ public sealed class SetupAmongUsTask : AsyncFrostingTask ContentDownloader.Config.InstallDirectory = context.AmongUsPath; context.Information("Downloading the game from steam"); - await ContentDownloader.DownloadAppAsync(AppId, DepotId); + await ContentDownloader.DownloadAppAsync(AppId, DepotId, ManifestId); ContentDownloader.ShutdownSteam3(); var bepinexZip = context.DownloadFile("https://github.com/NuclearPowered/BepInEx/releases/download/6.0.0-reactor.16/BepInEx-6.0.0-reactor.16.zip");