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

73 lines
2.9 KiB
C#
Raw Normal View History

2023-03-03 18:52:31 +00:00
using System;
2024-05-21 19:10:17 +01:00
using SPT.Common;
using SPT.Custom.Patches;
using SPT.Custom.Utils;
using SPT.Reflection.Utils;
2023-03-03 18:52:31 +00:00
using BepInEx;
2024-03-14 17:18:06 +00:00
using UnityEngine;
2023-03-03 18:52:31 +00:00
2024-05-21 19:10:17 +01:00
namespace SPT.Custom
2023-03-03 18:52:31 +00:00
{
2024-05-21 19:10:17 +01:00
[BepInPlugin("com.SPT.custom", "SPT.Custom", SPTPluginInfo.PLUGIN_VERSION)]
class SPTCustomPlugin : BaseUnityPlugin
2023-03-03 18:52:31 +00:00
{
public void Awake()
2023-03-03 18:52:31 +00:00
{
2024-05-21 17:44:27 +01:00
Logger.LogInfo("Loading: SPT.Custom");
2023-03-03 18:52:31 +00:00
try
{
// Bundle patches should always load first - DO NOT REMOVE
2023-03-03 18:52:31 +00:00
new EasyAssetsPatch().Enable();
new EasyBundlePatch().Enable();
// TODO: check if these patches are needed
2024-07-11 10:49:27 +01:00
new AddEnemyTryCallFailureFixPatch().Enable();
new BotCallForHelpWrongTargetLocationPatch().Enable();
new BotOwnerDisposePatch().Enable();
2024-07-11 10:48:25 +01:00
new BotsGroupLetBossesShootPmcsPatch().Enable();
2023-03-03 18:52:31 +00:00
new CustomAiPatch().Enable();
new AddTraitorScavsPatch().Enable();
new PmcTakesAgesToHealLimbsPatch().Enable();
new SendFleaListingTaxAmountToServerPatch().Enable();
new DisableNonHalloweenExitsDuringEventPatch().Enable();
2024-07-12 14:49:39 +01:00
// new SetLocationIdOnRaidStartPatch().Enable();
// new AllScavsHostileHostileToPlayerScavPatch().Enable();
// new CopyPmcQuestsToPlayerScavPatch().Enable();
// new MergeScavPmcQuestsOnInventoryLoadPatch().Enable();
// Needed but needs editing
new IsEnemyPatch().Enable();
// Still need
2024-07-12 12:55:20 +01:00
new SaveSettingsToSptFolderPatch().Enable();
new QTEPatch().Enable();
new FileCachePatch().Enable();
new BotSelfEnemyPatch().Enable();
new DisableGamemodeButtonPatch().Enable();
new PMCSpawnParamPatch().Enable();
new SetPreRaidSettingsScreenDefaultsPatch().Enable();
new CoreDifficultyPatch().Enable();
new BotDifficultyPatch().Enable();
new BossSpawnChancePatch().Enable();
new LocationLootCacheBustingPatch().Enable();
new VersionLabelPatch().Enable();
2024-07-07 09:24:33 +00:00
new FixBotgroupMarkofTheUnknown().Enable();
HookObject.AddOrGetComponent<MenuNotificationManager>();
}
2023-03-03 18:52:31 +00:00
catch (Exception ex)
{
Logger.LogError($"A PATCH IN {GetType().Name} FAILED. SUBSEQUENT PATCHES HAVE NOT LOADED");
2023-03-03 18:52:31 +00:00
Logger.LogError($"{GetType().Name}: {ex}");
2024-03-14 17:18:06 +00:00
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();
2023-03-03 18:52:31 +00:00
throw;
}
2024-05-21 19:10:17 +01:00
Logger.LogInfo("Completed: SPT.Custom");
2023-03-03 18:52:31 +00:00
}
}
}