mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Merge pull request #754 from Aireil/add_categories
This commit is contained in:
commit
2a15da93d2
2 changed files with 43 additions and 9 deletions
|
|
@ -22,6 +22,8 @@ namespace Dalamud.Interface.Internal
|
|||
new(0, "special.all", () => Locs.Category_All),
|
||||
new(10, "special.devInstalled", () => Locs.Category_DevInstalled),
|
||||
new(11, "special.devIconTester", () => Locs.Category_IconTester),
|
||||
new(12, "special.dalamud", () => Locs.Category_Dalamud),
|
||||
new(13, "special.plugins", () => Locs.Category_Plugins),
|
||||
new(FirstTagBasedCategoryId + 0, "other", () => Locs.Category_Other),
|
||||
new(FirstTagBasedCategoryId + 1, "jobs", () => Locs.Category_Jobs),
|
||||
new(FirstTagBasedCategoryId + 2, "ui", () => Locs.Category_UI),
|
||||
|
|
@ -39,7 +41,7 @@ namespace Dalamud.Interface.Internal
|
|||
new(GroupKind.DevTools, () => Locs.Group_DevTools, 10, 11),
|
||||
new(GroupKind.Installed, () => Locs.Group_Installed, 0),
|
||||
new(GroupKind.Available, () => Locs.Group_Available, 0),
|
||||
new(GroupKind.Changelog, () => Locs.Group_Changelog, 0),
|
||||
new(GroupKind.Changelog, () => Locs.Group_Changelog, 0, 12, 13),
|
||||
|
||||
// order important, used for drawing, keep in sync with defaults for currentGroupIdx
|
||||
};
|
||||
|
|
@ -408,6 +410,10 @@ namespace Dalamud.Interface.Internal
|
|||
|
||||
public static string Category_Utility => Loc.Localize("InstallerCategoryUtility", "Utility");
|
||||
|
||||
public static string Category_Plugins => Loc.Localize("InstallerCategoryPlugins", "Plugins");
|
||||
|
||||
public static string Category_Dalamud => Loc.Localize("InstallerCategoryDalamud", "Dalamud");
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -513,7 +513,7 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
|
|||
}
|
||||
*/
|
||||
|
||||
private void DrawChangelogList()
|
||||
private void DrawChangelogList(bool displayDalamud, bool displayPlugins)
|
||||
{
|
||||
if (this.pluginListInstalled.Count == 0)
|
||||
{
|
||||
|
|
@ -537,12 +537,26 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
|
|||
return (IChangelogEntry)changelog;
|
||||
});
|
||||
|
||||
var changelogs = (this.dalamudChangelogManager.Changelogs != null
|
||||
? pluginChangelogs
|
||||
.Concat(this.dalamudChangelogManager.Changelogs.Select(x => new DalamudChangelogEntry(x, this.imageCache.CorePluginIcon)))
|
||||
: pluginChangelogs).OrderByDescending(x => x.Date).ToList();
|
||||
IEnumerable<IChangelogEntry> changelogs = null;
|
||||
if (displayDalamud && displayPlugins && this.dalamudChangelogManager.Changelogs != null)
|
||||
{
|
||||
changelogs = pluginChangelogs
|
||||
.Concat(this.dalamudChangelogManager.Changelogs.Select(
|
||||
x => new DalamudChangelogEntry(x, this.imageCache.CorePluginIcon)));
|
||||
}
|
||||
else if (displayDalamud && this.dalamudChangelogManager.Changelogs != null)
|
||||
{
|
||||
changelogs = this.dalamudChangelogManager.Changelogs.Select(
|
||||
x => new DalamudChangelogEntry(x, this.imageCache.CorePluginIcon));
|
||||
}
|
||||
else if (displayPlugins)
|
||||
{
|
||||
changelogs = pluginChangelogs;
|
||||
}
|
||||
|
||||
if (!changelogs.Any())
|
||||
var sortedChangelogs = changelogs?.OrderByDescending(x => x.Date).ToList();
|
||||
|
||||
if (sortedChangelogs == null || !sortedChangelogs.Any())
|
||||
{
|
||||
ImGui.TextColored(
|
||||
ImGuiColors.DalamudGrey2,
|
||||
|
|
@ -553,7 +567,7 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
|
|||
return;
|
||||
}
|
||||
|
||||
foreach (var logEntry in changelogs)
|
||||
foreach (var logEntry in sortedChangelogs)
|
||||
{
|
||||
this.DrawChangelog(logEntry);
|
||||
}
|
||||
|
|
@ -801,7 +815,21 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
|
|||
this.DrawInstalledPluginList();
|
||||
break;
|
||||
case PluginCategoryManager.GroupKind.Changelog:
|
||||
this.DrawChangelogList();
|
||||
switch (this.categoryManager.CurrentCategoryIdx)
|
||||
{
|
||||
case 0:
|
||||
this.DrawChangelogList(true, true);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
this.DrawChangelogList(true, false);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this.DrawChangelogList(false, true);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
this.DrawAvailablePluginList();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue