feat(settings): convert the remaining four standard tabs
Chat, Channels, General and Data & Privacy now draw the same way Window does. A half-converted window is worse than an unconverted one: before, all seven tabs were consistently dated; after the pilot, one looked current and six looked abandoned, and switching between them made the seam obvious. Descriptions move out of the help markers and onto the rows. Those strings were written to be read, and a (?) the user has to hover is where an explanation goes to be ignored. Several were translated into 25 languages and had never appeared on screen at all. Two settings that could not use the standard helpers -- the language picker, which rebuilds the font atlas, and the keybind mode, whose description depends on the selected value -- go through a plain Row that hands the caller the control column and leaves the save logic alone. Privacy filter labels now come from the resources that already existed for them, same defect as the channels tab last round: strings present, translated, and reachable from no line of code. Four more constructors take a TokenResolver, so this wants the DI smoke pass. Only the appearance tab still draws stock collapsing headers; its four components are their own block.
This commit is contained in:
@@ -1,68 +1,79 @@
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using HellionChat.Resources;
|
||||
using HellionChat.Util;
|
||||
using HellionChat.Ui.StyleEngine;
|
||||
|
||||
namespace HellionChat.Ui.Components.Settings.Tabs;
|
||||
|
||||
internal sealed class ChatTab
|
||||
{
|
||||
private readonly Plugin _plugin;
|
||||
private readonly SettingsWidgets _w;
|
||||
|
||||
public ChatTab(Plugin plugin)
|
||||
public ChatTab(Plugin plugin, TokenResolver resolver)
|
||||
{
|
||||
_plugin = plugin;
|
||||
_w = new SettingsWidgets(plugin);
|
||||
_w = new SettingsWidgets(plugin, new SettingsPalette(resolver));
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
if (ImGui.CollapsingHeader("Display modes", ImGuiTreeNodeFlags.DefaultOpen))
|
||||
if (_w.Section(ImGui.GetID("chat.display"u8), "Display modes"))
|
||||
{
|
||||
_w.Toggle(
|
||||
"Compact density (card vs compact)",
|
||||
_w.ToggleRow(
|
||||
ImGui.GetID("chat.display.density"u8),
|
||||
"Compact density",
|
||||
"Trades the card layout for one line per message.",
|
||||
() => Plugin.Config.UseCompactDensity,
|
||||
v => Plugin.Config.UseCompactDensity = v
|
||||
);
|
||||
_w.Toggle(
|
||||
_w.ToggleRow(
|
||||
ImGui.GetID("chat.display.clock"u8),
|
||||
"24-hour clock",
|
||||
null,
|
||||
() => Plugin.Config.Use24HourClock,
|
||||
v => Plugin.Config.Use24HourClock = v
|
||||
);
|
||||
_w.EnumCombo(
|
||||
|
||||
// Descriptions move out of the help markers and onto the row. They
|
||||
// were written to be read; a (?) the user has to hover is where an
|
||||
// explanation goes to be ignored.
|
||||
_w.EnumComboRow(
|
||||
ImGui.GetID("chat.display.worldsuffix"u8),
|
||||
HellionStrings.Settings_Chat_WorldSuffix_Name,
|
||||
HellionStrings.Settings_Chat_WorldSuffix_Description,
|
||||
() => Plugin.Config.WorldSuffixMode,
|
||||
v => Plugin.Config.WorldSuffixMode = v,
|
||||
v => v.Name()
|
||||
);
|
||||
ImGuiUtil.HelpMarker(HellionStrings.Settings_Chat_WorldSuffix_Description);
|
||||
_w.EnumCombo(
|
||||
_w.EnumComboRow(
|
||||
ImGui.GetID("chat.display.nameform"u8),
|
||||
HellionStrings.Settings_Chat_NameForm_Name,
|
||||
HellionStrings.Settings_Chat_NameForm_Description,
|
||||
() => Plugin.Config.NameFormMode,
|
||||
v => Plugin.Config.NameFormMode = v,
|
||||
v => v.Name()
|
||||
);
|
||||
ImGuiUtil.HelpMarker(HellionStrings.Settings_Chat_NameForm_Description);
|
||||
}
|
||||
|
||||
if (ImGui.CollapsingHeader("Command help"))
|
||||
if (_w.Section(ImGui.GetID("chat.commandhelp"u8), "Command help", open: false))
|
||||
{
|
||||
_w.EnumCombo(
|
||||
_w.EnumComboRow(
|
||||
ImGui.GetID("chat.commandhelp.side"u8),
|
||||
"Command help side",
|
||||
"Which side the command hint list appears on while typing.",
|
||||
() => Plugin.Config.CommandHelpSide,
|
||||
v => Plugin.Config.CommandHelpSide = v,
|
||||
v => v.Name()
|
||||
);
|
||||
}
|
||||
|
||||
if (ImGui.CollapsingHeader("Plugin disclosure"))
|
||||
if (_w.Section(ImGui.GetID("chat.disclosure"u8), "Plugin disclosure", open: false))
|
||||
{
|
||||
_w.Toggle(
|
||||
_w.ToggleRow(
|
||||
ImGui.GetID("chat.disclosure.notify"u8),
|
||||
HellionStrings.Settings_Chat_NotifyPluginDisclosure_Name,
|
||||
HellionStrings.Settings_Chat_NotifyPluginDisclosure_Description,
|
||||
() => Plugin.Config.NotifyPluginDisclosure,
|
||||
v => Plugin.Config.NotifyPluginDisclosure = v
|
||||
);
|
||||
ImGuiUtil.HelpMarker(HellionStrings.Settings_Chat_NotifyPluginDisclosure_Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user