Files
HellionChat/HellionChat/SelfTests/QuickPickerSelfTestStep.cs
T
JonKazama-Hellion 6813b80d58 feat(themes): restore the header theme/tab quick-picker
Brings back the 1.5.4 quick-picker lost in the v1.6.0 rewrite: a palette button
in the input-bar button row (left of the cog) opens a popup that switches the
theme (built-in + custom, active row checked) and jumps between chat tabs without
opening settings. Theme switch mirrors the settings ThemePicker; the tab jump
routes through a new MainWindow.ActivateTab that replays the click path
(previous -> set -> OnTabActivated) so tell/unread handling is unchanged. Main
window only -- pop-out InputBars get a null picker. Adds QuickPickerSelfTestStep.
2026-06-15 19:53:31 +02:00

46 lines
1.4 KiB
C#

using System.Linq;
using Dalamud.Bindings.ImGui;
using Dalamud.Plugin.SelfTest;
using HellionChat.Resources;
namespace HellionChat.SelfTests;
// Guards the header quick-picker's data contract: its three section/tooltip
// strings must resolve and there must be at least one theme to switch to. The
// render path itself (FontAwesome push) can't run headless, so this checks the
// data the popup depends on, not the draw.
internal sealed class QuickPickerSelfTestStep : ISelfTestStep
{
private readonly Plugin _plugin;
public QuickPickerSelfTestStep(Plugin plugin)
{
_plugin = plugin;
}
public string Name => "Hellion Chat - Theme quick-picker contract";
public SelfTestStepResult RunStep()
{
if (
string.IsNullOrEmpty(HellionStrings.Settings_QuickPicker_Tooltip)
|| string.IsNullOrEmpty(HellionStrings.Settings_QuickPicker_Themes_Header)
|| string.IsNullOrEmpty(HellionStrings.Settings_QuickPicker_Tabs_Header)
)
{
ImGui.Text("Quick-picker strings did not resolve.");
return SelfTestStepResult.Fail;
}
if (!_plugin.ThemeRegistry.BuiltinSlugs.Any())
{
ImGui.Text("No built-in themes available for the quick-picker.");
return SelfTestStepResult.Fail;
}
return SelfTestStepResult.Pass;
}
public void CleanUp() { }
}