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) switch (commandId)
{ {
case 69420: case 69420:
dalamudInterface?.TogglePluginInstallerWindowTo(this.configuration.PluginInstallerOpen); dalamudInterface?.OpenPluginInstaller();
break; break;
case 69421: case 69421:
dalamudInterface?.ToggleSettingsWindow(); dalamudInterface?.OpenSettings();
break; break;
default: default:
this.hookUiModuleRequestMainCommand.Original(thisPtr, commandId); this.hookUiModuleRequestMainCommand.Original(thisPtr, commandId);

View file

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

View file

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