0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 02:50:45 -05:00
modules/project/SPT.Custom/SPTCustomPlugin.cs
DrakiaXYZ 127e48a582 Redirect "PlayerPrefs" registry reads/writes to a JSON file (Memory-cached) to avoid cross contamination with live data (!172)
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT/Modules#172
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-10-26 08:15:12 +00:00

61 lines
2.4 KiB
C#

using System;
using SPT.Common;
using SPT.Custom.Patches;
using SPT.Custom.Utils;
using SPT.Reflection.Utils;
using BepInEx;
using UnityEngine;
namespace SPT.Custom
{
[BepInPlugin("com.SPT.custom", "SPT.Custom", SPTPluginInfo.PLUGIN_VERSION)]
public class SPTCustomPlugin : BaseUnityPlugin
{
public void Awake()
{
Logger.LogInfo("Loading: SPT.Custom");
try
{
// Bundle patches should always load first - DO NOT REMOVE
new EasyAssetsPatch().Enable();
new EasyBundlePatch().Enable();
// Still need
new DisableNonHalloweenExitsDuringEventPatch().Enable();
new SendFleaListingTaxAmountToServerPatch().Enable();
new AddTraitorScavsPatch().Enable();
new CustomAiPatch().Enable();
new SaveSettingsToSptFolderPatch().Enable();
new SaveRegistryToSptFolderPatches().Enable();
new QTEPatch().Enable();
new RedirectClientImageRequestsPatch().Enable();
new DisableGameModeAdjustButtonPatch().Enable();
new FixPmcSpawnParamsNullErrorPatch().Enable();
new SetPreRaidSettingsScreenDefaultsPatch().Enable();
new CoreDifficultyPatch().Enable();
new BotDifficultyPatch().Enable();
new VersionLabelPatch().Enable();
new FixScavWarNullErrorWithMarkOfUnknownPatch().Enable();
new MergeScavPmcQuestsOnInventoryLoadPatch().Enable();
new CopyPmcQuestsToPlayerScavPatch().Enable();
new FixBossesHavingNoFollowersOnMediumAiAmount().Enable();
//new AllowAirdropsInPvEPatch().Enable();
HookObject.AddOrGetComponent<MenuNotificationManager>();
}
catch (Exception ex)
{
Logger.LogError($"A PATCH IN {GetType().Name} FAILED. SUBSEQUENT PATCHES HAVE NOT LOADED");
Logger.LogError($"{GetType().Name}: {ex}");
MessageBoxHelper.Show($"A patch in {GetType().Name} FAILED. {ex.Message}. SUBSEQUENT PATCHES HAVE NOT LOADED, CHECK LOG FOR MORE DETAILS", "ERROR", MessageBoxHelper.MessageBoxType.OK);
Application.Quit();
throw;
}
Logger.LogInfo("Completed: SPT.Custom");
}
}
}