2023-03-03 18:52:31 +00:00
using System ;
2024-05-21 19:10:17 +01:00
using SPT.Common ;
using SPT.Custom.Airdrops.Patches ;
using SPT.Custom.BTR.Patches ;
using SPT.Custom.Patches ;
using SPT.Custom.Utils ;
using SPT.Reflection.Utils ;
using SPT.SinglePlayer.Utils.MainMenu ;
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
{
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
{
// Bundle patches should always load first
new EasyAssetsPatch ( ) . Enable ( ) ;
new EasyBundlePatch ( ) . Enable ( ) ;
new BossSpawnChancePatch ( ) . Enable ( ) ;
new BotDifficultyPatch ( ) . Enable ( ) ;
new CoreDifficultyPatch ( ) . Enable ( ) ;
new OfflineRaidMenuPatch ( ) . Enable ( ) ;
2023-07-07 15:01:45 +01:00
// Fixed in live, no need for patch
//new RaidSettingsWindowPatch().Enable();
2023-03-08 19:07:46 +02:00
new OfflineRaidSettingsMenuPatch ( ) . Enable ( ) ;
2024-01-13 22:08:29 +00:00
// new SessionIdPatch().Enable();
2023-03-03 18:52:31 +00:00
new VersionLabelPatch ( ) . Enable ( ) ;
new IsEnemyPatch ( ) . Enable ( ) ;
2024-02-22 09:13:09 +00:00
new BotCalledDataTryCallPatch ( ) . Enable ( ) ;
new BotCallForHelpCallBotPatch ( ) . Enable ( ) ;
new BotOwnerDisposePatch ( ) . Enable ( ) ;
2023-10-10 10:58:33 +00:00
new LocationLootCacheBustingPatch ( ) . Enable ( ) ;
2023-03-03 18:52:31 +00:00
//new AddSelfAsEnemyPatch().Enable();
new CheckAndAddEnemyPatch ( ) . Enable ( ) ;
new BotSelfEnemyPatch ( ) . Enable ( ) ; // needed
new AddEnemyToAllGroupsInBotZonePatch ( ) . Enable ( ) ;
new AirdropPatch ( ) . Enable ( ) ;
new AirdropFlarePatch ( ) . Enable ( ) ;
new AddSptBotSettingsPatch ( ) . Enable ( ) ;
new CustomAiPatch ( ) . Enable ( ) ;
2024-02-11 10:33:59 +00:00
new AddTraitorScavsPatch ( ) . Enable ( ) ;
2023-03-03 18:52:31 +00:00
new ExitWhileLootingPatch ( ) . Enable ( ) ;
new QTEPatch ( ) . Enable ( ) ;
2023-07-27 21:00:26 +01:00
new PmcFirstAidPatch ( ) . Enable ( ) ;
2023-10-10 10:58:33 +00:00
new SettingsLocationPatch ( ) . Enable ( ) ;
2024-01-03 08:57:57 +00:00
new SetLocationIdOnRaidStartPatch ( ) . Enable ( ) ;
2023-10-10 10:58:33 +00:00
//new RankPanelPatch().Enable();
new RagfairFeePatch ( ) . Enable ( ) ;
2023-10-21 21:44:06 +01:00
new ScavQuestPatch ( ) . Enable ( ) ;
2024-01-18 20:59:33 +00:00
new FixBrokenSpawnOnSandboxPatch ( ) . Enable ( ) ;
2024-04-07 08:05:07 +00:00
new BTRControllerInitPatch ( ) . Enable ( ) ;
2024-01-23 08:47:09 +00:00
new BTRPathLoadPatch ( ) . Enable ( ) ;
new BTRActivateTraderDialogPatch ( ) . Enable ( ) ;
new BTRInteractionPatch ( ) . Enable ( ) ;
new BTRExtractPassengersPatch ( ) . Enable ( ) ;
2024-01-25 08:52:33 +00:00
new BTRBotAttachPatch ( ) . Enable ( ) ;
2024-01-23 08:47:09 +00:00
new BTRReceiveDamageInfoPatch ( ) . Enable ( ) ;
new BTRTurretCanShootPatch ( ) . Enable ( ) ;
new BTRTurretDefaultAimingPositionPatch ( ) . Enable ( ) ;
new BTRIsDoorsClosedPath ( ) . Enable ( ) ;
new BTRPatch ( ) . Enable ( ) ;
new BTRTransferItemsPatch ( ) . Enable ( ) ;
new BTREndRaidItemDeliveryPatch ( ) . Enable ( ) ;
2024-01-27 09:05:33 +00:00
new BTRDestroyAtRaidEndPatch ( ) . Enable ( ) ;
2024-01-30 09:37:33 +00:00
new BTRVehicleMovementSpeedPatch ( ) . Enable ( ) ;
2024-05-05 20:45:08 +00:00
new BTRPathConfigMapPrefixPatch ( ) . Enable ( ) ;
2024-02-10 18:07:45 +00:00
new ScavItemCheckmarkPatch ( ) . Enable ( ) ;
2024-02-12 09:22:45 +00:00
new ResetTraderServicesPatch ( ) . Enable ( ) ;
2024-02-25 17:36:27 +00:00
new CultistAmuletRemovalPatch ( ) . Enable ( ) ;
2024-03-17 12:47:59 +00:00
new HalloweenExtractPatch ( ) . Enable ( ) ;
2024-04-01 14:03:10 +01:00
new ClampRagdollPatch ( ) . Enable ( ) ;
2024-04-28 08:17:13 +00:00
new DisablePvEPatch ( ) . Enable ( ) ;
2024-05-22 19:57:31 +00:00
new InsurancePlaceItem ( ) . Enable ( ) ;
2024-02-12 09:22:45 +00:00
2024-03-11 08:44:50 +00:00
HookObject . AddOrGetComponent < MenuNotificationManager > ( ) ;
}
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
}
}
}