feat(settings): add world suffix and name format combos to the chat tab

This commit is contained in:
2026-05-31 00:36:09 +02:00
parent 83b1708d5d
commit 92f1736ea9
@@ -1,5 +1,7 @@
using Dalamud.Bindings.ImGui;
using HellionChat.Code;
using HellionChat.Resources;
using HellionChat.Util;
namespace HellionChat.Ui.Components.Settings.Tabs;
@@ -36,6 +38,8 @@ internal sealed class ChatTab
() => Plugin.Config.HideSameTimestamps,
v => Plugin.Config.HideSameTimestamps = v
);
DrawWorldSuffixCombo();
DrawNameFormCombo();
}
if (ImGui.CollapsingHeader("Channel filter"))
@@ -101,6 +105,68 @@ internal sealed class ChatTab
}
}
private void DrawWorldSuffixCombo()
{
var current = Plugin.Config.WorldSuffixMode;
var values = Enum.GetValues<WorldSuffixMode>();
var labels = new string[values.Length];
var selected = 0;
for (var i = 0; i < values.Length; i++)
{
labels[i] = values[i].Name();
if (values[i] == current)
{
selected = i;
}
}
ImGui.SetNextItemWidth(200);
if (
ImGui.Combo(
HellionStrings.Settings_Chat_WorldSuffix_Name,
ref selected,
labels,
labels.Length
)
)
{
Plugin.Config.WorldSuffixMode = values[selected];
_plugin.SaveConfig();
}
ImGuiUtil.HelpMarker(HellionStrings.Settings_Chat_WorldSuffix_Description);
}
private void DrawNameFormCombo()
{
var current = Plugin.Config.NameFormMode;
var values = Enum.GetValues<NameFormMode>();
var labels = new string[values.Length];
var selected = 0;
for (var i = 0; i < values.Length; i++)
{
labels[i] = values[i].Name();
if (values[i] == current)
{
selected = i;
}
}
ImGui.SetNextItemWidth(200);
if (
ImGui.Combo(
HellionStrings.Settings_Chat_NameForm_Name,
ref selected,
labels,
labels.Length
)
)
{
Plugin.Config.NameFormMode = values[selected];
_plugin.SaveConfig();
}
ImGuiUtil.HelpMarker(HellionStrings.Settings_Chat_NameForm_Description);
}
private void DrawToggle(string label, Func<bool> get, Action<bool> set)
{
var current = get();