Move preview config to its own tab
This commit is contained in:
Generated
+11
-2
@@ -1689,7 +1689,7 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Command help side.
|
/// Looks up a localized string similar to Command help side (None = off).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Options_CommandHelpSide_Name {
|
internal static string Options_CommandHelpSide_Name {
|
||||||
get {
|
get {
|
||||||
@@ -2427,7 +2427,7 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Message preview.
|
/// Looks up a localized string similar to Position (None = off).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Options_Preview_Name {
|
internal static string Options_Preview_Name {
|
||||||
get {
|
get {
|
||||||
@@ -2444,6 +2444,15 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Preview.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Options_Preview_Tab {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Options_Preview_Tab", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Tooltip.
|
/// Looks up a localized string similar to Tooltip.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -389,7 +389,7 @@
|
|||||||
<value>Right</value>
|
<value>Right</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_CommandHelpSide_Name">
|
<data name="Options_CommandHelpSide_Name">
|
||||||
<value>Command help side</value>
|
<value>Command help side (None = off)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_CommandHelpSide_Description">
|
<data name="Options_CommandHelpSide_Description">
|
||||||
<value>The side of {0} to display help for commands on.</value>
|
<value>The side of {0} to display help for commands on.</value>
|
||||||
@@ -1055,7 +1055,7 @@
|
|||||||
<value>Displays a preview with special parameter evaluated, like emotes and <item></value>
|
<value>Displays a preview with special parameter evaluated, like emotes and <item></value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_Preview_Name" xml:space="preserve">
|
<data name="Options_Preview_Name" xml:space="preserve">
|
||||||
<value>Message preview</value>
|
<value>Position (None = off)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_Preview_None" xml:space="preserve">
|
<data name="Options_Preview_None" xml:space="preserve">
|
||||||
<value>None</value>
|
<value>None</value>
|
||||||
@@ -1087,4 +1087,7 @@
|
|||||||
<data name="Options_PreviewMinimum_Description" xml:space="preserve">
|
<data name="Options_PreviewMinimum_Description" xml:space="preserve">
|
||||||
<value>Show only if the text length is greater-than or equal</value>
|
<value>Show only if the text length is greater-than or equal</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Options_Preview_Tab" xml:space="preserve">
|
||||||
|
<value>Preview</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public sealed class SettingsWindow : Window
|
|||||||
new Display(Mutable),
|
new Display(Mutable),
|
||||||
new ChatLog(Plugin, Mutable),
|
new ChatLog(Plugin, Mutable),
|
||||||
new Emote(Plugin, Mutable),
|
new Emote(Plugin, Mutable),
|
||||||
|
new Preview(Plugin, Mutable),
|
||||||
new Ui.SettingsTabs.Fonts(Mutable),
|
new Ui.SettingsTabs.Fonts(Mutable),
|
||||||
new ChatColours(Plugin, Mutable),
|
new ChatColours(Plugin, Mutable),
|
||||||
new Tabs(Plugin, Mutable),
|
new Tabs(Plugin, Mutable),
|
||||||
|
|||||||
@@ -22,33 +22,6 @@ internal sealed class Miscellaneous(Configuration mutable) : ISettingsTab
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGuiUtil.HelpText(string.Format(Language.Options_Language_Description, Plugin.PluginName));
|
ImGuiUtil.HelpText(string.Format(Language.Options_Language_Description, Plugin.PluginName));
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_Preview_Name, Mutable.PreviewPosition.Name()))
|
|
||||||
{
|
|
||||||
if (combo)
|
|
||||||
{
|
|
||||||
foreach (var position in Enum.GetValues<PreviewPosition>())
|
|
||||||
if (ImGui.Selectable(position.Name(), Mutable.PreviewPosition == position))
|
|
||||||
Mutable.PreviewPosition = position;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ImGuiUtil.HelpText(Language.Options_Preview_Description);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
if (Mutable.PreviewPosition is not PreviewPosition.None)
|
|
||||||
{
|
|
||||||
ImGuiUtil.OptionCheckbox(ref Mutable.OnlyPreviewIf, Language.Options_PreviewOnlyIf_Name, Language.Options_PreviewOnlyIf_Description);
|
|
||||||
ImGui.Spacing();
|
|
||||||
if (ImGuiUtil.InputIntVertical(Language.Options_PreviewMinimum_Name, Language.Options_PreviewMinimum_Description, ref Mutable.PreviewMinimum))
|
|
||||||
Mutable.PreviewMinimum = Math.Clamp(Mutable.PreviewMinimum, 1, 250);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_CommandHelpSide_Name, Mutable.CommandHelpSide.Name()))
|
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_CommandHelpSide_Name, Mutable.CommandHelpSide.Name()))
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
using ChatTwo.Resources;
|
||||||
|
using ChatTwo.Util;
|
||||||
|
using ImGuiNET;
|
||||||
|
|
||||||
|
namespace ChatTwo.Ui.SettingsTabs;
|
||||||
|
|
||||||
|
internal sealed class Preview : ISettingsTab
|
||||||
|
{
|
||||||
|
private readonly Plugin Plugin;
|
||||||
|
private Configuration Mutable { get; }
|
||||||
|
|
||||||
|
public string Name => Language.Options_Preview_Tab + "###tabs-preview";
|
||||||
|
|
||||||
|
internal Preview(Plugin plugin, Configuration mutable)
|
||||||
|
{
|
||||||
|
Plugin = plugin;
|
||||||
|
Mutable = mutable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Draw(bool changed)
|
||||||
|
{
|
||||||
|
using var wrap = ImGuiUtil.TextWrapPos();
|
||||||
|
|
||||||
|
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_Preview_Name, Mutable.PreviewPosition.Name()))
|
||||||
|
{
|
||||||
|
if (combo)
|
||||||
|
{
|
||||||
|
foreach (var position in Enum.GetValues<PreviewPosition>())
|
||||||
|
if (ImGui.Selectable(position.Name(), Mutable.PreviewPosition == position))
|
||||||
|
Mutable.PreviewPosition = position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGuiUtil.HelpText(Language.Options_Preview_Description);
|
||||||
|
ImGui.Spacing();
|
||||||
|
|
||||||
|
ImGuiUtil.OptionCheckbox(ref Mutable.OnlyPreviewIf, Language.Options_PreviewOnlyIf_Name, Language.Options_PreviewOnlyIf_Description);
|
||||||
|
ImGui.Spacing();
|
||||||
|
if (ImGuiUtil.InputIntVertical(Language.Options_PreviewMinimum_Name, Language.Options_PreviewMinimum_Description, ref Mutable.PreviewMinimum))
|
||||||
|
Mutable.PreviewMinimum = Math.Clamp(Mutable.PreviewMinimum, 1, 250);
|
||||||
|
|
||||||
|
ImGui.Spacing();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user