mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
Merge category code into preexisting method
Keep installed plugins after installation in available tab.
This commit is contained in:
parent
893ca93e02
commit
4b98ea31cc
1 changed files with 16 additions and 42 deletions
|
|
@ -525,30 +525,38 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var filteredList = pluginList
|
var filteredManifests = pluginList
|
||||||
.Where(rm => !this.IsManifestFiltered(rm))
|
.Where(rm => !this.IsManifestFiltered(rm))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
if (filteredList.Count == 0)
|
if (filteredManifests.Count == 0)
|
||||||
{
|
{
|
||||||
ImGui.TextColored(ImGuiColors.DalamudGrey2, Locs.TabBody_SearchNoMatching);
|
ImGui.TextColored(ImGuiColors.DalamudGrey2, Locs.TabBody_SearchNoMatching);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var i = 0;
|
// reset opened list of collapsibles when switching between categories
|
||||||
foreach (var manifest in filteredList)
|
if (this.categoryManager.IsContentDirty)
|
||||||
{
|
{
|
||||||
var (isInstalled, plugin) = this.IsManifestInstalled(manifest);
|
this.openPluginCollapsibles.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
var categoryManifestsList = this.categoryManager.GetCurrentCategoryContent(filteredManifests);
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
foreach (var manifest in categoryManifestsList)
|
||||||
|
{
|
||||||
|
var remoteManifest = manifest as RemotePluginManifest;
|
||||||
|
var (isInstalled, plugin) = this.IsManifestInstalled(remoteManifest);
|
||||||
|
|
||||||
ImGui.PushID($"{manifest.InternalName}{manifest.AssemblyVersion}");
|
ImGui.PushID($"{manifest.InternalName}{manifest.AssemblyVersion}");
|
||||||
|
|
||||||
if (isInstalled)
|
if (isInstalled)
|
||||||
{
|
{
|
||||||
this.DrawInstalledPlugin(plugin, i++, true);
|
this.DrawInstalledPlugin(plugin, i++, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.DrawAvailablePlugin(manifest, i++);
|
this.DrawAvailablePlugin(remoteManifest, i++);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.PopID();
|
ImGui.PopID();
|
||||||
|
|
@ -742,41 +750,7 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var pluginList = this.pluginListAvailable;
|
this.DrawAvailablePluginList();
|
||||||
if (pluginList.Count > 0)
|
|
||||||
{
|
|
||||||
// reset opened list of collapsibles when switching between categories
|
|
||||||
if (this.categoryManager.IsContentDirty)
|
|
||||||
{
|
|
||||||
this.openPluginCollapsibles.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
var filteredManifests = pluginList.Where(rm => !this.IsManifestFiltered(rm) && !this.IsManifestInstalled(rm).IsInstalled);
|
|
||||||
var categoryManifestsList = this.categoryManager.GetCurrentCategoryContent(filteredManifests);
|
|
||||||
|
|
||||||
if (categoryManifestsList.Count > 0)
|
|
||||||
{
|
|
||||||
var i = 0;
|
|
||||||
foreach (var manifest in categoryManifestsList)
|
|
||||||
{
|
|
||||||
var rmManifest = manifest as RemotePluginManifest;
|
|
||||||
if (rmManifest != null)
|
|
||||||
{
|
|
||||||
ImGui.PushID($"{rmManifest.InternalName}{rmManifest.AssemblyVersion}");
|
|
||||||
this.DrawAvailablePlugin(rmManifest, i++);
|
|
||||||
ImGui.PopID();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ImGui.Text(Locs.TabBody_SearchNoMatching);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ImGui.Text(Locs.TabBody_SearchNoCompatible);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.PopStyleVar();
|
ImGui.PopStyleVar();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue