feat: add spacing and descriptions for fonts
This commit is contained in:
parent
4bac9aee8d
commit
0699f5129f
|
@ -267,6 +267,33 @@ namespace ChatTwo.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The font Chat 2 will use to display non-Japanese text..
|
||||
/// </summary>
|
||||
internal static string Options_Font_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_Font_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Font.
|
||||
/// </summary>
|
||||
internal static string Options_Font_Name {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_Font_Name", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Using certain system fonts may crash your game. You have been warned..
|
||||
/// </summary>
|
||||
internal static string Options_Font_Warning {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_Font_Warning", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Font size.
|
||||
/// </summary>
|
||||
|
@ -312,6 +339,24 @@ namespace ChatTwo.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The font Chat 2 will use to display Japanese text..
|
||||
/// </summary>
|
||||
internal static string Options_JapaneseFont_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_JapaneseFont_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Japanese font.
|
||||
/// </summary>
|
||||
internal static string Options_JapaneseFont_Name {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_JapaneseFont_Name", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Reduce the spacing between messages..
|
||||
/// </summary>
|
||||
|
|
|
@ -320,4 +320,19 @@
|
|||
<data name="ChatSource_OtherPet" xml:space="preserve">
|
||||
<value>Pet (Other)</value>
|
||||
</data>
|
||||
<data name="Options_Font_Name" xml:space="preserve">
|
||||
<value>Font</value>
|
||||
</data>
|
||||
<data name="Options_JapaneseFont_Name" xml:space="preserve">
|
||||
<value>Japanese font</value>
|
||||
</data>
|
||||
<data name="Options_Font_Description" xml:space="preserve">
|
||||
<value>The font Chat 2 will use to display non-Japanese text.</value>
|
||||
</data>
|
||||
<data name="Options_Font_Warning" xml:space="preserve">
|
||||
<value>Using certain system fonts may crash your game. You have been warned.</value>
|
||||
</data>
|
||||
<data name="Options_JapaneseFont_Description" xml:space="preserve">
|
||||
<value>The font Chat 2 will use to display Japanese text.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
|
@ -34,10 +34,20 @@ internal sealed class Display : ISettingsTab {
|
|||
this.UpdateFonts();
|
||||
}
|
||||
|
||||
ImGui.PushTextWrapPos();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.HideChat, Language.Options_HideChat_Name, Language.Options_HideChat_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.HideDuringCutscenes, Language.Options_HideDuringCutscenes_Name, Language.Options_HideDuringCutscenes_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.NativeItemTooltips, Language.Options_NativeItemTooltips_Name, Language.Options_NativeItemTooltips_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.SidebarTabView, Language.Options_SidebarTabView_Name, Language.Options_SidebarTabView_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.PrettierTimestamps, Language.Options_PrettierTimestamps_Name, Language.Options_PrettierTimestamps_Description);
|
||||
|
||||
if (this.Mutable.PrettierTimestamps) {
|
||||
|
@ -46,9 +56,12 @@ internal sealed class Display : ISettingsTab {
|
|||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.ShowNoviceNetwork, Language.Options_ShowNoviceNetwork_Name, Language.Options_ShowNoviceNetwork_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
if (ImGui.BeginCombo("Font", this.Mutable.GlobalFont)) {
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.ShowNoviceNetwork, Language.Options_ShowNoviceNetwork_Name, Language.Options_ShowNoviceNetwork_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
if (ImGui.BeginCombo(Language.Options_Font_Name, this.Mutable.GlobalFont)) {
|
||||
foreach (var font in Ui.Fonts.GlobalFonts) {
|
||||
if (ImGui.Selectable(font.Name, this.Mutable.GlobalFont == font.Name)) {
|
||||
this.Mutable.GlobalFont = font.Name;
|
||||
|
@ -78,7 +91,11 @@ internal sealed class Display : ISettingsTab {
|
|||
ImGui.EndCombo();
|
||||
}
|
||||
|
||||
if (ImGui.BeginCombo("Japanese font", this.Mutable.JapaneseFont)) {
|
||||
ImGuiUtil.HelpText(Language.Options_Font_Description);
|
||||
ImGuiUtil.WarningText(Language.Options_Font_Warning);
|
||||
ImGui.Spacing();
|
||||
|
||||
if (ImGui.BeginCombo(Language.Options_JapaneseFont_Name, this.Mutable.JapaneseFont)) {
|
||||
foreach (var (name, _) in Ui.Fonts.JapaneseFonts) {
|
||||
if (ImGui.Selectable(name, this.Mutable.JapaneseFont == name)) {
|
||||
this.Mutable.JapaneseFont = name;
|
||||
|
@ -104,6 +121,9 @@ internal sealed class Display : ISettingsTab {
|
|||
ImGui.EndCombo();
|
||||
}
|
||||
|
||||
ImGuiUtil.HelpText(Language.Options_JapaneseFont_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGui.DragFloat(Language.Options_FontSize_Name, ref this.Mutable.FontSize, .0125f, 12f, 36f, $"{this.Mutable.FontSize:N1}");
|
||||
if (ImGui.DragFloat(Language.Options_WindowOpacity_Name, ref this.Mutable.WindowAlpha, .0025f, 0f, 1f, $"{this.Mutable.WindowAlpha * 100f:N2}%%")) {
|
||||
switch (this.Mutable.WindowAlpha) {
|
||||
|
@ -116,8 +136,17 @@ internal sealed class Display : ISettingsTab {
|
|||
}
|
||||
}
|
||||
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.CanMove, Language.Options_CanMove_Name);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.CanResize, Language.Options_CanResize_Name);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.ShowTitleBar, Language.Options_ShowTitleBar_Name);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGui.PopTextWrapPos();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System.Text;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Style;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace ChatTwo.Util;
|
||||
|
@ -110,18 +111,36 @@ internal static class ImGuiUtil {
|
|||
var ret = ImGui.Checkbox(label, ref value);
|
||||
|
||||
if (description != null) {
|
||||
var colour = ImGui.GetStyle().Colors[(int) ImGuiCol.TextDisabled];
|
||||
ImGui.PushStyleColor(ImGuiCol.Text, colour);
|
||||
ImGui.PushTextWrapPos();
|
||||
|
||||
try {
|
||||
ImGui.TextUnformatted(description);
|
||||
} finally {
|
||||
ImGui.PopTextWrapPos();
|
||||
ImGui.PopStyleColor();
|
||||
}
|
||||
HelpText(description);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
internal static void HelpText(string text) {
|
||||
var colour = ImGui.GetStyle().Colors[(int) ImGuiCol.TextDisabled];
|
||||
ImGui.PushStyleColor(ImGuiCol.Text, colour);
|
||||
ImGui.PushTextWrapPos();
|
||||
|
||||
try {
|
||||
ImGui.TextUnformatted(text);
|
||||
} finally {
|
||||
ImGui.PopTextWrapPos();
|
||||
ImGui.PopStyleColor();
|
||||
}
|
||||
}
|
||||
|
||||
internal static void WarningText(string text) {
|
||||
var style = StyleModel.GetConfiguredStyle() ?? StyleModel.GetFromCurrent();
|
||||
var dalamudOrange = style.BuiltInColors?.DalamudOrange;
|
||||
if (dalamudOrange != null) {
|
||||
ImGui.PushStyleColor(ImGuiCol.Text, dalamudOrange.Value);
|
||||
}
|
||||
|
||||
ImGui.TextUnformatted(text);
|
||||
|
||||
if (dalamudOrange != null) {
|
||||
ImGui.PopStyleColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue