0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 05:50:44 -05:00

28476 - update mappings most classes were offset by 2

This commit is contained in:
Dev 2024-01-24 11:08:16 +00:00
parent 6b81544363
commit 2fbe050a14
9 changed files with 20 additions and 17 deletions

View File

@ -7,6 +7,7 @@ using HarmonyLib;
using System; using System;
using System.Reflection; using System.Reflection;
using static EFT.UI.TraderDialogScreen; using static EFT.UI.TraderDialogScreen;
using BTRDialog = EFT.UI.TraderDialogScreen.GClass3132;
namespace Aki.Custom.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
@ -45,7 +46,7 @@ namespace Aki.Custom.BTR.Patches
InventoryControllerClass inventoryController = _playerInventoryControllerField.GetValue(player) as InventoryControllerClass; InventoryControllerClass inventoryController = _playerInventoryControllerField.GetValue(player) as InventoryControllerClass;
AbstractQuestControllerClass questController = _playerQuestControllerField.GetValue(player) as AbstractQuestControllerClass; AbstractQuestControllerClass questController = _playerQuestControllerField.GetValue(player) as AbstractQuestControllerClass;
GClass3130 btrDialog = new GClass3130(player.Profile, Profile.TraderInfo.TraderServiceToId[Profile.ETraderServiceSource.Btr], questController, inventoryController, null); BTRDialog btrDialog = new BTRDialog(player.Profile, Profile.TraderInfo.TraderServiceToId[Profile.ETraderServiceSource.Btr], questController, inventoryController, null);
btrDialog.OnClose += player.UpdateInteractionCast; btrDialog.OnClose += player.UpdateInteractionCast;
btrDialog.ShowScreen(EScreenState.Queued); btrDialog.ShowScreen(EScreenState.Queued);

View File

@ -5,7 +5,7 @@ using EFT.GlobalEvents;
using EFT.Vehicle; using EFT.Vehicle;
using HarmonyLib; using HarmonyLib;
using System.Reflection; using System.Reflection;
using GlobalEventHandler = GClass2909; using GlobalEventHandler = GClass2911;
namespace Aki.Custom.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {

View File

@ -31,7 +31,7 @@ namespace Aki.Custom.Patches
var player = Singleton<GameWorld>.Instance.MainPlayer; var player = Singleton<GameWorld>.Instance.MainPlayer;
if (profileId == player?.Profile.Id) if (profileId == player?.Profile.Id)
{ {
GClass3105.Instance.CloseAllScreensForced(); GClass3107.Instance.CloseAllScreensForced();
} }
return true; return true;

View File

@ -17,8 +17,8 @@ namespace Aki.Custom.Patches
public RagfairFeePatch() public RagfairFeePatch()
{ {
// Remember to update prefix parameter if below lines are broken // Remember to update prefix parameter if below lines are broken
_ = nameof(GClass3067.IsAllSelectedItemSame); _ = nameof(GClass3069.IsAllSelectedItemSame);
_ = nameof(GClass3067.AutoSelectSimilar); _ = nameof(GClass3069.AutoSelectSimilar);
} }
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
@ -34,14 +34,14 @@ namespace Aki.Custom.Patches
/// <param name="___double_0">RequirementsPrice</param> /// <param name="___double_0">RequirementsPrice</param>
/// <param name="___bool_0">SellInOnePiece</param> /// <param name="___bool_0">SellInOnePiece</param>
[PatchPrefix] [PatchPrefix]
private static void PatchPrefix(ref Item ___item_0, ref GClass3067 ___gclass3067_0, ref double ___double_0, ref bool ___bool_0) private static void PatchPrefix(ref Item ___item_0, ref GClass3069 ___gclass3069_0, ref double ___double_0, ref bool ___bool_0)
{ {
RequestHandler.PutJson("/client/ragfair/offerfees", new RequestHandler.PutJson("/client/ragfair/offerfees", new
{ {
id = ___item_0.Id, id = ___item_0.Id,
tpl = ___item_0.TemplateId, tpl = ___item_0.TemplateId,
count = ___gclass3067_0.OfferItemCount, count = ___gclass3069_0.OfferItemCount,
fee = Mathf.CeilToInt((float)GClass2084.CalculateTaxPrice(___item_0, ___gclass3067_0.OfferItemCount, ___double_0, ___bool_0)) fee = Mathf.CeilToInt((float)GClass2086.CalculateTaxPrice(___item_0, ___gclass3069_0.OfferItemCount, ___double_0, ___bool_0))
}.ToJson()); }.ToJson());
} }
} }

View File

@ -5,6 +5,7 @@ using EFT;
using EFT.UI; using EFT.UI;
using HarmonyLib; using HarmonyLib;
using System.Reflection; using System.Reflection;
using DialogControlClass = GClass1954;
namespace Aki.Debugging.Patches namespace Aki.Debugging.Patches
{ {
@ -19,7 +20,7 @@ namespace Aki.Debugging.Patches
[PatchPostfix] [PatchPostfix]
internal static void PatchPostfix() internal static void PatchPostfix()
{ {
ConsoleScreen.Processor.RegisterCommandGroup<GClass1952>(); ConsoleScreen.Processor.RegisterCommandGroup<DialogControlClass>();
ConsoleScreen.Processor.RegisterCommand("btr_deliver_items", new System.Action(BtrDeliverItemsCommand)); ConsoleScreen.Processor.RegisterCommand("btr_deliver_items", new System.Action(BtrDeliverItemsCommand));
} }
@ -35,7 +36,7 @@ namespace Aki.Debugging.Patches
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return AccessTools.Method(typeof(GClass1952), nameof(GClass1952.ShowDialogScreen)); return AccessTools.Method(typeof(DialogControlClass), nameof(DialogControlClass.ShowDialogScreen));
} }
[PatchPrefix] [PatchPrefix]

View File

@ -21,7 +21,7 @@ namespace Aki.Debugging.Patches
public SptSpawnHelper() public SptSpawnHelper()
{ {
IEnumerable<ISpawnPoint> locationSpawnPoints = GClass2922.CreateFromScene(); IEnumerable<ISpawnPoint> locationSpawnPoints = GClass2924.CreateFromScene();
var playerSpawns = locationSpawnPoints.Where(x => x.Categories.HasFlag(ESpawnCategoryMask.Player)).ToList(); var playerSpawns = locationSpawnPoints.Where(x => x.Categories.HasFlag(ESpawnCategoryMask.Player)).ToList();
this.playerSpawnPoints = locationSpawnPoints.Where(x => x.Categories.HasFlag(ESpawnCategoryMask.Player)).ToList(); this.playerSpawnPoints = locationSpawnPoints.Where(x => x.Categories.HasFlag(ESpawnCategoryMask.Player)).ToList();
@ -62,7 +62,7 @@ namespace Aki.Debugging.Patches
} }
[PatchPrefix] [PatchPrefix]
public static bool PatchPrefix(GClass1468 __instance, GClass588 data) public static bool PatchPrefix(GClass1470 __instance, GClass588 data)
{ {
var firstBotRole = data.Profiles[0].Info.Settings.Role; var firstBotRole = data.Profiles[0].Info.Settings.Role;

View File

@ -43,7 +43,7 @@ namespace Aki.SinglePlayer.Patches.RaidFix
} }
var inventoryController = Traverse.Create(player).Field<InventoryControllerClass>("_inventoryController").Value; var inventoryController = Traverse.Create(player).Field<InventoryControllerClass>("_inventoryController").Value;
GClass2768.Remove(accessCardItem, inventoryController, false, true); GClass2770.Remove(accessCardItem, inventoryController, false, true);
} }
} }
} }

View File

@ -11,6 +11,7 @@ using System.Linq;
using System.Reflection; using System.Reflection;
using System.Reflection.Emit; using System.Reflection.Emit;
using OfflineRaidAction = System.Action; using OfflineRaidAction = System.Action;
using SettingsClass = GClass3166;
// DON'T FORGET TO UPDATE REFERENCES IN CONSTRUCTOR // DON'T FORGET TO UPDATE REFERENCES IN CONSTRUCTOR
// AND IN THE LoadOfflineRaidScreenForScavs METHOD AS WELL // AND IN THE LoadOfflineRaidScreenForScavs METHOD AS WELL
@ -29,7 +30,7 @@ namespace Aki.SinglePlayer.Patches.ScavMode
_ = nameof(TimeAndWeatherSettings.IsRandomWeather); _ = nameof(TimeAndWeatherSettings.IsRandomWeather);
_ = nameof(BotControllerSettings.IsScavWars); _ = nameof(BotControllerSettings.IsScavWars);
_ = nameof(WavesSettings.IsBosses); _ = nameof(WavesSettings.IsBosses);
_ = GClass3164.MAX_SCAV_COUNT; // UPDATE REFS TO THIS CLASS BELOW !!! _ = SettingsClass.MAX_SCAV_COUNT; // UPDATE REFS TO THIS CLASS BELOW !!!
// `MatchmakerInsuranceScreen` OnShowNextScreen // `MatchmakerInsuranceScreen` OnShowNextScreen
_onReadyScreenMethod = AccessTools.Method(typeof(MainMenuController), nameof(MainMenuController.method_42)); _onReadyScreenMethod = AccessTools.Method(typeof(MainMenuController), nameof(MainMenuController.method_42));
@ -116,9 +117,9 @@ namespace Aki.SinglePlayer.Patches.ScavMode
// Get fields from MainMenuController.cs // Get fields from MainMenuController.cs
var raidSettings = Traverse.Create(menuController).Field("raidSettings_0").GetValue<RaidSettings>(); var raidSettings = Traverse.Create(menuController).Field("raidSettings_0").GetValue<RaidSettings>();
var matchmakerPlayersController = Traverse.Create(menuController).Field($"{nameof(GClass3164).ToLowerInvariant()}_0").GetValue<GClass3164>(); var matchmakerPlayersController = Traverse.Create(menuController).Field($"{nameof(SettingsClass).ToLowerInvariant()}_0").GetValue<SettingsClass>();
var gclass = new MatchmakerOfflineRaidScreen.GClass3153(profile?.Info, ref raidSettings, matchmakerPlayersController); var gclass = new MatchmakerOfflineRaidScreen.GClass3155(profile?.Info, ref raidSettings, matchmakerPlayersController);
gclass.OnShowNextScreen += LoadOfflineRaidNextScreen; gclass.OnShowNextScreen += LoadOfflineRaidNextScreen;

View File

@ -6,7 +6,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using static BackendConfigSettingsClass; using static BackendConfigSettingsClass;
using TraderServiceClass = GClass1789; using TraderServiceClass = GClass1791;
namespace Aki.SinglePlayer.Utils.TraderServices namespace Aki.SinglePlayer.Utils.TraderServices
{ {