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
{
2023-11-13 12:10:44 +02: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
{
2024-07-06 10:23:41 +01:00
// Bundle patches should always load first - DO NOT REMOVE
2023-03-03 18:52:31 +00:00
new EasyAssetsPatch ( ) . Enable ( ) ;
new EasyBundlePatch ( ) . Enable ( ) ;
2024-08-29 09:32:57 +01:00
2024-07-06 10:23:41 +01:00
// Still need
2024-08-29 09:32:57 +01:00
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 ( ) ;
2024-10-26 08:15:12 +00:00
new SaveRegistryToSptFolderPatches ( ) . Enable ( ) ;
2024-07-08 15:44:45 +01:00
new QTEPatch ( ) . Enable ( ) ;
2024-08-01 17:31:50 +01:00
new RedirectClientImageRequestsPatch ( ) . Enable ( ) ;
2024-08-01 17:36:01 +01:00
new DisableGameModeAdjustButtonPatch ( ) . Enable ( ) ;
new FixPmcSpawnParamsNullErrorPatch ( ) . Enable ( ) ;
2024-07-08 14:57:24 +01:00
new SetPreRaidSettingsScreenDefaultsPatch ( ) . Enable ( ) ;
2024-07-06 10:23:41 +01:00
new CoreDifficultyPatch ( ) . Enable ( ) ;
new BotDifficultyPatch ( ) . Enable ( ) ;
new VersionLabelPatch ( ) . Enable ( ) ;
2024-08-25 09:24:10 +01:00
new FixScavWarNullErrorWithMarkOfUnknownPatch ( ) . Enable ( ) ;
2024-08-24 12:09:16 +01:00
new MergeScavPmcQuestsOnInventoryLoadPatch ( ) . Enable ( ) ;
new CopyPmcQuestsToPlayerScavPatch ( ) . Enable ( ) ;
2024-10-21 14:23:41 +01:00
new FixBossesHavingNoFollowersOnMediumAiAmount ( ) . Enable ( ) ;
2024-09-27 09:39:12 +01:00
//new AllowAirdropsInPvEPatch().Enable();
2024-02-12 09:22:45 +00:00
2024-08-01 21:13:43 +01:00
HookObject . AddOrGetComponent < MenuNotificationManager > ( ) ;
2024-03-11 08:44:50 +00:00
}
2023-03-03 18:52:31 +00:00
catch ( Exception ex )
{
2023-10-10 10:58:33 +00:00
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 ( ) ;
2024-03-14 17:08:20 +00:00
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
}
}
}