0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 06:50:44 -05:00
modules/project/SPT.Custom/SPTCustomPlugin.cs
Dev 24de63b705 Rename various patches for clarity
Disable `SetLocationIdOnRaidStartPatch` as it's not unnecessary
2024-07-11 11:18:00 +01:00

75 lines
2.9 KiB
C#

using System;
using SPT.Common;
using SPT.Custom.Patches;
using SPT.Custom.Utils;
using SPT.Reflection.Utils;
using SPT.SinglePlayer.Utils.MainMenu;
using BepInEx;
using UnityEngine;
namespace SPT.Custom
{
[BepInPlugin("com.SPT.custom", "SPT.Custom", SPTPluginInfo.PLUGIN_VERSION)]
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();
// TODO: check if these patches are needed
new AddEnemyTryCallFailureFixPatch().Enable();
new BotCallForHelpWrongTargetLocationPatch().Enable();
new BotOwnerDisposePatch().Enable();
new BotsGroupLetBossesShootPmcsPatch().Enable();
new AllScavsHostileHostileToPlayerScavPatch().Enable();
new CustomAiPatch().Enable();
new AddTraitorScavsPatch().Enable();
new PmcTakesAgesToHealLimbsPatch().Enable();
new SaveSettingsToSptFolderPatch().Enable();
//new SetLocationIdOnRaidStartPatch().Enable();
new RagfairFeePatch().Enable();
new ScavQuestPatch().Enable();
new ScavItemCheckmarkPatch().Enable();
new HalloweenExtractPatch().Enable();
// Needed but needs editing
new IsEnemyPatch().Enable();
// Still need
new QTEPatch().Enable();
new FileCachePatch().Enable();
new BotSelfEnemyPatch().Enable();
new DisablePvEPatch().Enable();
new ClampRagdollPatch().Enable();
new PMCSpawnParamPatch().Enable();
new SetPreRaidSettingsScreenDefaultsPatch().Enable();
new CoreDifficultyPatch().Enable();
new BotDifficultyPatch().Enable();
new BossSpawnChancePatch().Enable();
new LocationLootCacheBustingPatch().Enable();
new VersionLabelPatch().Enable();
new FixBotgroupMarkofTheUnknown().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");
}
}
}