0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs
DrakiaXYZ a1f4f57d07 Notify users of BepInEx plugin dependency failures (!13)
Add a new patch that's called on the first MenuScreen show to indicate any BepInEx plugins that failed to load
- Will pop up a toast in the bottom right
- Will write the error message to the in-game console
- Will write the error message to the BepInEx console

Messages will only be shown on the first load of the main menu so as to avoid spamming the toasts and console

Example Images:
![Toast](https://i.imgur.com/k6d7dud.png)

![In-Game Console](https://i.imgur.com/Z7O6Mis.png)

![BepInEx Console](https://i.imgur.com/tJBK86S.png)

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#13
Reviewed-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2023-07-09 07:20:48 +00:00

64 lines
2.4 KiB
C#

using System;
using Aki.Common;
using Aki.SinglePlayer.Patches.Healing;
using Aki.SinglePlayer.Patches.MainMenu;
using Aki.SinglePlayer.Patches.Progression;
using Aki.SinglePlayer.Patches.Quests;
using Aki.SinglePlayer.Patches.RaidFix;
using Aki.SinglePlayer.Patches.ScavMode;
using BepInEx;
namespace Aki.SinglePlayer
{
[BepInPlugin("com.spt-aki.singleplayer", "AKI.Singleplayer", AkiPluginInfo.PLUGIN_VERSION)]
class AkiSingleplayerPlugin : BaseUnityPlugin
{
public AkiSingleplayerPlugin()
{
Logger.LogInfo("Loading: Aki.SinglePlayer");
try
{
new OfflineSaveProfilePatch().Enable();
new OfflineSpawnPointPatch().Enable();
new ExperienceGainPatch().Enable();
new MainMenuControllerPatch().Enable();
new PlayerPatch().Enable();
new SelectLocationScreenPatch().Enable();
new InsuranceScreenPatch().Enable();
new BotTemplateLimitPatch().Enable();
new GetNewBotTemplatesPatch().Enable();
new RemoveUsedBotProfilePatch().Enable();
new DogtagPatch().Enable();
new LoadOfflineRaidScreenPatch().Enable();
new ScavPrefabLoadPatch().Enable();
new ScavProfileLoadPatch().Enable();
new ScavExfilPatch().Enable();
new ExfilPointManagerPatch().Enable();
new TinnitusFixPatch().Enable();
new MaxBotPatch().Enable();
new SpawnPmcPatch().Enable();
new PostRaidHealingPricePatch().Enable();
new EndByTimerPatch().Enable();
new PostRaidHealScreenPatch().Enable();
new VoIPTogglerPatch().Enable();
new MidRaidQuestChangePatch().Enable();
new HealthControllerPatch().Enable();
new LighthouseBridgePatch().Enable();
new LighthouseTransmitterPatch().Enable();
new EmptyInfilFixPatch().Enable();
new SmokeGrenadeFuseSoundFixPatch().Enable();
new PlayerToggleSoundFixPatch().Enable();
new PluginErrorNotifierPatch().Enable();
}
catch (Exception ex)
{
Logger.LogError($"{GetType().Name}: {ex}");
throw;
}
Logger.LogInfo("Completed: Aki.SinglePlayer");
}
}
}