formatting

This commit is contained in:
Raymond 2021-09-20 19:42:50 -04:00
parent e29a312c52
commit 0cfbc70286
4 changed files with 14 additions and 17 deletions

View file

@ -873,8 +873,8 @@ namespace Dalamud.Interface.Internal.Windows
// Download count // Download count
var downloadCountText = manifest.DownloadCount > 0 var downloadCountText = manifest.DownloadCount > 0
? Locs.PluginBody_AuthorWithDownloadCount(manifest.Author, manifest.DownloadCount) ? Locs.PluginBody_AuthorWithDownloadCount(manifest.Author, manifest.DownloadCount)
: Locs.PluginBody_AuthorWithDownloadCountUnavailable(manifest.Author); : Locs.PluginBody_AuthorWithDownloadCountUnavailable(manifest.Author);
ImGui.SameLine(); ImGui.SameLine();
ImGui.TextColored(ImGuiColors.DalamudGrey3, downloadCountText); ImGui.TextColored(ImGuiColors.DalamudGrey3, downloadCountText);

View file

@ -145,19 +145,17 @@ namespace Dalamud.Plugin.Internal
return; return;
} }
var notificationManager = Service<NotificationManager>.Get();
try try
{ {
this.Reload(); this.Reload();
Service<NotificationManager>.Get() notificationManager.AddNotification($"The DevPlugin '{this.Name} was reloaded successfully.", "Plugin reloaded!", NotificationType.Success);
.AddNotification(
$"The DevPlugin '{this.Name} was reloaded successfully.", "Plugin reloaded!", NotificationType.Success);
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Error(ex, "DevPlugin reload failed."); Log.Error(ex, "DevPlugin reload failed.");
Service<NotificationManager>.Get() notificationManager.AddNotification($"The DevPlugin '{this.Name} could not be reloaded.", "Plugin reload failed!", NotificationType.Error);
.AddNotification(
$"The DevPlugin '{this.Name} could not be reloaded.", "Plugin reload failed!", NotificationType.Error);
} }
}, },
this.fileWatcherTokenSource.Token); this.fileWatcherTokenSource.Token);

View file

@ -86,10 +86,8 @@ namespace Dalamud.Plugin.Internal
var assemblyVersion = this.pluginAssembly.GetName().Version; 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.manifestFile = LocalPluginManifest.GetManifestFile(this.DllFile);
this.disabledFile = LocalPluginManifest.GetDisabledFile(this.DllFile);
this.testingFile = LocalPluginManifest.GetTestingFile(this.DllFile);
// If the parameter manifest was null // If the parameter manifest was null
if (manifest == 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. // 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. // We'll update the name property after it can be retrieved from the instance.
var manifestFile = LocalPluginManifest.GetManifestFile(this.DllFile); this.Manifest.Save(this.manifestFile);
this.Manifest.Save(manifestFile);
} }
else else
{ {
this.Manifest = manifest; 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) if (this.disabledFile.Exists)
{ {
this.Manifest.Disabled = true; this.Manifest.Disabled = true;
this.disabledFile.Delete(); 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) if (this.testingFile.Exists)
{ {
this.Manifest.Testing = true; this.Manifest.Testing = true;

View file

@ -553,13 +553,13 @@ namespace Dalamud.Plugin.Internal
if (plugin.IsDev) if (plugin.IsDev)
{ {
// Dev plugins always get added to the list so they can be fiddled with in the UI // 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 plugin.Disable(); // Disable here, otherwise you can't enable+load later
} }
else if (plugin.Manifest.DalamudApiLevel < DalamudApiLevel) else if (plugin.Manifest.DalamudApiLevel < DalamudApiLevel)
{ {
// Out of date plugins get added so they can be updated. // 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. // plugin.Disable(); // Don't disable, or it gets deleted next boot.
} }
else else