pi: don't use indices to refer to groups and categories

Fixes some bugs I bugged into the codebase by adding a new category inbetween two others
This commit is contained in:
goat 2024-06-19 00:26:14 +02:00
parent 3509a0bdca
commit a8025298ea
2 changed files with 215 additions and 116 deletions

View file

@ -16,47 +16,49 @@ internal class PluginCategoryManager
/// <summary>
/// First categoryId for tag based categories.
/// </summary>
public const int FirstTagBasedCategoryId = 100;
private const int FirstTagBasedCategoryId = 100;
private readonly CategoryInfo[] categoryList =
{
new(0, "special.all", () => Locs.Category_All),
new(1, "special.isTesting", () => Locs.Category_IsTesting, CategoryInfo.AppearCondition.DoPluginTest),
new(2, "special.availableForTesting", () => Locs.Category_AvailableForTesting, CategoryInfo.AppearCondition.DoPluginTest),
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(14, "special.profiles", () => Locs.Category_PluginProfiles),
new(15, "special.updateable", () => Locs.Category_UpdateablePlugins),
new(FirstTagBasedCategoryId + 0, "other", () => Locs.Category_Other),
new(FirstTagBasedCategoryId + 1, "jobs", () => Locs.Category_Jobs),
new(FirstTagBasedCategoryId + 2, "ui", () => Locs.Category_UI),
new(FirstTagBasedCategoryId + 3, "minigames", () => Locs.Category_MiniGames),
new(FirstTagBasedCategoryId + 4, "inventory", () => Locs.Category_Inventory),
new(FirstTagBasedCategoryId + 5, "sound", () => Locs.Category_Sound),
new(FirstTagBasedCategoryId + 6, "social", () => Locs.Category_Social),
new(FirstTagBasedCategoryId + 7, "utility", () => Locs.Category_Utility),
[
new(CategoryKind.All, "special.all", () => Locs.Category_All),
new(CategoryKind.IsTesting, "special.isTesting", () => Locs.Category_IsTesting, CategoryInfo.AppearCondition.DoPluginTest),
new(CategoryKind.AvailableForTesting, "special.availableForTesting", () => Locs.Category_AvailableForTesting, CategoryInfo.AppearCondition.DoPluginTest),
new(CategoryKind.DevInstalled, "special.devInstalled", () => Locs.Category_DevInstalled),
new(CategoryKind.IconTester, "special.devIconTester", () => Locs.Category_IconTester),
new(CategoryKind.DalamudChangelogs, "special.dalamud", () => Locs.Category_Dalamud),
new(CategoryKind.PluginChangelogs, "special.plugins", () => Locs.Category_Plugins),
new(CategoryKind.PluginProfiles, "special.profiles", () => Locs.Category_PluginProfiles),
new(CategoryKind.UpdateablePlugins, "special.updateable", () => Locs.Category_UpdateablePlugins),
// Tag-driven categories
new(CategoryKind.Other, "other", () => Locs.Category_Other),
new(CategoryKind.Jobs, "jobs", () => Locs.Category_Jobs),
new(CategoryKind.Ui, "ui", () => Locs.Category_UI),
new(CategoryKind.MiniGames, "minigames", () => Locs.Category_MiniGames),
new(CategoryKind.Inventory, "inventory", () => Locs.Category_Inventory),
new(CategoryKind.Sound, "sound", () => Locs.Category_Sound),
new(CategoryKind.Social, "social", () => Locs.Category_Social),
new(CategoryKind.Utility, "utility", () => Locs.Category_Utility)
// order doesn't matter, all tag driven categories should have Id >= FirstTagBasedCategoryId
};
];
private GroupInfo[] groupList =
{
new(GroupKind.DevTools, () => Locs.Group_DevTools, 10, 11),
new(GroupKind.Installed, () => Locs.Group_Installed, 0, 1, 15, 14),
new(GroupKind.Available, () => Locs.Group_Available, 0),
new(GroupKind.Changelog, () => Locs.Group_Changelog, 0, 12, 13),
[
new(GroupKind.DevTools, () => Locs.Group_DevTools, CategoryKind.DevInstalled, CategoryKind.IconTester),
new(GroupKind.Installed, () => Locs.Group_Installed, CategoryKind.All, CategoryKind.IsTesting, CategoryKind.UpdateablePlugins, CategoryKind.PluginProfiles),
new(GroupKind.Available, () => Locs.Group_Available, CategoryKind.All),
new(GroupKind.Changelog, () => Locs.Group_Changelog, CategoryKind.All, CategoryKind.DalamudChangelogs, CategoryKind.PluginChangelogs)
// order important, used for drawing, keep in sync with defaults for currentGroupIdx
};
];
private int currentGroupIdx = 2;
private int currentCategoryIdx = 0;
private CategoryKind currentCategoryKind = CategoryKind.All;
private bool isContentDirty;
private Dictionary<PluginManifest, int[]> mapPluginCategories = new();
private List<int> highlightedCategoryIds = new();
private Dictionary<PluginManifest, CategoryKind[]> mapPluginCategories = new();
private List<CategoryKind> highlightedCategoryKinds = new();
/// <summary>
/// Type of category group.
@ -84,6 +86,97 @@ internal class PluginCategoryManager
Changelog,
}
/// <summary>
/// Type of category.
/// </summary>
public enum CategoryKind
{
/// <summary>
/// All plugins.
/// </summary>
All = 0,
/// <summary>
/// Plugins currently being tested.
/// </summary>
IsTesting = 1,
/// <summary>
/// Plugins available for testing.
/// </summary>
AvailableForTesting = 2,
/// <summary>
/// Installed dev plugins.
/// </summary>
DevInstalled = 10,
/// <summary>
/// Icon tester.
/// </summary>
IconTester = 11,
/// <summary>
/// Changelogs for Dalamud.
/// </summary>
DalamudChangelogs = 12,
/// <summary>
/// Changelogs for plugins.
/// </summary>
PluginChangelogs = 13,
/// <summary>
/// Change plugin profiles.
/// </summary>
PluginProfiles = 14,
/// <summary>
/// Updateable plugins.
/// </summary>
UpdateablePlugins = 15,
/// <summary>
/// Plugins tagged as "other".
/// </summary>
Other = FirstTagBasedCategoryId + 0,
/// <summary>
/// Plugins tagged as "jobs".
/// </summary>
Jobs = FirstTagBasedCategoryId + 1,
/// <summary>
/// Plugins tagged as "ui".
/// </summary>
Ui = FirstTagBasedCategoryId + 2,
/// <summary>
/// Plugins tagged as "minigames".
/// </summary>
MiniGames = FirstTagBasedCategoryId + 3,
/// <summary>
/// Plugins tagged as "inventory".
/// </summary>
Inventory = FirstTagBasedCategoryId + 4,
/// <summary>
/// Plugins tagged as "sound".
/// </summary>
Sound = FirstTagBasedCategoryId + 5,
/// <summary>
/// Plugins tagged as "social".
/// </summary>
Social = FirstTagBasedCategoryId + 6,
/// <summary>
/// Plugins tagged as "utility".
/// </summary>
Utility = FirstTagBasedCategoryId + 7,
}
/// <summary>
/// Gets the list of all known categories.
/// </summary>
@ -95,38 +188,49 @@ internal class PluginCategoryManager
public GroupInfo[] GroupList => this.groupList;
/// <summary>
/// Gets or sets current group.
/// Gets or sets the current group kind.
/// </summary>
public int CurrentGroupIdx
public GroupKind CurrentGroupKind
{
get => this.currentGroupIdx;
get => this.groupList[this.currentGroupIdx].GroupKind;
set
{
if (this.currentGroupIdx != value)
var newIdx = Array.FindIndex(this.groupList, x => x.GroupKind == value);
if (newIdx >= 0)
{
this.currentGroupIdx = value;
this.currentCategoryIdx = 0;
this.currentGroupIdx = newIdx;
this.currentCategoryKind = this.CurrentGroup.Categories.First();
this.isContentDirty = true;
}
}
}
/// <summary>
/// Gets or sets current category, index in current Group.Categories array.
/// Gets information about currently selected group.
/// </summary>
public int CurrentCategoryIdx
public GroupInfo CurrentGroup => this.groupList[this.currentGroupIdx];
/// <summary>
/// Gets or sets the current category kind.
/// </summary>
public CategoryKind CurrentCategoryKind
{
get => this.currentCategoryIdx;
get => this.currentCategoryKind;
set
{
if (this.currentCategoryIdx != value)
if (this.currentCategoryKind != value)
{
this.currentCategoryIdx = value;
this.currentCategoryKind = value;
this.isContentDirty = true;
}
}
}
/// <summary>
/// Gets information about currently selected category.
/// </summary>
public CategoryInfo CurrentCategory => this.categoryList.First(x => x.CategoryKind == this.currentCategoryKind);
/// <summary>
/// Gets a value indicating whether current group + category selection changed recently.
/// Changes in Available group should be followed with <see cref="GetCurrentCategoryContent"/>, everything else can use <see cref="ResetContentDirty"/>.
@ -134,13 +238,12 @@ internal class PluginCategoryManager
public bool IsContentDirty => this.isContentDirty;
/// <summary>
/// Gets a value indicating whether <see cref="CurrentCategoryIdx"/> and <see cref="CurrentGroupIdx"/> are valid.
/// Gets a value indicating whether <see cref="CurrentCategoryKind"/> and <see cref="CurrentGroupKind"/> are valid.
/// </summary>
public bool IsSelectionValid =>
(this.currentGroupIdx >= 0) &&
(this.currentGroupIdx < this.groupList.Length) &&
(this.currentCategoryIdx >= 0) &&
(this.currentCategoryIdx < this.groupList[this.currentGroupIdx].Categories.Count);
this.groupList[this.currentGroupIdx].Categories.Contains(this.currentCategoryKind);
/// <summary>
/// Rebuild available categories based on currently available plugins.
@ -152,10 +255,10 @@ internal class PluginCategoryManager
this.mapPluginCategories.Clear();
var groupAvail = Array.Find(this.groupList, x => x.GroupKind == GroupKind.Available);
var prevCategoryIds = new List<int>();
var prevCategoryIds = new List<CategoryKind>();
prevCategoryIds.AddRange(groupAvail.Categories);
var categoryList = new List<int>();
var categoryList = new List<CategoryKind>();
var allCategoryIndices = new List<int>();
foreach (var manifest in availablePlugins)
@ -171,10 +274,10 @@ internal class PluginCategoryManager
var matchIdx = Array.FindIndex(this.CategoryList, x => x.Tag.Equals(tag, StringComparison.InvariantCultureIgnoreCase));
if (matchIdx >= 0)
{
var categoryId = this.CategoryList[matchIdx].CategoryId;
if (categoryId >= FirstTagBasedCategoryId)
var categoryKind = this.CategoryList[matchIdx].CategoryKind;
if ((int)categoryKind >= FirstTagBasedCategoryId)
{
categoryList.Add(categoryId);
categoryList.Add(categoryKind);
if (!allCategoryIndices.Contains(matchIdx))
{
@ -186,7 +289,7 @@ internal class PluginCategoryManager
}
if (PluginManager.HasTestingVersion(manifest) || manifest.IsTestingExclusive)
categoryList.Add(2);
categoryList.Add(CategoryKind.AvailableForTesting);
// always add, even if empty
this.mapPluginCategories.Add(manifest, categoryList.ToArray());
@ -204,11 +307,11 @@ internal class PluginCategoryManager
foreach (var categoryIdx in allCategoryIndices)
{
groupAvail.Categories.Add(this.CategoryList[categoryIdx].CategoryId);
groupAvail.Categories.Add(this.CategoryList[categoryIdx].CategoryKind);
}
// compare with prev state and mark as dirty if needed
var noCategoryChanges = Enumerable.SequenceEqual(prevCategoryIds, groupAvail.Categories);
var noCategoryChanges = prevCategoryIds.SequenceEqual(groupAvail.Categories);
if (!noCategoryChanges)
{
this.isContentDirty = true;
@ -229,20 +332,20 @@ internal class PluginCategoryManager
{
var groupInfo = this.groupList[this.currentGroupIdx];
var includeAll = (this.currentCategoryIdx == 0) || (groupInfo.GroupKind != GroupKind.Available);
var includeAll = (this.currentCategoryKind == CategoryKind.All) || (groupInfo.GroupKind != GroupKind.Available);
if (includeAll)
{
result.AddRange(plugins);
}
else
{
var selectedCategoryInfo = Array.Find(this.categoryList, x => x.CategoryId == groupInfo.Categories[this.currentCategoryIdx]);
var selectedCategoryInfo = Array.Find(this.categoryList, x => x.CategoryKind == this.currentCategoryKind);
foreach (var plugin in plugins)
{
if (this.mapPluginCategories.TryGetValue(plugin, out var pluginCategoryIds))
{
var matchIdx = Array.IndexOf(pluginCategoryIds, selectedCategoryInfo.CategoryId);
var matchIdx = Array.IndexOf(pluginCategoryIds, selectedCategoryInfo.CategoryKind);
if (matchIdx >= 0)
{
result.Add(plugin);
@ -270,20 +373,17 @@ internal class PluginCategoryManager
/// <param name="plugins">List of plugins whose categories should be highlighted.</param>
public void SetCategoryHighlightsForPlugins(IEnumerable<PluginManifest> plugins)
{
this.highlightedCategoryIds.Clear();
this.highlightedCategoryKinds.Clear();
if (plugins != null)
{
foreach (var entry in plugins)
{
if (this.mapPluginCategories.TryGetValue(entry, out var pluginCategories))
{
foreach (var categoryId in pluginCategories)
foreach (var categoryKind in pluginCategories)
{
if (!this.highlightedCategoryIds.Contains(categoryId))
if (!this.highlightedCategoryKinds.Contains(categoryKind))
{
this.highlightedCategoryIds.Add(categoryId);
}
this.highlightedCategoryKinds.Add(categoryKind);
}
}
}
@ -293,9 +393,9 @@ internal class PluginCategoryManager
/// <summary>
/// Checks if category should be highlighted.
/// </summary>
/// <param name="categoryId">CategoryId to check.</param>
/// <param name="categoryKind">CategoryKind to check.</param>
/// <returns>true if highlight is needed.</returns>
public bool IsCategoryHighlighted(int categoryId) => this.highlightedCategoryIds.Contains(categoryId);
public bool IsCategoryHighlighted(CategoryKind categoryKind) => this.highlightedCategoryKinds.Contains(categoryKind);
private IEnumerable<string> GetCategoryTagsForManifest(PluginManifest pluginManifest)
{
@ -315,7 +415,7 @@ internal class PluginCategoryManager
/// <summary>
/// Unique Id number of category, tag match based should be greater of equal <see cref="FirstTagBasedCategoryId"/>.
/// </summary>
public int CategoryId;
public CategoryKind CategoryKind;
/// <summary>
/// Tag from plugin manifest to match.
@ -327,13 +427,13 @@ internal class PluginCategoryManager
/// <summary>
/// Initializes a new instance of the <see cref="CategoryInfo"/> struct.
/// </summary>
/// <param name="categoryId">Unique id of category.</param>
/// <param name="categoryKind">Kind of the category.</param>
/// <param name="tag">Tag to match.</param>
/// <param name="nameFunc">Function returning localized name of category.</param>
/// <param name="condition">Condition to be checked when deciding whether this category should be shown.</param>
public CategoryInfo(int categoryId, string tag, Func<string> nameFunc, AppearCondition condition = AppearCondition.None)
public CategoryInfo(CategoryKind categoryKind, string tag, Func<string> nameFunc, AppearCondition condition = AppearCondition.None)
{
this.CategoryId = categoryId;
this.CategoryKind = categoryKind;
this.Tag = tag;
this.nameFunc = nameFunc;
this.Condition = condition;
@ -379,7 +479,7 @@ internal class PluginCategoryManager
/// <summary>
/// List of categories in container.
/// </summary>
public List<int> Categories;
public List<CategoryKind> Categories;
private Func<string> nameFunc;
@ -389,7 +489,7 @@ internal class PluginCategoryManager
/// <param name="groupKind">Type of group.</param>
/// <param name="nameFunc">Function returning localized name of category.</param>
/// <param name="categories">List of category Ids to hardcode.</param>
public GroupInfo(GroupKind groupKind, Func<string> nameFunc, params int[] categories)
public GroupInfo(GroupKind groupKind, Func<string> nameFunc, params CategoryKind[] categories)
{
this.GroupKind = groupKind;
this.nameFunc = nameFunc;

View file

@ -428,27 +428,27 @@ internal class PluginInstallerWindow : Window, IDisposable
{
case PluginInstallerOpenKind.AllPlugins:
// Plugins group
this.categoryManager.CurrentGroupIdx = 2;
this.categoryManager.CurrentGroupKind = PluginCategoryManager.GroupKind.Available;
// All category
this.categoryManager.CurrentCategoryIdx = 0;
this.categoryManager.CurrentCategoryKind = PluginCategoryManager.CategoryKind.All;
break;
case PluginInstallerOpenKind.InstalledPlugins:
// Installed group
this.categoryManager.CurrentGroupIdx = 1;
this.categoryManager.CurrentGroupKind = PluginCategoryManager.GroupKind.Installed;
// All category
this.categoryManager.CurrentCategoryIdx = 0;
this.categoryManager.CurrentCategoryKind = PluginCategoryManager.CategoryKind.All;
break;
case PluginInstallerOpenKind.UpdateablePlugins:
// Installed group
this.categoryManager.CurrentGroupIdx = 1;
this.categoryManager.CurrentGroupKind = PluginCategoryManager.GroupKind.Installed;
// Updateable category
this.categoryManager.CurrentCategoryIdx = 15;
this.categoryManager.CurrentCategoryKind = PluginCategoryManager.CategoryKind.UpdateablePlugins;
break;
case PluginInstallerOpenKind.Changelogs:
// Changelog group
this.categoryManager.CurrentGroupIdx = 3;
this.categoryManager.CurrentGroupKind = PluginCategoryManager.GroupKind.Changelog;
// Plugins category
this.categoryManager.CurrentCategoryIdx = 2;
this.categoryManager.CurrentCategoryKind = PluginCategoryManager.CategoryKind.All;
break;
default:
throw new ArgumentOutOfRangeException(nameof(kind), kind, null);
@ -611,7 +611,8 @@ internal class PluginInstallerWindow : Window, IDisposable
ImGui.SetCursorPosX(windowSize.X - sortSelectWidth - (style.ItemSpacing.X * 2) - searchInputWidth - searchClearButtonWidth);
var isProfileManager =
this.categoryManager.CurrentGroupIdx == 1 && this.categoryManager.CurrentCategoryIdx == 2;
this.categoryManager.CurrentGroupKind == PluginCategoryManager.GroupKind.Installed &&
this.categoryManager.CurrentCategoryKind == PluginCategoryManager.CategoryKind.PluginProfiles;
// Disable search if profile editor
using (ImRaii.Disabled(isProfileManager))
@ -641,7 +642,7 @@ internal class PluginInstallerWindow : Window, IDisposable
}
// Disable sort if changelogs or profile editor
using (ImRaii.Disabled(this.categoryManager.CurrentGroupIdx == 3 || isProfileManager))
using (ImRaii.Disabled(this.categoryManager.CurrentGroupKind == PluginCategoryManager.GroupKind.Changelog || isProfileManager))
{
ImGui.SameLine();
ImGui.SetCursorPosY(downShift);
@ -781,9 +782,7 @@ internal class PluginInstallerWindow : Window, IDisposable
Service<PluginManager>.Get().PrintUpdatedPlugins(this.updatedPlugins, Locs.PluginUpdateHeader_Chatbox);
notifications.AddNotification(Locs.Notifications_UpdatesInstalled(this.updatePluginCount), Locs.Notifications_UpdatesInstalledTitle, NotificationType.Success);
var installedGroupIdx = this.categoryManager.GroupList.TakeWhile(
x => x.GroupKind != PluginCategoryManager.GroupKind.Installed).Count();
this.categoryManager.CurrentGroupIdx = installedGroupIdx;
this.categoryManager.CurrentGroupKind = PluginCategoryManager.GroupKind.Installed;
}
else if (this.updatePluginCount == 0)
{
@ -1373,28 +1372,28 @@ internal class PluginInstallerWindow : Window, IDisposable
}
}
for (var groupIdx = 0; groupIdx < this.categoryManager.GroupList.Length; groupIdx++)
foreach (var groupInfo in this.categoryManager.GroupList)
{
var groupInfo = this.categoryManager.GroupList[groupIdx];
var canShowGroup = (groupInfo.GroupKind != PluginCategoryManager.GroupKind.DevTools) || this.hasDevPlugins;
if (!canShowGroup)
{
continue;
}
ImGui.SetNextItemOpen(groupIdx == this.categoryManager.CurrentGroupIdx);
if (ImGui.CollapsingHeader(groupInfo.Name, groupIdx == this.categoryManager.CurrentGroupIdx ? ImGuiTreeNodeFlags.OpenOnDoubleClick : ImGuiTreeNodeFlags.None))
var isCurrent = groupInfo.GroupKind == this.categoryManager.CurrentGroupKind;
ImGui.SetNextItemOpen(isCurrent);
if (ImGui.CollapsingHeader(groupInfo.Name, isCurrent ? ImGuiTreeNodeFlags.OpenOnDoubleClick : ImGuiTreeNodeFlags.None))
{
if (this.categoryManager.CurrentGroupIdx != groupIdx)
if (!isCurrent)
{
this.categoryManager.CurrentGroupIdx = groupIdx;
this.categoryManager.CurrentGroupKind = groupInfo.GroupKind;
}
ImGui.Indent();
var categoryItemSize = new Vector2(ImGui.GetContentRegionAvail().X - (5 * ImGuiHelpers.GlobalScale), ImGui.GetTextLineHeight());
for (var categoryIdx = 0; categoryIdx < groupInfo.Categories.Count; categoryIdx++)
foreach (var categoryKind in groupInfo.Categories)
{
var categoryInfo = Array.Find(this.categoryManager.CategoryList, x => x.CategoryId == groupInfo.Categories[categoryIdx]);
var categoryInfo = this.categoryManager.CategoryList.First(x => x.CategoryKind == categoryKind);
switch (categoryInfo.Condition)
{
@ -1409,15 +1408,15 @@ internal class PluginInstallerWindow : Window, IDisposable
throw new ArgumentOutOfRangeException();
}
var hasSearchHighlight = this.categoryManager.IsCategoryHighlighted(categoryInfo.CategoryId);
var hasSearchHighlight = this.categoryManager.IsCategoryHighlighted(categoryInfo.CategoryKind);
if (hasSearchHighlight)
{
ImGui.PushStyleColor(ImGuiCol.Text, colorSearchHighlight);
}
if (ImGui.Selectable(categoryInfo.Name, this.categoryManager.CurrentCategoryIdx == categoryIdx, ImGuiSelectableFlags.None, categoryItemSize))
if (ImGui.Selectable(categoryInfo.Name, this.categoryManager.CurrentCategoryKind == categoryKind, ImGuiSelectableFlags.None, categoryItemSize))
{
this.categoryManager.CurrentCategoryIdx = categoryIdx;
this.categoryManager.CurrentCategoryKind = categoryKind;
}
if (hasSearchHighlight)
@ -1427,14 +1426,10 @@ internal class PluginInstallerWindow : Window, IDisposable
}
ImGui.Unindent();
if (groupIdx != this.categoryManager.GroupList.Length - 1)
{
ImGuiHelpers.ScaledDummy(5);
}
}
}
}
private void DrawPluginCategoryContent()
{
@ -1467,7 +1462,7 @@ internal class PluginInstallerWindow : Window, IDisposable
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, ImGuiHelpers.ScaledVector2(1, 3));
var groupInfo = this.categoryManager.GroupList[this.categoryManager.CurrentGroupIdx];
var groupInfo = this.categoryManager.CurrentGroup;
if (this.categoryManager.IsContentDirty)
{
// reset opened list of collapsibles when switching between categories
@ -1484,13 +1479,13 @@ internal class PluginInstallerWindow : Window, IDisposable
{
case PluginCategoryManager.GroupKind.DevTools:
// this one is never sorted and remains in hardcoded order from group ctor
switch (this.categoryManager.CurrentCategoryIdx)
switch (this.categoryManager.CurrentCategoryKind)
{
case 0:
case PluginCategoryManager.CategoryKind.DevInstalled:
this.DrawInstalledPluginList(InstalledPluginListFilter.Dev);
break;
case 1:
case PluginCategoryManager.CategoryKind.IconTester:
this.DrawImageTester();
break;
@ -1501,21 +1496,21 @@ internal class PluginInstallerWindow : Window, IDisposable
break;
case PluginCategoryManager.GroupKind.Installed:
switch (this.categoryManager.CurrentCategoryIdx)
switch (this.categoryManager.CurrentCategoryKind)
{
case 0:
case PluginCategoryManager.CategoryKind.All:
this.DrawInstalledPluginList(InstalledPluginListFilter.None);
break;
case 1:
case PluginCategoryManager.CategoryKind.IsTesting:
this.DrawInstalledPluginList(InstalledPluginListFilter.Testing);
break;
case 2:
case PluginCategoryManager.CategoryKind.UpdateablePlugins:
this.DrawInstalledPluginList(InstalledPluginListFilter.Updateable);
break;
case 3:
case PluginCategoryManager.CategoryKind.PluginProfiles:
this.profileManagerWidget.Draw();
break;
@ -1526,19 +1521,23 @@ internal class PluginInstallerWindow : Window, IDisposable
break;
case PluginCategoryManager.GroupKind.Changelog:
switch (this.categoryManager.CurrentCategoryIdx)
switch (this.categoryManager.CurrentCategoryKind)
{
case 0:
case PluginCategoryManager.CategoryKind.All:
this.DrawChangelogList(true, true);
break;
case 1:
case PluginCategoryManager.CategoryKind.DalamudChangelogs:
this.DrawChangelogList(true, false);
break;
case 2:
case PluginCategoryManager.CategoryKind.PluginChangelogs:
this.DrawChangelogList(false, true);
break;
default:
ImGui.TextUnformatted("You found a quiet category. Please don't wake it up.");
break;
}
break;