mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 01:50:45 -05:00
Refactored patches to be public so people can disable if needed
This commit is contained in:
parent
e3bc4e3210
commit
0986ebac2d
@ -26,7 +26,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref BotsGroup __result, IBotGame ____game, DeadBodiesController ____deadBodiesController, BotOwner bot, BotZone zone)
|
||||
public static bool PatchPrefix(ref BotsGroup __result, IBotGame ____game, DeadBodiesController ____deadBodiesController, BotOwner bot, BotZone zone)
|
||||
{
|
||||
if (!TraitorChancePercent.HasValue)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ namespace SPT.Custom.Patches
|
||||
/// This should fix that.
|
||||
/// </summary>
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(BotsController __instance, IPlayer aggressor, IPlayer groupOwner, IPlayer target)
|
||||
public static bool PatchPrefix(BotsController __instance, IPlayer aggressor, IPlayer groupOwner, IPlayer target)
|
||||
{
|
||||
if (!groupOwner.IsAI)
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(Profile profile)
|
||||
public static void PatchPrefix(Profile profile)
|
||||
{
|
||||
MonoBehaviourSingleton<PreloaderUI>.Instance.SetWatermarkStatus(profile, true);
|
||||
}
|
||||
@ -42,7 +42,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(ref TextMeshProUGUI ____label, Profile ___profile_0)
|
||||
public static void PatchPostfix(ref TextMeshProUGUI ____label, Profile ___profile_0)
|
||||
{
|
||||
____label.text = $"{MenuNotificationManager.commitHash}";
|
||||
}
|
||||
@ -57,7 +57,7 @@ namespace SPT.Custom.Patches
|
||||
|
||||
// Prefix so the logic isn't being duplicated.
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(int screenHeight, int screenWidth, int rectHeight, int rectWidth, ref Vector2 __result)
|
||||
public static bool PatchPrefix(int screenHeight, int screenWidth, int rectHeight, int rectWidth, ref Vector2 __result)
|
||||
{
|
||||
System.Random random = new System.Random();
|
||||
|
||||
|
@ -35,13 +35,13 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(BossLocationSpawn[] bossLocationSpawn)
|
||||
public static void PatchPrefix(BossLocationSpawn[] bossLocationSpawn)
|
||||
{
|
||||
_bossSpawnPercent = bossLocationSpawn.Select(s => s.BossChance).ToArray();
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(ref BossLocationSpawn[] __result)
|
||||
public static void PatchPostfix(ref BossLocationSpawn[] __result)
|
||||
{
|
||||
if (__result.Length != _bossSpawnPercent.Length)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref string __result, BotDifficulty botDifficulty, WildSpawnType role)
|
||||
public static bool PatchPrefix(ref string __result, BotDifficulty botDifficulty, WildSpawnType role)
|
||||
{
|
||||
__result = DifficultyManager.Get(botDifficulty, role);
|
||||
var resultIsNullEmpty = string.IsNullOrWhiteSpace(__result);
|
||||
|
@ -20,7 +20,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix()
|
||||
public static void PatchPostfix()
|
||||
{
|
||||
var pmcProfile = PatchConstants.BackEndSession.Profile;
|
||||
var scavProfile = PatchConstants.BackEndSession.ProfileOfPet;
|
||||
|
@ -7,26 +7,26 @@ using SPT.Custom.Utils;
|
||||
namespace SPT.Custom.Patches
|
||||
{
|
||||
public class CoreDifficultyPatch : ModulePatch
|
||||
{
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
var methodName = "LoadCoreByString";
|
||||
var flags = BindingFlags.Public | BindingFlags.Static;
|
||||
var methodName = "LoadCoreByString";
|
||||
var flags = BindingFlags.Public | BindingFlags.Static;
|
||||
|
||||
return PatchConstants.EftTypes.SingleCustom(x => x.GetMethod(methodName, flags) != null)
|
||||
.GetMethod(methodName, flags);
|
||||
}
|
||||
return PatchConstants.EftTypes.SingleCustom(x => x.GetMethod(methodName, flags) != null)
|
||||
.GetMethod(methodName, flags);
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref string __result)
|
||||
{
|
||||
// fetch all bot difficulties to be used in BotDifficultyPatch
|
||||
// this is called here since core difficulties are fetched before bot-specific difficulties are
|
||||
DifficultyManager.Update();
|
||||
[PatchPrefix]
|
||||
public static bool PatchPrefix(ref string __result)
|
||||
{
|
||||
// fetch all bot difficulties to be used in BotDifficultyPatch
|
||||
// this is called here since core difficulties are fetched before bot-specific difficulties are
|
||||
DifficultyManager.Update();
|
||||
|
||||
// update core difficulty
|
||||
// update core difficulty
|
||||
__result = RequestHandler.GetJson("/singleplayer/settings/bot/difficulty/core/core");
|
||||
return string.IsNullOrWhiteSpace(__result);
|
||||
return string.IsNullOrWhiteSpace(__result);
|
||||
}
|
||||
}
|
||||
}
|
@ -37,7 +37,7 @@ namespace SPT.Custom.Patches
|
||||
/// <param name="__instance">StandartBotBrain</param>
|
||||
/// <param name="___botOwner_0">botOwner_0 property</param>
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(out WildSpawnType __state, StandartBotBrain __instance, BotOwner ___botOwner_0)
|
||||
public static bool PatchPrefix(out WildSpawnType __state, StandartBotBrain __instance, BotOwner ___botOwner_0)
|
||||
{
|
||||
___botOwner_0.Profile.Info.Settings.Role = FixAssaultGroupPmcsRole(___botOwner_0);
|
||||
__state = ___botOwner_0.Profile.Info.Settings.Role; // Store original type in state param to allow access in PatchPostFix()
|
||||
@ -130,7 +130,7 @@ namespace SPT.Custom.Patches
|
||||
/// <param name="__state">Saved state from prefix patch</param>
|
||||
/// <param name="___botOwner_0">botOwner_0 property</param>
|
||||
[PatchPostfix]
|
||||
private static void PatchPostFix(WildSpawnType __state, BotOwner ___botOwner_0)
|
||||
public static void PatchPostFix(WildSpawnType __state, BotOwner ___botOwner_0)
|
||||
{
|
||||
if (AiHelpers.BotIsSptPmc(__state, ___botOwner_0))
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ESessionMode sessionMode, Profile profile, ref GameObject ____notAvailableState)
|
||||
public static bool PatchPrefix(ESessionMode sessionMode, Profile profile, ref GameObject ____notAvailableState)
|
||||
{
|
||||
____notAvailableState.SetActive(false);
|
||||
return false;
|
||||
|
@ -18,7 +18,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix()
|
||||
public static void PatchPostfix()
|
||||
{
|
||||
GameWorld gameWorld = Singleton<GameWorld>.Instance;
|
||||
Random random = new Random();
|
||||
|
@ -40,7 +40,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref Task<EasyAssets> __result, GameObject gameObject, [CanBeNull] IBundleLock bundleLock, string defaultKey, string rootPath,
|
||||
public static bool PatchPrefix(ref Task<EasyAssets> __result, GameObject gameObject, [CanBeNull] IBundleLock bundleLock, string defaultKey, string rootPath,
|
||||
string platformName, [CanBeNull] Func<string, bool> shouldExclude, [CanBeNull] Func<string, Task> bundleCheck)
|
||||
{
|
||||
var easyAsset = gameObject.AddComponent<EasyAssets>();
|
||||
|
@ -25,7 +25,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(object __instance, string key, string rootPath, CompatibilityAssetBundleManifest manifest, IBundleLock bundleLock)
|
||||
public static void PatchPostfix(object __instance, string key, string rootPath, CompatibilityAssetBundleManifest manifest, IBundleLock bundleLock)
|
||||
{
|
||||
var filepath = rootPath + key;
|
||||
var dependencies = manifest.GetDirectDependencies(key) ?? Array.Empty<string>();
|
||||
|
@ -19,7 +19,7 @@ namespace SPT.Custom.Patches
|
||||
return AccessTools.Method(typeof(BotsGroupMarkOfUnknown), nameof(BotsGroupMarkOfUnknown.Dispose));
|
||||
}
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(BotsGroup ____groups)
|
||||
public static bool PatchPrefix(BotsGroup ____groups)
|
||||
{
|
||||
if (____groups == null)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(BotOwner bot)
|
||||
public static void PatchPrefix(BotOwner bot)
|
||||
{
|
||||
// Is a boss and not a follower and not a PMC
|
||||
if (!bot.Profile.Info.Settings.IsBoss() && !CustomAI.AiHelpers.BotIsSptPmc(bot.Profile.Info.Settings.Role, bot))
|
||||
|
@ -20,7 +20,7 @@ namespace SPT.Custom.Patches
|
||||
/// Needed to ensure bot checks the enemy side, not just its botType
|
||||
/// </summary>
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref bool __result, BotsGroup __instance, IPlayer requester)
|
||||
public static bool PatchPrefix(ref bool __result, BotsGroup __instance, IPlayer requester)
|
||||
{
|
||||
if (requester == null)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPreFix(ref IEnumerable<QuestDataClass> quests)
|
||||
public static void PatchPreFix(ref IEnumerable<QuestDataClass> quests)
|
||||
{
|
||||
var gameWorld = Singleton<GameWorld>.Instance;
|
||||
|
||||
|
@ -40,7 +40,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(BotOwner ___botOwner_0)
|
||||
public static bool PatchPrefix(BotOwner ___botOwner_0)
|
||||
{
|
||||
if (___botOwner_0.IsRole(WildSpawnType.pmcUSEC) || ___botOwner_0.IsRole(WildSpawnType.pmcBEAR))
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void Prefix()
|
||||
public static void PatchPrefix()
|
||||
{
|
||||
CheckForNonWhitelistedPlugins(Logger);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(HideoutPlayerOwner __instance)
|
||||
public static void PatchPostfix(HideoutPlayerOwner __instance)
|
||||
{
|
||||
RequestHandler.PutJson("/client/hideout/workout", new
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
internal static void PatchPrefix(ref string ___string_0, ref string ___string_1)
|
||||
public static void PatchPrefix(ref string ___string_0, ref string ___string_1)
|
||||
{
|
||||
if (!Directory.Exists(_sptPath))
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ namespace SPT.Custom.Patches
|
||||
/// <param name="___double_0">RequirementsPrice</param>
|
||||
/// <param name="___bool_0">SellInOnePiece</param>
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(ref Item ___item_0, ref RagfairOfferSellHelperClass ___ragfairOfferSellHelperClass, ref double ___double_0, ref bool ___bool_0)
|
||||
public static void PatchPrefix(ref Item ___item_0, ref RagfairOfferSellHelperClass ___ragfairOfferSellHelperClass, ref double ___double_0, ref bool ___bool_0)
|
||||
{
|
||||
RequestHandler.PutJson("/client/ragfair/offerfees", new
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(object controller, UpdatableToggle ____offlineModeToggle)
|
||||
public static void PatchPrefix(object controller, UpdatableToggle ____offlineModeToggle)
|
||||
{
|
||||
//var raidSettings = Traverse.Create(controller).Field<RaidSettings>("RaidSettings").Value;
|
||||
var offlineRaidSettings = Traverse.Create(controller).Field<RaidSettings>("OfflineRaidSettings").Value;
|
||||
@ -38,15 +38,6 @@ namespace SPT.Custom.Patches
|
||||
return;
|
||||
}
|
||||
|
||||
//raidSettings.BotSettings.BotAmount = settings.AiAmount;
|
||||
//raidSettings.WavesSettings.BotAmount = settings.AiAmount;
|
||||
//raidSettings.WavesSettings.BotDifficulty = settings.AiDifficulty;
|
||||
//raidSettings.WavesSettings.IsBosses = settings.BossEnabled;
|
||||
//raidSettings.BotSettings.IsScavWars = false;
|
||||
//raidSettings.WavesSettings.IsTaggedAndCursed = settings.TaggedAndCursed;
|
||||
//raidSettings.TimeAndWeatherSettings.IsRandomWeather = settings.RandomWeather;
|
||||
//raidSettings.TimeAndWeatherSettings.IsRandomTime = settings.RandomTime;
|
||||
|
||||
// We use PVE mode from Tarkov now we need to modify PVE MODE instead of ONLINE Mode
|
||||
|
||||
offlineRaidSettings.BotSettings.BotAmount = settings.AiAmount;
|
||||
@ -60,7 +51,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(MatchmakerOfflineRaidScreen __instance, DefaultUIButton ____changeSettingsButton, UiElementBlocker ____onlineBlocker)
|
||||
public static void PatchPostfix(MatchmakerOfflineRaidScreen __instance, DefaultUIButton ____changeSettingsButton, UiElementBlocker ____onlineBlocker)
|
||||
{
|
||||
____onlineBlocker.gameObject.SetActive(false);
|
||||
____changeSettingsButton.Interactable = true;
|
||||
|
@ -22,7 +22,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
internal static void PatchPostfix(object __result)
|
||||
public static void PatchPostfix(object __result)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_versionLabel))
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ namespace SPT.Debugging.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(BaseLocalGame<EftGamePlayerOwner> __instance)
|
||||
public static void PatchPrefix(BaseLocalGame<EftGamePlayerOwner> __instance)
|
||||
{
|
||||
if (!Input.GetKeyDown(KeyCode.LeftControl)) return;
|
||||
|
||||
|
@ -13,7 +13,7 @@ namespace SPT.Debugging.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPrefix(ref string __result)
|
||||
public static void PatchPrefix(ref string __result)
|
||||
{
|
||||
Console.WriteLine($"response json: ${__result}");
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ namespace SPT.Debugging.Patches
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPreFix(ref LocalizedText ____nickName, ref TMP_Text ____standing,
|
||||
public static bool PatchPreFix(ref LocalizedText ____nickName, ref TMP_Text ____standing,
|
||||
ref RankPanel ____rankPanel, ref Profile.TraderInfo ___traderInfo_0)
|
||||
{
|
||||
if (____nickName.LocalizationKey == null)
|
||||
|
@ -18,7 +18,7 @@ namespace SPT.Debugging.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(string nlogFormat, string unityFormat, LogLevel logLevel, object[] args)
|
||||
public static void PatchPostfix(string nlogFormat, string unityFormat, LogLevel logLevel, object[] args)
|
||||
{
|
||||
var bsgLevel = LogLevel.FromOrdinal(logLevel.Ordinal);
|
||||
var sptLevel = LogLevel.FromOrdinal(SPTDebuggingPlugin.logLevel.verbosity);
|
||||
|
@ -16,7 +16,7 @@ namespace SPT.Debugging.Patches
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix()
|
||||
public static void PatchPostfix()
|
||||
{
|
||||
ConsoleScreen.Processor.RegisterCommandGroup<ReloadClientPatch>();
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(Player __instance)
|
||||
public static void PatchPostfix(Player __instance)
|
||||
{
|
||||
if (__instance.IsYourPlayer)
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(ref RaidSettings ___raidSettings_0, ref RaidSettings ___raidSettings_1)
|
||||
public static void PatchPrefix(ref RaidSettings ___raidSettings_0, ref RaidSettings ___raidSettings_1)
|
||||
{
|
||||
// If Raidsettingswindow is never opened it will soft lock game
|
||||
if (___raidSettings_0 == null)
|
||||
|
@ -16,7 +16,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(DamageInfo damageInfo)
|
||||
public static void PatchPostfix(DamageInfo damageInfo)
|
||||
{
|
||||
if (damageInfo.Player == null || damageInfo.Player.iPlayer == null || !damageInfo.Player.iPlayer.IsYourPlayer)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(ref GClass3114 contextInteractions)
|
||||
public static void PatchPrefix(ref GClass3114 contextInteractions)
|
||||
{
|
||||
// clear with a null to stop "looking for group/create group" buttons
|
||||
// they handle nulls so dont worry
|
||||
|
@ -17,7 +17,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(DefaultUIButton ____readyButton)
|
||||
public static void PatchPostfix(DefaultUIButton ____readyButton)
|
||||
{
|
||||
____readyButton.Interactable = false;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchTranspiler]
|
||||
private static IEnumerable<CodeInstruction> PatchTranspile(IEnumerable<CodeInstruction> instructions)
|
||||
public static IEnumerable<CodeInstruction> PatchTranspile(IEnumerable<CodeInstruction> instructions)
|
||||
{
|
||||
var codes = new List<CodeInstruction>(instructions);
|
||||
var searchCode = new CodeInstruction(OpCodes.Ldstr, "6617beeaa9cfa777ca915b7c");
|
||||
|
@ -16,7 +16,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref bool __result)
|
||||
public static bool PatchPrefix(ref bool __result)
|
||||
{
|
||||
__result = false;
|
||||
return false; // Do not run original method
|
||||
|
@ -31,7 +31,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PrefixPatch(RaidSettings ___raidSettings_0)
|
||||
public static void PrefixPatch(RaidSettings ___raidSettings_0)
|
||||
{
|
||||
___raidSettings_0.RaidMode = ERaidMode.Online;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostFix(ref DefaultUIButton ____readyButton)
|
||||
public static void PatchPostFix(ref DefaultUIButton ____readyButton)
|
||||
{
|
||||
____readyButton?.GameObject?.SetActive(false);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref bool __result, string variable)
|
||||
public static bool PatchPrefix(ref bool __result, string variable)
|
||||
{
|
||||
if (variable == "pve_first_time")
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix()
|
||||
public static void PatchPostfix()
|
||||
{
|
||||
var failedPluginCount = Chainloader.DependencyErrors.Count;
|
||||
|
||||
|
@ -20,14 +20,14 @@ namespace SPT.SinglePlayer.Patches.Progression
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(ref AbstractQuestControllerClass __state, ref AbstractQuestControllerClass ____questController)
|
||||
public static void PatchPrefix(ref AbstractQuestControllerClass __state, ref AbstractQuestControllerClass ____questController)
|
||||
{
|
||||
__state = ____questController;
|
||||
____questController = null;
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(AbstractQuestControllerClass __state, ref AbstractQuestControllerClass ____questController)
|
||||
public static void PatchPostfix(AbstractQuestControllerClass __state, ref AbstractQuestControllerClass ____questController)
|
||||
{
|
||||
____questController = __state;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ namespace SPT.SinglePlayer.Patches.Progression
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref Profile activeProfile,ref EPlayerSide side)
|
||||
public static bool PatchPrefix(ref Profile activeProfile,ref EPlayerSide side)
|
||||
{
|
||||
if (activeProfile.Side == EPlayerSide.Savage)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ namespace SPT.SinglePlayer.Patches.Quests
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref bool __result, WildSpawnType ___wildSpawnType_0, BotDifficulty ___botDifficulty_0, Profile x)
|
||||
public static bool PatchPrefix(ref bool __result, WildSpawnType ___wildSpawnType_0, BotDifficulty ___botDifficulty_0, Profile x)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(List<WaveInfo> __result, List<WaveInfo> wavesProfiles, List<WaveInfo> delayed)
|
||||
public static void PatchPostfix(List<WaveInfo> __result, List<WaveInfo> wavesProfiles, List<WaveInfo> delayed)
|
||||
{
|
||||
/*
|
||||
Method sums Limits by grouping wavesPropfiles collection by Role and Difficulty
|
||||
|
@ -44,7 +44,7 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
/// BotsPresets.GetNewProfile()
|
||||
/// </summary>
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref Task<Profile> __result, BotsPresets __instance, List<Profile> ___list_0, BotCreationDataClass data, ref bool withDelete)
|
||||
public static bool PatchPrefix(ref Task<Profile> __result, BotsPresets __instance, List<Profile> ___list_0, BotCreationDataClass 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)
|
||||
|
@ -20,7 +20,7 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix()
|
||||
public static void PatchPostfix()
|
||||
{
|
||||
var gameWorld = Singleton<GameWorld>.Instance;
|
||||
var player = gameWorld?.MainPlayer;
|
||||
|
@ -35,7 +35,7 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPreFix(ref int maxCount)
|
||||
public static void PatchPreFix(ref int maxCount)
|
||||
{
|
||||
var gameWorld = Singleton<GameWorld>.Instance;
|
||||
var location = gameWorld.MainPlayer.Location;
|
||||
|
@ -14,7 +14,7 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
protected static void PatchPrefix(Profile.TraderInfo __instance)
|
||||
public static void PatchPrefix(Profile.TraderInfo __instance)
|
||||
{
|
||||
if (__instance.Settings == null)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
/// <summary>
|
||||
/// BotsPresets.GetNewProfile()
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref bool withDelete)
|
||||
public static bool PatchPrefix(ref bool withDelete)
|
||||
{
|
||||
withDelete = true;
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
}
|
||||
|
||||
[PatchTranspiler]
|
||||
private static IEnumerable<CodeInstruction> PatchTranspile(IEnumerable<CodeInstruction> instructions)
|
||||
public static IEnumerable<CodeInstruction> PatchTranspile(IEnumerable<CodeInstruction> instructions)
|
||||
{
|
||||
var codes = new List<CodeInstruction>(instructions);
|
||||
var searchCode = new CodeInstruction(OpCodes.Callvirt, AccessTools.Method(typeof(AudioClip), "get_length"));
|
||||
|
@ -24,7 +24,7 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPreFix(int wantSpawn, ref int toDelay, ref int toSpawn, ref int ____maxBots, int ____allBotsCount, int ____inSpawnProcess)
|
||||
public static bool PatchPreFix(int wantSpawn, ref int toDelay, ref int toSpawn, ref int ____maxBots, int ____allBotsCount, int ____inSpawnProcess)
|
||||
{
|
||||
// Set bots to delay if alive bots + spawning bots count > maxbots
|
||||
// ____inSpawnProcess can be negative, don't go below 0 when calculating
|
||||
|
@ -17,7 +17,7 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
|
||||
// checks on invoke whether the player is stunned before allowing tinnitus
|
||||
[PatchPrefix]
|
||||
static bool PatchPrefix()
|
||||
public static bool PatchPrefix()
|
||||
{
|
||||
var baseMethod = AccessTools.Method(typeof(ActiveHealthController), nameof(ActiveHealthController.FindActiveEffect));
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(ref RaidSettings ___raidSettings_0, ref RaidSettings ___raidSettings_1, MainMenuController __instance)
|
||||
public static void PatchPrefix(ref RaidSettings ___raidSettings_0, ref RaidSettings ___raidSettings_1, MainMenuController __instance)
|
||||
{
|
||||
___raidSettings_0.RaidMode = ERaidMode.Local;
|
||||
___raidSettings_0.IsPveOffline = true;
|
||||
@ -29,7 +29,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(ref RaidSettings ___raidSettings_0)
|
||||
public static void PatchPostfix(ref RaidSettings ___raidSettings_0)
|
||||
{
|
||||
___raidSettings_0.RaidMode = ERaidMode.Local;
|
||||
___raidSettings_0.IsPveOffline = true;
|
||||
|
@ -20,7 +20,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(LocalGame __instance)
|
||||
public static void PatchPrefix(LocalGame __instance)
|
||||
{
|
||||
GetProfileAtEndOfRaidPatch.Profile = __instance.Profile_0.ToJson();
|
||||
}
|
||||
@ -37,7 +37,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(ref ISession ___iSession)
|
||||
public static void PatchPrefix(ref ISession ___iSession)
|
||||
{
|
||||
var profile = GetProfileAtEndOfRaidPatch.Profile.ParseJsonTo<Profile>();
|
||||
|
||||
|
@ -50,7 +50,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchTranspiler]
|
||||
private static IEnumerable<CodeInstruction> PatchTranspiler(ILGenerator generator, IEnumerable<CodeInstruction> instructions)
|
||||
public static IEnumerable<CodeInstruction> PatchTranspiler(ILGenerator generator, IEnumerable<CodeInstruction> instructions)
|
||||
{
|
||||
/* The original msil looks something like this:
|
||||
* 0 0000 ldarg.0
|
||||
|
@ -15,7 +15,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(Profile profile, ExfiltrationControllerClass __instance, ref ExfiltrationPoint[] __result)
|
||||
public static bool PatchPrefix(Profile profile, ExfiltrationControllerClass __instance, ref ExfiltrationPoint[] __result)
|
||||
{
|
||||
if (profile.Info.Side != EPlayerSide.Savage)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(GameWorld __instance)
|
||||
public static void PatchPrefix(GameWorld __instance)
|
||||
{
|
||||
var player = __instance.MainPlayer;
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref RaidSettings ____raidSettings)
|
||||
public static bool PatchPrefix(ref RaidSettings ____raidSettings)
|
||||
{
|
||||
var currentMapId = ____raidSettings.SelectedLocation.Id;
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchTranspiler]
|
||||
private static IEnumerable<CodeInstruction> PatchTranspile(ILGenerator generator, IEnumerable<CodeInstruction> instructions)
|
||||
public static IEnumerable<CodeInstruction> PatchTranspile(ILGenerator generator, IEnumerable<CodeInstruction> instructions)
|
||||
{
|
||||
var codes = new List<CodeInstruction>(instructions);
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchTranspiler]
|
||||
private static IEnumerable<CodeInstruction> PatchTranspile(ILGenerator generator, IEnumerable<CodeInstruction> instructions)
|
||||
public static IEnumerable<CodeInstruction> PatchTranspile(ILGenerator generator, IEnumerable<CodeInstruction> instructions)
|
||||
{
|
||||
var codes = new List<CodeInstruction>(instructions);
|
||||
|
||||
|
@ -16,7 +16,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(DamageInfo damage, string playerProfileId, out Tuple<Player, bool> __state)
|
||||
public static void PatchPrefix(DamageInfo damage, string playerProfileId, out Tuple<Player, bool> __state)
|
||||
{
|
||||
__state = new Tuple<Player, bool>(null, false);
|
||||
var player = (Player)damage.Player.iPlayer;
|
||||
|
@ -43,7 +43,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(ScavengerInventoryScreen __instance, IEnumerable<Item> items)
|
||||
public static void PatchPostfix(ScavengerInventoryScreen __instance, IEnumerable<Item> items)
|
||||
{
|
||||
ISession session = _sessionField.GetValue(__instance) as ISession;
|
||||
TraderClass traderClass = session.Traders.FirstOrDefault(x => x.Id == FENCE_ID);
|
||||
|
@ -29,7 +29,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ProfileEndpointFactoryAbstractClass __instance, ref Task<IResult> __result, string playerId, string petId)
|
||||
public static bool PatchPrefix(ProfileEndpointFactoryAbstractClass __instance, ref Task<IResult> __result, string playerId, string petId)
|
||||
{
|
||||
// Build request with additional information
|
||||
OwnerInfo fromOwner = new OwnerInfo
|
||||
|
@ -32,7 +32,7 @@ namespace SPT.SinglePlayer
|
||||
|
||||
|
||||
// Still need
|
||||
//new SmokeGrenadeFuseSoundFixPatch().Enable(); TODO: refactor as it causes exceptions to be thrown when grenade is tossed by player
|
||||
// new SmokeGrenadeFuseSoundFixPatch().Enable(); TODO: refactor as it causes exceptions to be thrown when grenade is tossed by player
|
||||
new ScavExperienceGainPatch().Enable();
|
||||
new DisablePMCExtractsForScavsPatch().Enable();
|
||||
new ScavExfilPatch().Enable();
|
||||
@ -60,7 +60,7 @@ namespace SPT.SinglePlayer
|
||||
new GetProfileAtEndOfRaidPatch().Enable();
|
||||
new FixSavageInventoryScreenPatch().Enable();
|
||||
new InsuranceScreenPatch().Enable();
|
||||
//new ApplyRaidSettingsPatch().Enable(); Should be no longer needed keeping here just to be safe.
|
||||
// new ApplyRaidSettingsPatch().Enable(); Should be no longer needed keeping here just to be safe.
|
||||
new FixQuestAchieveControllersPatch().Enable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
Loading…
x
Reference in New Issue
Block a user