fix: use correct installer group IDs

This commit is contained in:
goat 2023-10-27 12:21:10 +02:00
parent b7eb0f122c
commit 9187a100da
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
3 changed files with 14 additions and 9 deletions

View file

@ -222,10 +222,10 @@ internal sealed unsafe partial class DalamudAtkTweaks : IServiceType
switch (commandId)
{
case 69420:
dalamudInterface?.TogglePluginInstallerWindowTo(this.configuration.PluginInstallerOpen);
dalamudInterface?.OpenPluginInstaller();
break;
case 69421:
dalamudInterface?.ToggleSettingsWindow();
dalamudInterface?.OpenSettings();
break;
default:
this.hookUiModuleRequestMainCommand.Original(thisPtr, commandId);

View file

@ -48,7 +48,9 @@ internal class DalamudInterface : IDisposable, IServiceType
private const float CreditsDarkeningMaxAlpha = 0.8f;
private static readonly ModuleLog Log = new("DUI");
private readonly DalamudConfiguration configuration;
private readonly ChangelogWindow changelogWindow;
private readonly ColorDemoWindow colorDemoWindow;
private readonly ComponentDemoWindow componentDemoWindow;
@ -92,6 +94,8 @@ internal class DalamudInterface : IDisposable, IServiceType
PluginImageCache pluginImageCache,
Branding branding)
{
this.configuration = configuration;
var interfaceManager = interfaceManagerWithScene.Manager;
this.WindowSystem = new WindowSystem("DalamudCore");
@ -135,7 +139,7 @@ internal class DalamudInterface : IDisposable, IServiceType
interfaceManager.Draw += this.OnDraw;
var tsm = Service<TitleScreenMenu>.Get();
tsm.AddEntryCore(Loc.Localize("TSMDalamudPlugins", "Plugin Installer"), branding.LogoSmall, this.OpenPluginInstaller);
tsm.AddEntryCore(Loc.Localize("TSMDalamudPlugins", "Plugin Installer"), branding.LogoSmall, () => this.OpenPluginInstaller());
tsm.AddEntryCore(Loc.Localize("TSMDalamudSettings", "Dalamud Settings"), branding.LogoSmall, this.OpenSettings);
if (!configuration.DalamudBetaKind.IsNullOrEmpty())
@ -241,13 +245,14 @@ internal class DalamudInterface : IDisposable, IServiceType
this.pluginStatWindow.IsOpen = true;
this.pluginStatWindow.BringToFront();
}
/// <summary>
/// Opens the <see cref="PluginInstallerWindow"/>.
/// Opens the <see cref="PluginInstallerWindow"/> on the plugin installed.
/// </summary>
/// <param name="kind">The page of the installer to open.</param>
public void OpenPluginInstaller()
{
this.pluginWindow.IsOpen = true;
this.pluginWindow.OpenTo(this.configuration.PluginInstallerOpen);
this.pluginWindow.BringToFront();
}

View file

@ -411,13 +411,13 @@ internal class PluginInstallerWindow : Window, IDisposable
{
case PluginInstallerOpenKind.AllPlugins:
// Plugins group
this.categoryManager.CurrentGroupIdx = 0;
this.categoryManager.CurrentGroupIdx = 2;
// All category
this.categoryManager.CurrentCategoryIdx = 0;
break;
case PluginInstallerOpenKind.InstalledPlugins:
// Installed group
this.categoryManager.CurrentGroupIdx = 2;
this.categoryManager.CurrentGroupIdx = 1;
// All category
this.categoryManager.CurrentCategoryIdx = 0;
break;