35e8d3a7fe
Plugin.cs:937 only pushed RegularFont when Config.FontsEnabled was true.
FontsAndColours.cs:50 forces FontsEnabled=false whenever UseHellionFont is
enabled (to hide the chooser UI), so the bundled-font path was silently
dead and the FFXIV Axis game-font took over. Exo 2 looked "almost right"
because it overlaps Axis on basic Latin, so the regression went unnoticed
for the entire v1.5.x series.
The fix routes RegularFont through draw whenever either FontsEnabled or
UseHellionFont is on. First-frame HITCH dropped from ~74 ms to ~20 ms
median (5-reload Linux/Wine sample 17.9-23.6 ms) as a side effect — the
v1.5.1 "too optimistic" defer-pattern hypothesis was actually a symptom
of this bug, not bad math.
Font-stack overhaul on top:
- Inter Light (Static 18pt-Light, 343 KB, SIL OFL 1.1) replaces Exo 2 as
the bundled font. Inter ships full Latin Extended-A/B, Greek polytonic
and Cyrillic Supplement coverage.
- NotoSansCjkRegular added as a third merge layer for Hangul,
Simplified-Chinese-specific Han glyphs, and CJK fallbacks the FFXIV
Japanese font does not ship.
- Two new ExtraGlyphRanges flags (LatinExtended, Greek) implemented via
AddChar pair lists in SetUpRanges.
- Settings.Apply auto-activates the matching ExtraGlyphRanges flag on
language change. Plugin.LoadAsync runs a one-shot migration that ORs
in the required flag for an already-selected language.
- ExtraGlyphRanges CollapsingHeader reachable regardless of
UseHellionFont (was hidden in the early-return branch).
- New WarningText below the language combo: FFXIV's chat engine only
fully supports EN/DE/FR/JA. Other scripts render in the HellionChat
UI but may garble in in-game chat input/send.
Localisation wave (originally a FR-only cycle):
- 24 selectable UI languages. LanguageOverride enum gains 10 new locales
plus 3 previously commented-out (Italian, Korean, Norwegian with ISO
code `nb` instead of `no`). All new values append to keep existing
user-config integer serialisation stable.
- Resource bundle split: HellionStrings.resx (24 locales, 328 keys) for
fork-added strings, Language.resx (24 locales, 456 keys) for the
ChatTwo-Crowdin-heritage. 4 post-sync Crowdin keys backfilled into
13 legacy locales with per-key AI-assisted comment marker.
- Em-dash sweep on EN source plus 18 translations. Russian and Ukrainian
keep their typographic norm.
Old HellionFont.ttf + HellionFont-OFL.txt removed; Inter-Light.ttf +
Inter-OFL.txt take their place. Configuration field UseHellionFont keeps
its name for backwards-compat. Migration v17 stays.
192 lines
6.5 KiB
C#
192 lines
6.5 KiB
C#
using Dalamud.Bindings.ImGui;
|
|
using Dalamud.Interface.Utility;
|
|
using Dalamud.Interface.Utility.Raii;
|
|
using HellionChat.Resources;
|
|
using HellionChat.Util;
|
|
|
|
namespace HellionChat.Ui.SettingsTabs;
|
|
|
|
internal sealed class General : ISettingsTab
|
|
{
|
|
private Plugin Plugin { get; }
|
|
private Configuration Mutable { get; }
|
|
|
|
public string Name => HellionStrings.Settings_Tab_General + "###tabs-general";
|
|
|
|
internal General(Plugin plugin, Configuration mutable)
|
|
{
|
|
Plugin = plugin;
|
|
Mutable = mutable;
|
|
}
|
|
|
|
public void Draw(bool changed)
|
|
{
|
|
DrawInputSection();
|
|
ImGui.Spacing();
|
|
DrawAudioSection();
|
|
ImGui.Spacing();
|
|
DrawPerformanceSection();
|
|
ImGui.Spacing();
|
|
DrawLanguageSection();
|
|
}
|
|
|
|
private void DrawInputSection()
|
|
{
|
|
using var tree = ImRaii.TreeNode(HellionStrings.Settings_General_Input_Heading);
|
|
if (!tree.Success)
|
|
{
|
|
return;
|
|
}
|
|
|
|
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
{
|
|
ImGui.Checkbox(Language.Options_KeepInputFocus_Name, ref Mutable.KeepInputFocus);
|
|
ImGuiUtil.HelpMarker(Language.Options_KeepInputFocus_Description);
|
|
|
|
ImGui.Spacing();
|
|
ImGui.TextUnformatted(Language.Options_ChatTabForwardKeybind_Name);
|
|
ImGui.SetNextItemWidth(-1);
|
|
ImGuiUtil.KeybindInput("ChatTabForwardKeybind", ref Mutable.ChatTabForward);
|
|
|
|
ImGui.TextUnformatted(Language.Options_ChatTabBackwardKeybind_Name);
|
|
ImGui.SetNextItemWidth(-1);
|
|
ImGuiUtil.KeybindInput("ChatTabBackwardKeybind", ref Mutable.ChatTabBackward);
|
|
|
|
ImGui.Spacing();
|
|
|
|
using (
|
|
var combo = ImGuiUtil.BeginComboVertical(
|
|
Language.Options_KeybindMode_Name,
|
|
Mutable.KeybindMode.Name()
|
|
)
|
|
)
|
|
{
|
|
if (combo.Success)
|
|
{
|
|
foreach (var mode in Enum.GetValues<KeybindMode>())
|
|
{
|
|
if (ImGui.Selectable(mode.Name(), Mutable.KeybindMode == mode))
|
|
{
|
|
Mutable.KeybindMode = mode;
|
|
}
|
|
|
|
if (ImGui.IsItemHovered())
|
|
{
|
|
ImGuiUtil.Tooltip(mode.Tooltip() ?? "");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ImGuiUtil.HelpMarker(
|
|
string.Format(Language.Options_KeybindMode_Description, Plugin.PluginName)
|
|
);
|
|
}
|
|
}
|
|
|
|
private void DrawAudioSection()
|
|
{
|
|
using var tree = ImRaii.TreeNode(HellionStrings.Settings_General_Audio_Heading);
|
|
if (!tree.Success)
|
|
{
|
|
return;
|
|
}
|
|
|
|
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
{
|
|
ImGui.Checkbox(Language.Options_PlaySounds_Name, ref Mutable.PlaySounds);
|
|
ImGuiUtil.HelpMarker(Language.Options_PlaySounds_Description);
|
|
|
|
ImGui.Checkbox(Language.Options_ShowNoviceNetwork_Name, ref Mutable.ShowNoviceNetwork);
|
|
ImGuiUtil.HelpMarker(Language.Options_ShowNoviceNetwork_Description);
|
|
}
|
|
}
|
|
|
|
private void DrawPerformanceSection()
|
|
{
|
|
using var tree = ImRaii.TreeNode(HellionStrings.Settings_General_Performance_Heading);
|
|
if (!tree.Success)
|
|
{
|
|
return;
|
|
}
|
|
|
|
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
{
|
|
ImGui.SetNextItemWidth(200f * ImGuiHelpers.GlobalScale);
|
|
if (ImGui.InputInt(Language.Options_MaxLinesToShow_Name, ref Mutable.MaxLinesToRender))
|
|
{
|
|
Mutable.MaxLinesToRender = Math.Clamp(Mutable.MaxLinesToRender, 1, 10_000);
|
|
}
|
|
ImGuiUtil.HelpMarker(Language.Options_MaxLinesToShow_Description);
|
|
}
|
|
}
|
|
|
|
private void DrawLanguageSection()
|
|
{
|
|
using var tree = ImRaii.TreeNode(HellionStrings.Settings_General_Language_Heading);
|
|
if (!tree.Success)
|
|
{
|
|
return;
|
|
}
|
|
|
|
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
{
|
|
using (
|
|
var combo = ImGuiUtil.BeginComboVertical(
|
|
Language.Options_Language_Name,
|
|
Mutable.LanguageOverride.Name()
|
|
)
|
|
)
|
|
{
|
|
if (combo.Success)
|
|
{
|
|
// None pinned first, then alphabetical by endonym so source order
|
|
// (append-only for serialisation safety) is not visible to users.
|
|
var sortedLanguages = Enum.GetValues<LanguageOverride>()
|
|
.OrderBy(l => l == LanguageOverride.None ? 0 : 1)
|
|
.ThenBy(l => l.Name(), StringComparer.InvariantCulture);
|
|
foreach (var language in sortedLanguages)
|
|
{
|
|
if (ImGui.Selectable(language.Name()))
|
|
{
|
|
Mutable.LanguageOverride = language;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ImGuiUtil.HelpMarker(
|
|
string.Format(Language.Options_Language_Description, Plugin.PluginName)
|
|
);
|
|
// v1.5.3: HellionChat's font stack covers 24 languages but FFXIV's
|
|
// engine only supports EN/DE/FR/JA for chat input/sending.
|
|
ImGuiUtil.WarningText(HellionStrings.Settings_Language_FFXIVCoverage_Warning);
|
|
ImGui.Spacing();
|
|
|
|
using (
|
|
var combo = ImGuiUtil.BeginComboVertical(
|
|
Language.Options_CommandHelpSide_Name,
|
|
Mutable.CommandHelpSide.Name()
|
|
)
|
|
)
|
|
{
|
|
if (combo.Success)
|
|
{
|
|
foreach (var side in Enum.GetValues<CommandHelpSide>())
|
|
{
|
|
if (ImGui.Selectable(side.Name(), Mutable.CommandHelpSide == side))
|
|
{
|
|
Mutable.CommandHelpSide = side;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ImGuiUtil.HelpMarker(
|
|
string.Format(Language.Options_CommandHelpSide_Description, Plugin.PluginName)
|
|
);
|
|
ImGui.Spacing();
|
|
|
|
ImGui.Checkbox(Language.Options_SortAutoTranslate_Name, ref Mutable.SortAutoTranslate);
|
|
ImGuiUtil.HelpMarker(Language.Options_SortAutoTranslate_Description);
|
|
}
|
|
}
|
|
}
|