From 0cfbc70286a30661e16f7bf879bfd9c623500d62 Mon Sep 17 00:00:00 2001 From: Raymond Date: Mon, 20 Sep 2021 19:42:50 -0400 Subject: [PATCH] formatting --- .../Internal/Windows/PluginInstallerWindow.cs | 4 ++-- Dalamud/Plugin/Internal/LocalDevPlugin.cs | 10 ++++------ Dalamud/Plugin/Internal/LocalPlugin.cs | 13 ++++++------- Dalamud/Plugin/Internal/PluginManager.cs | 4 ++-- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs index c7fc934a1..84ca51b42 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs @@ -873,8 +873,8 @@ namespace Dalamud.Interface.Internal.Windows // Download count var downloadCountText = manifest.DownloadCount > 0 - ? Locs.PluginBody_AuthorWithDownloadCount(manifest.Author, manifest.DownloadCount) - : Locs.PluginBody_AuthorWithDownloadCountUnavailable(manifest.Author); + ? Locs.PluginBody_AuthorWithDownloadCount(manifest.Author, manifest.DownloadCount) + : Locs.PluginBody_AuthorWithDownloadCountUnavailable(manifest.Author); ImGui.SameLine(); ImGui.TextColored(ImGuiColors.DalamudGrey3, downloadCountText); diff --git a/Dalamud/Plugin/Internal/LocalDevPlugin.cs b/Dalamud/Plugin/Internal/LocalDevPlugin.cs index d8e0d94e0..3615c01a9 100644 --- a/Dalamud/Plugin/Internal/LocalDevPlugin.cs +++ b/Dalamud/Plugin/Internal/LocalDevPlugin.cs @@ -145,19 +145,17 @@ namespace Dalamud.Plugin.Internal return; } + var notificationManager = Service.Get(); + try { this.Reload(); - Service.Get() - .AddNotification( - $"The DevPlugin '{this.Name} was reloaded successfully.", "Plugin reloaded!", NotificationType.Success); + notificationManager.AddNotification($"The DevPlugin '{this.Name} was reloaded successfully.", "Plugin reloaded!", NotificationType.Success); } catch (Exception ex) { Log.Error(ex, "DevPlugin reload failed."); - Service.Get() - .AddNotification( - $"The DevPlugin '{this.Name} could not be reloaded.", "Plugin reload failed!", NotificationType.Error); + notificationManager.AddNotification($"The DevPlugin '{this.Name} could not be reloaded.", "Plugin reload failed!", NotificationType.Error); } }, this.fileWatcherTokenSource.Token); diff --git a/Dalamud/Plugin/Internal/LocalPlugin.cs b/Dalamud/Plugin/Internal/LocalPlugin.cs index d51b14303..0d9985602 100644 --- a/Dalamud/Plugin/Internal/LocalPlugin.cs +++ b/Dalamud/Plugin/Internal/LocalPlugin.cs @@ -86,10 +86,8 @@ namespace Dalamud.Plugin.Internal var assemblyVersion = this.pluginAssembly.GetName().Version; - // Files that may or may not exist + // Although it is conditionally used here, we need to set the initial value regardless. this.manifestFile = LocalPluginManifest.GetManifestFile(this.DllFile); - this.disabledFile = LocalPluginManifest.GetDisabledFile(this.DllFile); - this.testingFile = LocalPluginManifest.GetTestingFile(this.DllFile); // If the parameter manifest was null if (manifest == null) @@ -108,22 +106,23 @@ namespace Dalamud.Plugin.Internal // Save the manifest to disk so there won't be any problems later. // We'll update the name property after it can be retrieved from the instance. - var manifestFile = LocalPluginManifest.GetManifestFile(this.DllFile); - this.Manifest.Save(manifestFile); + this.Manifest.Save(this.manifestFile); } else { this.Manifest = manifest; } - // This bit converts from ".disabled" functionality to using the manifest. + // This converts from the ".disabled" file feature to the manifest instead. + this.disabledFile = LocalPluginManifest.GetDisabledFile(this.DllFile); if (this.disabledFile.Exists) { this.Manifest.Disabled = true; this.disabledFile.Delete(); } - // This bit converts from ".testing" functionality to using the manifest. + // This converts from the ".testing" file feature to the manifest instead. + this.testingFile = LocalPluginManifest.GetTestingFile(this.DllFile); if (this.testingFile.Exists) { this.Manifest.Testing = true; diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index 81d5b92a8..47e3ca478 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -553,13 +553,13 @@ namespace Dalamud.Plugin.Internal if (plugin.IsDev) { // Dev plugins always get added to the list so they can be fiddled with in the UI - Log.Information(ex, $"Dev plugin failed to load, adding anyways: {dllFile.Name}"); + Log.Information(ex, $"Dev plugin failed to load, adding anyways: {dllFile.Name}"); plugin.Disable(); // Disable here, otherwise you can't enable+load later } else if (plugin.Manifest.DalamudApiLevel < DalamudApiLevel) { // Out of date plugins get added so they can be updated. - Log.Information(ex, $"Plugin was outdated, adding anyways: {dllFile.Name}"); + Log.Information(ex, $"Plugin was outdated, adding anyways: {dllFile.Name}"); // plugin.Disable(); // Don't disable, or it gets deleted next boot. } else