From 4047f86b24f2618368c549eb901732c30e10478d Mon Sep 17 00:00:00 2001 From: chomp Date: Sat, 28 Oct 2023 09:30:21 +0000 Subject: [PATCH] Update references for 26835 (!36) Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Modules/pulls/36 --- project/Aki.Core/Patches/TransportPrefixPatch.cs | 5 +++-- project/Aki.Custom/Patches/ExitWhileLootingPatch.cs | 2 +- project/Aki.Custom/Patches/RagfairFeePatch.cs | 10 +++++----- project/Aki.Debugging/Patches/EndRaidDebug.cs | 6 +++--- project/Aki.PrePatch/AkiBotsPrePatcher.cs | 4 ++-- .../Patches/RaidFix/GetNewBotTemplatesPatch.cs | 2 +- .../Patches/RaidFix/PostRaidHealingPricePatch.cs | 2 +- .../Patches/RaidFix/RemoveUsedBotProfilePatch.cs | 2 +- .../Patches/ScavMode/LoadOfflineRaidScreenPatch.cs | 6 +++--- 9 files changed, 20 insertions(+), 19 deletions(-) diff --git a/project/Aki.Core/Patches/TransportPrefixPatch.cs b/project/Aki.Core/Patches/TransportPrefixPatch.cs index 208b0c6..682182e 100644 --- a/project/Aki.Core/Patches/TransportPrefixPatch.cs +++ b/project/Aki.Core/Patches/TransportPrefixPatch.cs @@ -15,8 +15,9 @@ namespace Aki.Core.Patches { try { - _ = GClass239.DEBUG_LOGIC; // UPDATE BELOW LINE TOO - var type = PatchConstants.EftTypes.Single(t => t.Name == "Class239"); + // NOTE: This doesn't actually check the below, GClass vs Class + _ = GClass259.DEBUG_LOGIC; // UPDATE BELOW LINE TOO + var type = PatchConstants.EftTypes.Single(t => t.Name == "Class259"); if (type == null) { diff --git a/project/Aki.Custom/Patches/ExitWhileLootingPatch.cs b/project/Aki.Custom/Patches/ExitWhileLootingPatch.cs index b960590..bd7ba2f 100644 --- a/project/Aki.Custom/Patches/ExitWhileLootingPatch.cs +++ b/project/Aki.Custom/Patches/ExitWhileLootingPatch.cs @@ -33,7 +33,7 @@ namespace Aki.Custom.Patches var player = Singleton.Instance.MainPlayer; if (profileId == player?.Profile.Id) { - GClass2898.Instance.CloseAllScreensForced(); + GClass2949.Instance.CloseAllScreensForced(); } return true; diff --git a/project/Aki.Custom/Patches/RagfairFeePatch.cs b/project/Aki.Custom/Patches/RagfairFeePatch.cs index fddcf52..bb47a5a 100644 --- a/project/Aki.Custom/Patches/RagfairFeePatch.cs +++ b/project/Aki.Custom/Patches/RagfairFeePatch.cs @@ -17,8 +17,8 @@ namespace Aki.Custom.Patches public RagfairFeePatch() { // Remember to update prefix parameter if below lines are broken - _ = nameof(GClass2860.IsAllSelectedItemSame); - _ = nameof(GClass2860.AutoSelectSimilar); + _ = nameof(GClass2911.IsAllSelectedItemSame); + _ = nameof(GClass2911.AutoSelectSimilar); } protected override MethodBase GetTargetMethod() @@ -34,14 +34,14 @@ namespace Aki.Custom.Patches /// RequirementsPrice /// SellInOnePiece [PatchPrefix] - private static void PatchPrefix(ref Item ___item_0, ref GClass2860 ___gclass2860_0, ref double ___double_0, ref bool ___bool_0) + private static void PatchPrefix(ref Item ___item_0, ref GClass2911 ___gclass2911_0, ref double ___double_0, ref bool ___bool_0) { RequestHandler.PutJson("/client/ragfair/offerfees", new { id = ___item_0.Id, tpl = ___item_0.TemplateId, - count = ___gclass2860_0.OfferItemCount, - fee = Mathf.CeilToInt((float)GClass1941.CalculateTaxPrice(___item_0, ___gclass2860_0.OfferItemCount, ___double_0, ___bool_0)) + count = ___gclass2911_0.OfferItemCount, + fee = Mathf.CeilToInt((float)GClass1991.CalculateTaxPrice(___item_0, ___gclass2911_0.OfferItemCount, ___double_0, ___bool_0)) } .ToJson()); } diff --git a/project/Aki.Debugging/Patches/EndRaidDebug.cs b/project/Aki.Debugging/Patches/EndRaidDebug.cs index 869c411..6c57be1 100644 --- a/project/Aki.Debugging/Patches/EndRaidDebug.cs +++ b/project/Aki.Debugging/Patches/EndRaidDebug.cs @@ -17,7 +17,7 @@ namespace Aki.Debugging.Patches [PatchPrefix] private static bool PatchPreFix(ref LocalizedText ____nickName, ref TMP_Text ____standing, - ref RankPanel ____rankPanel, ref Profile.GClass1625 ___gclass1625_0) + ref RankPanel ____rankPanel, ref Profile.GClass1675 ___gclass1675_0) { if (____nickName.LocalizationKey == null) { @@ -37,13 +37,13 @@ namespace Aki.Debugging.Patches return false; // skip original } - if (___gclass1625_0?.LoyaltyLevel == null) + if (___gclass1675_0?.LoyaltyLevel == null) { ConsoleScreen.LogError("This Shouldn't happen!! Please report this in discord"); Logger.Log(LogLevel.Error, "[AKI] _gclass1618_0 or _gclass1618_0.LoyaltyLevel was null"); } - if (___gclass1625_0?.MaxLoyaltyLevel == null) + if (___gclass1675_0?.MaxLoyaltyLevel == null) { ConsoleScreen.LogError("This Shouldn't happen!! Please report this in discord"); Logger.Log(LogLevel.Error, "[AKI] _gclass1618_0 or _gclass1618_0.MaxLoyaltyLevel was null"); diff --git a/project/Aki.PrePatch/AkiBotsPrePatcher.cs b/project/Aki.PrePatch/AkiBotsPrePatcher.cs index d2b6d71..2a2a407 100644 --- a/project/Aki.PrePatch/AkiBotsPrePatcher.cs +++ b/project/Aki.PrePatch/AkiBotsPrePatcher.cs @@ -7,8 +7,8 @@ namespace Aki.PrePatch { public static IEnumerable TargetDLLs { get; } = new[] { "Assembly-CSharp.dll" }; - public static int sptUsecValue = 38; - public static int sptBearValue = 39; + public static int sptUsecValue = 41; + public static int sptBearValue = 42; public static void Patch(ref AssemblyDefinition assembly) { diff --git a/project/Aki.SinglePlayer/Patches/RaidFix/GetNewBotTemplatesPatch.cs b/project/Aki.SinglePlayer/Patches/RaidFix/GetNewBotTemplatesPatch.cs index 5b798d9..aac56f2 100644 --- a/project/Aki.SinglePlayer/Patches/RaidFix/GetNewBotTemplatesPatch.cs +++ b/project/Aki.SinglePlayer/Patches/RaidFix/GetNewBotTemplatesPatch.cs @@ -58,7 +58,7 @@ namespace Aki.SinglePlayer.Patches.RaidFix /// BotsPresets.GetNewProfile() /// [PatchPrefix] - private static bool PatchPrefix(ref Task __result, BotsPresets __instance, List ___list_0, GClass513 data, ref bool withDelete) + private static bool PatchPrefix(ref Task __result, BotsPresets __instance, List ___list_0, GClass560 data, ref bool withDelete) { /* When client wants new bot and GetNewProfile() return null (if not more available templates or they don't satisfy by Role and Difficulty condition) diff --git a/project/Aki.SinglePlayer/Patches/RaidFix/PostRaidHealingPricePatch.cs b/project/Aki.SinglePlayer/Patches/RaidFix/PostRaidHealingPricePatch.cs index 53fc6dc..fb25c5f 100644 --- a/project/Aki.SinglePlayer/Patches/RaidFix/PostRaidHealingPricePatch.cs +++ b/project/Aki.SinglePlayer/Patches/RaidFix/PostRaidHealingPricePatch.cs @@ -2,7 +2,7 @@ using HarmonyLib; using System; using System.Reflection; -using TraderInfo = EFT.Profile.GClass1625; +using TraderInfo = EFT.Profile.GClass1675; namespace Aki.SinglePlayer.Patches.RaidFix { diff --git a/project/Aki.SinglePlayer/Patches/RaidFix/RemoveUsedBotProfilePatch.cs b/project/Aki.SinglePlayer/Patches/RaidFix/RemoveUsedBotProfilePatch.cs index 57396a8..10a8b79 100644 --- a/project/Aki.SinglePlayer/Patches/RaidFix/RemoveUsedBotProfilePatch.cs +++ b/project/Aki.SinglePlayer/Patches/RaidFix/RemoveUsedBotProfilePatch.cs @@ -42,7 +42,7 @@ namespace Aki.SinglePlayer.Patches.RaidFix /// /// BotsPresets.GetNewProfile() [PatchPrefix] - private static bool PatchPrefix(ref Profile __result, object __instance, GClass513 data, ref bool withDelete) + private static bool PatchPrefix(ref Profile __result, object __instance, GClass560 data, ref bool withDelete) { withDelete = true; diff --git a/project/Aki.SinglePlayer/Patches/ScavMode/LoadOfflineRaidScreenPatch.cs b/project/Aki.SinglePlayer/Patches/ScavMode/LoadOfflineRaidScreenPatch.cs index 7730bc1..17fd7c8 100644 --- a/project/Aki.SinglePlayer/Patches/ScavMode/LoadOfflineRaidScreenPatch.cs +++ b/project/Aki.SinglePlayer/Patches/ScavMode/LoadOfflineRaidScreenPatch.cs @@ -29,7 +29,7 @@ namespace Aki.SinglePlayer.Patches.ScavMode _ = nameof(TimeAndWeatherSettings.IsRandomWeather); _ = nameof(BotControllerSettings.IsScavWars); _ = nameof(WavesSettings.IsBosses); - _ = GClass2953.MAX_SCAV_COUNT; // UPDATE REFS TO THIS CLASS BELOW !!! + _ = GClass3004.MAX_SCAV_COUNT; // UPDATE REFS TO THIS CLASS BELOW !!! var menuControllerType = typeof(MainMenuController); @@ -118,9 +118,9 @@ namespace Aki.SinglePlayer.Patches.ScavMode // Get fields from MainMenuController.cs var raidSettings = Traverse.Create(menuController).Field("raidSettings_0").GetValue(); - var matchmakerPlayersController = Traverse.Create(menuController).Field($"{nameof(GClass2953).ToLowerInvariant()}_0").GetValue(); + var matchmakerPlayersController = Traverse.Create(menuController).Field($"{nameof(GClass3004).ToLowerInvariant()}_0").GetValue(); - var gclass = new MatchmakerOfflineRaidScreen.GClass2942(profile?.Info, ref raidSettings, matchmakerPlayersController); + var gclass = new MatchmakerOfflineRaidScreen.GClass2993(profile?.Info, ref raidSettings, matchmakerPlayersController); gclass.OnShowNextScreen += LoadOfflineRaidNextScreen;