feat: add PluginSafeMode

This commit is contained in:
goat 2021-08-19 23:39:34 +02:00
parent d05a259efc
commit 35aadbe575
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 16 additions and 0 deletions

View file

@ -184,6 +184,12 @@ namespace Dalamud.Configuration.Internal
/// </summary>
public bool LoadAllApiLevels { get; set; }
/// <summary>
/// Gets or sets a value indicating whether or not any plugin should be loaded when the game is started.
/// It is reset immediately when read.
/// </summary>
public bool PluginSafeMode { get; set; }
/// <summary>
/// Load a configuration from the provided path.
/// </summary>

View file

@ -159,6 +159,16 @@ namespace Dalamud.Plugin.Internal
/// </summary>
public void LoadAllPlugins()
{
if (this.dalamud.Configuration.PluginSafeMode)
{
Log.Information("PluginSafeMode was enabled, not loading any plugins.");
this.dalamud.Configuration.PluginSafeMode = false;
this.dalamud.Configuration.Save();
return;
}
var pluginDefs = new List<PluginDef>();
var devPluginDefs = new List<PluginDef>();