feat: create a deprecation disclaimer file in devPlugins

This commit is contained in:
goat 2022-10-23 16:20:06 +02:00
parent 94a8d0c7f9
commit 8565cbc5ea
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -45,6 +45,15 @@ internal partial class PluginManager : IDisposable, IServiceType
/// </summary>
public const int PluginWaitBeforeFreeDefault = 500;
private const string DevPluginsDisclaimerFilename = "DONT_USE_THIS_FOLDER.txt";
private const string DevPluginsDisclaimerText = @"Hey!
The devPlugins folder is deprecated and will be removed soon. Please don't use it anymore for plugin development.
Instead, open the Dalamud settings and add the path to your plugins build output folder as a dev plugin location.
Remove your devPlugin from this folder.
Thanks and have fun!";
private static readonly ModuleLog Log = new("PLUGINM");
private readonly object pluginListLock = new();
@ -72,6 +81,10 @@ internal partial class PluginManager : IDisposable, IServiceType
if (!this.devPluginDirectory.Exists)
this.devPluginDirectory.Create();
var disclaimerFileName = Path.Combine(this.devPluginDirectory.FullName, DevPluginsDisclaimerFilename);
if (!File.Exists(disclaimerFileName))
File.WriteAllText(disclaimerFileName, DevPluginsDisclaimerText);
this.SafeMode = EnvironmentConfiguration.DalamudNoPlugins || this.configuration.PluginSafeMode || this.startInfo.NoLoadPlugins;
try