mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat(PluginInstaller): show changelog in collapsible, even for unupdated plugins
This commit is contained in:
parent
0e53619fa4
commit
797bcf7305
1 changed files with 33 additions and 19 deletions
|
|
@ -1409,6 +1409,7 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
|
@ -1503,33 +1504,46 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
ImGuiHelpers.ScaledDummy(5);
|
||||
|
||||
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)
|
||||
{
|
||||
ImGuiHelpers.ScaledDummy(5);
|
||||
|
||||
ImGui.PushStyleColor(ImGuiCol.ChildBg, this.changelogBgColor);
|
||||
ImGui.PushStyleColor(ImGuiCol.Text, this.changelogTextColor);
|
||||
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(7, 5));
|
||||
|
||||
if (ImGui.BeginChild("##changelog", new Vector2(-1, 100), true, ImGuiWindowFlags.NoNavFocus | ImGuiWindowFlags.NoNavInputs | ImGuiWindowFlags.AlwaysAutoResize))
|
||||
{
|
||||
ImGui.Text("Changelog:");
|
||||
ImGuiHelpers.ScaledDummy(2);
|
||||
ImGui.TextWrapped(plugin.Manifest.Changelog);
|
||||
}
|
||||
|
||||
ImGui.EndChild();
|
||||
|
||||
ImGui.PopStyleVar();
|
||||
ImGui.PopStyleColor(2);
|
||||
this.DrawInstalledPluginChangelog(plugin.Manifest);
|
||||
}
|
||||
|
||||
ImGui.PopID();
|
||||
}
|
||||
|
||||
private void DrawInstalledPluginChangelog(PluginManifest manifest)
|
||||
{
|
||||
ImGuiHelpers.ScaledDummy(5);
|
||||
|
||||
ImGui.PushStyleColor(ImGuiCol.ChildBg, this.changelogBgColor);
|
||||
ImGui.PushStyleColor(ImGuiCol.Text, this.changelogTextColor);
|
||||
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(7, 5));
|
||||
|
||||
if (ImGui.BeginChild("##changelog", new Vector2(-1, 100), true, ImGuiWindowFlags.NoNavFocus | ImGuiWindowFlags.NoNavInputs | ImGuiWindowFlags.AlwaysAutoResize))
|
||||
{
|
||||
ImGui.Text("Changelog:");
|
||||
ImGuiHelpers.ScaledDummy(2);
|
||||
ImGui.TextWrapped(manifest.Changelog);
|
||||
}
|
||||
|
||||
ImGui.EndChild();
|
||||
|
||||
ImGui.PopStyleVar();
|
||||
ImGui.PopStyleColor(2);
|
||||
}
|
||||
|
||||
private void DrawInstalledPluginContextMenu(LocalPlugin plugin)
|
||||
{
|
||||
var pluginManager = Service<PluginManager>.Get();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue