feat(settings-refactor): populate General tab with input, audio, performance, language sections
This commit is contained in:
+6
@@ -203,4 +203,10 @@ internal class HellionStrings
|
|||||||
internal static string Settings_Tab_Window => Get(nameof(Settings_Tab_Window));
|
internal static string Settings_Tab_Window => Get(nameof(Settings_Tab_Window));
|
||||||
internal static string Settings_Tab_Chat => Get(nameof(Settings_Tab_Chat));
|
internal static string Settings_Tab_Chat => Get(nameof(Settings_Tab_Chat));
|
||||||
internal static string Settings_Tab_Information => Get(nameof(Settings_Tab_Information));
|
internal static string Settings_Tab_Information => Get(nameof(Settings_Tab_Information));
|
||||||
|
|
||||||
|
// Hellion Chat — General-Tab section headings
|
||||||
|
internal static string Settings_General_Input_Heading => Get(nameof(Settings_General_Input_Heading));
|
||||||
|
internal static string Settings_General_Audio_Heading => Get(nameof(Settings_General_Audio_Heading));
|
||||||
|
internal static string Settings_General_Performance_Heading => Get(nameof(Settings_General_Performance_Heading));
|
||||||
|
internal static string Settings_General_Language_Heading => Get(nameof(Settings_General_Language_Heading));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -463,4 +463,18 @@
|
|||||||
<data name="Settings_Tab_Information" xml:space="preserve">
|
<data name="Settings_Tab_Information" xml:space="preserve">
|
||||||
<value>Über</value>
|
<value>Über</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
|
<!-- Hellion Chat — Sektions-Überschriften des Allgemein-Tabs -->
|
||||||
|
<data name="Settings_General_Input_Heading" xml:space="preserve">
|
||||||
|
<value>Eingabe</value>
|
||||||
|
</data>
|
||||||
|
<data name="Settings_General_Audio_Heading" xml:space="preserve">
|
||||||
|
<value>Audio & Benachrichtigungen</value>
|
||||||
|
</data>
|
||||||
|
<data name="Settings_General_Performance_Heading" xml:space="preserve">
|
||||||
|
<value>Performance</value>
|
||||||
|
</data>
|
||||||
|
<data name="Settings_General_Language_Heading" xml:space="preserve">
|
||||||
|
<value>Sprache & Eingabe-Hilfen</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -463,4 +463,18 @@
|
|||||||
<data name="Settings_Tab_Information" xml:space="preserve">
|
<data name="Settings_Tab_Information" xml:space="preserve">
|
||||||
<value>Information</value>
|
<value>Information</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
|
<!-- Hellion Chat — General-Tab section headings -->
|
||||||
|
<data name="Settings_General_Input_Heading" xml:space="preserve">
|
||||||
|
<value>Input</value>
|
||||||
|
</data>
|
||||||
|
<data name="Settings_General_Audio_Heading" xml:space="preserve">
|
||||||
|
<value>Audio & Notifications</value>
|
||||||
|
</data>
|
||||||
|
<data name="Settings_General_Performance_Heading" xml:space="preserve">
|
||||||
|
<value>Performance</value>
|
||||||
|
</data>
|
||||||
|
<data name="Settings_General_Language_Heading" xml:space="preserve">
|
||||||
|
<value>Language & Input Helpers</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -20,6 +20,139 @@ internal sealed class General : ISettingsTab
|
|||||||
|
|
||||||
public void Draw(bool changed)
|
public void Draw(bool changed)
|
||||||
{
|
{
|
||||||
// Settings ziehen in Plan-Task 3 ein.
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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))
|
||||||
|
{
|
||||||
|
if (ImGuiUtil.InputIntVertical(Language.Options_MaxLinesToShow_Name, Language.Options_MaxLinesToShow_Description, ref Mutable.MaxLinesToRender))
|
||||||
|
{
|
||||||
|
Mutable.MaxLinesToRender = Math.Clamp(Mutable.MaxLinesToRender, 1, 10_000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
foreach (var language in Enum.GetValues<LanguageOverride>())
|
||||||
|
{
|
||||||
|
if (ImGui.Selectable(language.Name()))
|
||||||
|
{
|
||||||
|
Mutable.LanguageOverride = language;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGuiUtil.HelpMarker(string.Format(Language.Options_Language_Description, Plugin.PluginName));
|
||||||
|
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();
|
||||||
|
|
||||||
|
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));
|
||||||
|
ImGui.Spacing();
|
||||||
|
|
||||||
|
ImGui.Checkbox(Language.Options_SortAutoTranslate_Name, ref Mutable.SortAutoTranslate);
|
||||||
|
ImGuiUtil.HelpMarker(Language.Options_SortAutoTranslate_Description);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user