feat(PluginInstaller): show changelog in collapsible, even for unupdated plugins

This commit is contained in:
goaaats 2022-02-03 03:08:47 +01:00
parent 0e53619fa4
commit 797bcf7305
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -1409,6 +1409,7 @@ namespace Dalamud.Interface.Internal.Windows
} }
ImGui.PushID($"installed{index}{plugin.Manifest.InternalName}"); ImGui.PushID($"installed{index}{plugin.Manifest.InternalName}");
var hasChangelog = !plugin.Manifest.Changelog.IsNullOrEmpty();
if (this.DrawPluginCollapsingHeader(label, plugin, plugin.Manifest, plugin.Manifest.IsThirdParty, trouble, availablePluginUpdate != default, false, () => this.DrawInstalledPluginContextMenu(plugin), index)) if (this.DrawPluginCollapsingHeader(label, plugin, plugin.Manifest, plugin.Manifest.IsThirdParty, trouble, availablePluginUpdate != default, false, () => this.DrawInstalledPluginContextMenu(plugin), index))
{ {
@ -1503,9 +1504,25 @@ namespace Dalamud.Interface.Internal.Windows
ImGuiHelpers.ScaledDummy(5); ImGuiHelpers.ScaledDummy(5);
ImGui.Unindent(); ImGui.Unindent();
if (hasChangelog)
{
if (ImGui.TreeNode($"Changelog (v{plugin.Manifest.AssemblyVersion})"))
{
this.DrawInstalledPluginChangelog(plugin.Manifest);
}
}
} }
if (thisWasUpdated && !plugin.Manifest.Changelog.IsNullOrEmpty()) if (thisWasUpdated && hasChangelog)
{
this.DrawInstalledPluginChangelog(plugin.Manifest);
}
ImGui.PopID();
}
private void DrawInstalledPluginChangelog(PluginManifest manifest)
{ {
ImGuiHelpers.ScaledDummy(5); ImGuiHelpers.ScaledDummy(5);
@ -1518,7 +1535,7 @@ namespace Dalamud.Interface.Internal.Windows
{ {
ImGui.Text("Changelog:"); ImGui.Text("Changelog:");
ImGuiHelpers.ScaledDummy(2); ImGuiHelpers.ScaledDummy(2);
ImGui.TextWrapped(plugin.Manifest.Changelog); ImGui.TextWrapped(manifest.Changelog);
} }
ImGui.EndChild(); ImGui.EndChild();
@ -1527,9 +1544,6 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.PopStyleColor(2); ImGui.PopStyleColor(2);
} }
ImGui.PopID();
}
private void DrawInstalledPluginContextMenu(LocalPlugin plugin) private void DrawInstalledPluginContextMenu(LocalPlugin plugin)
{ {
var pluginManager = Service<PluginManager>.Get(); var pluginManager = Service<PluginManager>.Get();