Remove support for legacy devplugins directory (#1219)

* remove support for legacy devPlugins directory

* bump CS

* fix copy

* remove legacy helptext
This commit is contained in:
Ava Chaney 2023-05-26 01:37:04 -07:00 committed by GitHub
parent 5361355ffd
commit 845a3fba4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 39 deletions

View file

@ -247,7 +247,6 @@ namespace Dalamud.Injector
var workingDirectory = startInfo.WorkingDirectory; var workingDirectory = startInfo.WorkingDirectory;
var configurationPath = startInfo.ConfigurationPath; var configurationPath = startInfo.ConfigurationPath;
var pluginDirectory = startInfo.PluginDirectory; var pluginDirectory = startInfo.PluginDirectory;
var defaultPluginDirectory = startInfo.DefaultPluginDirectory;
var assetDirectory = startInfo.AssetDirectory; var assetDirectory = startInfo.AssetDirectory;
var delayInitializeMs = startInfo.DelayInitializeMs; var delayInitializeMs = startInfo.DelayInitializeMs;
var logName = startInfo.LogName; var logName = startInfo.LogName;
@ -262,8 +261,6 @@ namespace Dalamud.Injector
configurationPath = args[i][key.Length..]; configurationPath = args[i][key.Length..];
else if (args[i].StartsWith(key = "--dalamud-plugin-directory=")) else if (args[i].StartsWith(key = "--dalamud-plugin-directory="))
pluginDirectory = args[i][key.Length..]; pluginDirectory = args[i][key.Length..];
else if (args[i].StartsWith(key = "--dalamud-dev-plugin-directory="))
defaultPluginDirectory = args[i][key.Length..];
else if (args[i].StartsWith(key = "--dalamud-asset-directory=")) else if (args[i].StartsWith(key = "--dalamud-asset-directory="))
assetDirectory = args[i][key.Length..]; assetDirectory = args[i][key.Length..];
else if (args[i].StartsWith(key = "--dalamud-delay-initialize=")) else if (args[i].StartsWith(key = "--dalamud-delay-initialize="))
@ -287,7 +284,6 @@ namespace Dalamud.Injector
workingDirectory ??= Directory.GetCurrentDirectory(); workingDirectory ??= Directory.GetCurrentDirectory();
configurationPath ??= Path.Combine(xivlauncherDir, "dalamudConfig.json"); configurationPath ??= Path.Combine(xivlauncherDir, "dalamudConfig.json");
pluginDirectory ??= Path.Combine(xivlauncherDir, "installedPlugins"); pluginDirectory ??= Path.Combine(xivlauncherDir, "installedPlugins");
defaultPluginDirectory ??= Path.Combine(xivlauncherDir, "devPlugins");
assetDirectory ??= Path.Combine(xivlauncherDir, "dalamudAssets", "dev"); assetDirectory ??= Path.Combine(xivlauncherDir, "dalamudAssets", "dev");
ClientLanguage clientLanguage; ClientLanguage clientLanguage;
@ -313,7 +309,6 @@ namespace Dalamud.Injector
startInfo.WorkingDirectory = workingDirectory; startInfo.WorkingDirectory = workingDirectory;
startInfo.ConfigurationPath = configurationPath; startInfo.ConfigurationPath = configurationPath;
startInfo.PluginDirectory = pluginDirectory; startInfo.PluginDirectory = pluginDirectory;
startInfo.DefaultPluginDirectory = defaultPluginDirectory;
startInfo.AssetDirectory = assetDirectory; startInfo.AssetDirectory = assetDirectory;
startInfo.Language = clientLanguage; startInfo.Language = clientLanguage;
startInfo.DelayInitializeMs = delayInitializeMs; startInfo.DelayInitializeMs = delayInitializeMs;
@ -367,7 +362,7 @@ namespace Dalamud.Injector
} }
Console.WriteLine("Specifying dalamud start info: [--dalamud-working-directory=path] [--dalamud-configuration-path=path]"); Console.WriteLine("Specifying dalamud start info: [--dalamud-working-directory=path] [--dalamud-configuration-path=path]");
Console.WriteLine(" [--dalamud-plugin-directory=path] [--dalamud-dev-plugin-directory=path]"); Console.WriteLine(" [--dalamud-plugin-directory=path]");
Console.WriteLine(" [--dalamud-asset-directory=path] [--dalamud-delay-initialize=0(ms)]"); Console.WriteLine(" [--dalamud-asset-directory=path] [--dalamud-delay-initialize=0(ms)]");
Console.WriteLine(" [--dalamud-client-language=0-3|j(apanese)|e(nglish)|d|g(erman)|f(rench)]"); Console.WriteLine(" [--dalamud-client-language=0-3|j(apanese)|e(nglish)|d|g(erman)|f(rench)]");

View file

@ -30,7 +30,6 @@ public record DalamudStartInfo : IServiceType
this.ConfigurationPath = other.ConfigurationPath; this.ConfigurationPath = other.ConfigurationPath;
this.LogName = other.LogName; this.LogName = other.LogName;
this.PluginDirectory = other.PluginDirectory; this.PluginDirectory = other.PluginDirectory;
this.DefaultPluginDirectory = other.DefaultPluginDirectory;
this.AssetDirectory = other.AssetDirectory; this.AssetDirectory = other.AssetDirectory;
this.Language = other.Language; this.Language = other.Language;
this.GameVersion = other.GameVersion; this.GameVersion = other.GameVersion;
@ -72,11 +71,6 @@ public record DalamudStartInfo : IServiceType
/// </summary> /// </summary>
public string? PluginDirectory { get; set; } public string? PluginDirectory { get; set; }
/// <summary>
/// Gets or sets the path to the directory for developer plugins.
/// </summary>
public string? DefaultPluginDirectory { get; set; }
/// <summary> /// <summary>
/// Gets or sets the path to core Dalamud assets. /// Gets or sets the path to core Dalamud assets.
/// </summary> /// </summary>

View file

@ -67,7 +67,7 @@ public class DevPluginsSettingsEntry : SettingsEntry
} }
} }
ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingsDevPluginLocationsHint", "Add additional dev plugin load locations.\nThese can be either the directory or DLL path.")); ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingsDevPluginLocationsHint", "Add dev plugin load locations.\nThese can be either the directory or DLL path."));
ImGuiHelpers.ScaledDummy(5); ImGuiHelpers.ScaledDummy(5);

View file

@ -57,15 +57,6 @@ internal partial class PluginManager : IDisposable, IServiceType
/// </summary> /// </summary>
public const int PluginWaitBeforeFreeDefault = 1000; // upped from 500ms, seems more stable public const int PluginWaitBeforeFreeDefault = 1000; // upped from 500ms, seems more stable
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 static readonly ModuleLog Log = new("PLUGINM");
private readonly object pluginListLock = new(); private readonly object pluginListLock = new();
@ -88,18 +79,10 @@ Thanks and have fun!";
private PluginManager() private PluginManager()
{ {
this.pluginDirectory = new DirectoryInfo(this.startInfo.PluginDirectory!); this.pluginDirectory = new DirectoryInfo(this.startInfo.PluginDirectory!);
this.devPluginDirectory = new DirectoryInfo(this.startInfo.DefaultPluginDirectory!);
if (!this.pluginDirectory.Exists) if (!this.pluginDirectory.Exists)
this.pluginDirectory.Create(); this.pluginDirectory.Create();
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; this.SafeMode = EnvironmentConfiguration.DalamudNoPlugins || this.configuration.PluginSafeMode || this.startInfo.NoLoadPlugins;
try try
@ -394,9 +377,6 @@ Thanks and have fun!";
if (!this.pluginDirectory.Exists) if (!this.pluginDirectory.Exists)
this.pluginDirectory.Create(); this.pluginDirectory.Create();
if (!this.devPluginDirectory.Exists)
this.devPluginDirectory.Create();
// Add installed plugins. These are expected to be in a specific format so we can look for exactly that. // Add installed plugins. These are expected to be in a specific format so we can look for exactly that.
foreach (var pluginDir in this.pluginDirectory.GetDirectories()) foreach (var pluginDir in this.pluginDirectory.GetDirectories())
{ {
@ -437,7 +417,7 @@ Thanks and have fun!";
} }
// devPlugins are more freeform. Look for any dll and hope to get lucky. // devPlugins are more freeform. Look for any dll and hope to get lucky.
var devDllFiles = this.devPluginDirectory.GetFiles("*.dll", SearchOption.AllDirectories).ToList(); var devDllFiles = new List<FileInfo>();
foreach (var setting in this.configuration.DevPluginLoadLocations) foreach (var setting in this.configuration.DevPluginLoadLocations)
{ {
@ -660,11 +640,8 @@ Thanks and have fun!";
/// </summary> /// </summary>
public void ScanDevPlugins() public void ScanDevPlugins()
{ {
if (!this.devPluginDirectory.Exists)
this.devPluginDirectory.Create();
// devPlugins are more freeform. Look for any dll and hope to get lucky. // devPlugins are more freeform. Look for any dll and hope to get lucky.
var devDllFiles = this.devPluginDirectory.GetFiles("*.dll", SearchOption.AllDirectories).ToList(); var devDllFiles = new List<FileInfo>();
foreach (var setting in this.configuration.DevPluginLoadLocations) foreach (var setting in this.configuration.DevPluginLoadLocations)
{ {

@ -1 +1 @@
Subproject commit 010e878febb631c8f3ff5ff90d656f318e35b1de Subproject commit 9a32b1565eeb0b237a427c242d7f0a78d4afbcfd