0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 06:10:45 -05:00
modules/project/SPT.Custom/SPTCustomPlugin.cs

61 lines
2.4 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)]
2024-08-26 12:20:28 +01:00
public 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();
// Still need
new DisableNonHalloweenExitsDuringEventPatch().Enable();
2024-08-02 16:44:14 +01:00
new SendFleaListingTaxAmountToServerPatch().Enable();
new AddTraitorScavsPatch().Enable();
new CustomAiPatch().Enable();
2024-07-12 12:55:20 +01:00
new SaveSettingsToSptFolderPatch().Enable();
new SaveRegistryToSptFolderPatches().Enable();
new QTEPatch().Enable();
new RedirectClientImageRequestsPatch().Enable();
2024-08-01 17:36:01 +01:00
new DisableGameModeAdjustButtonPatch().Enable();
new FixPmcSpawnParamsNullErrorPatch().Enable();
new SetPreRaidSettingsScreenDefaultsPatch().Enable();
new CoreDifficultyPatch().Enable();
new BotDifficultyPatch().Enable();
new VersionLabelPatch().Enable();
new FixScavWarNullErrorWithMarkOfUnknownPatch().Enable();
2024-08-24 12:09:16 +01:00
new MergeScavPmcQuestsOnInventoryLoadPatch().Enable();
new CopyPmcQuestsToPlayerScavPatch().Enable();
new FixBossesHavingNoFollowersOnMediumAiAmount().Enable();
//new AllowAirdropsInPvEPatch().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
}
}
}