chore: housekeeping — linter & formatter setup
Add .prettierrc.json, .markdownlint.json, .yamllint.yaml, .gitattributes Run CSharpier, Prettier and markdownlint across the entire codebase. No logic changes — formatting, using order and line endings only.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
using HellionChat.Code;
|
||||
using HellionChat.Resources;
|
||||
using HellionChat.Util;
|
||||
using Dalamud;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.FontIdentifier;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using HellionChat.Code;
|
||||
using HellionChat.Resources;
|
||||
using HellionChat.Util;
|
||||
|
||||
namespace HellionChat.Ui.SettingsTabs;
|
||||
|
||||
@@ -15,7 +15,8 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
private Plugin Plugin { get; }
|
||||
private Configuration Mutable { get; }
|
||||
|
||||
public string Name => HellionStrings.Settings_Card_FontsAndColours_Title + "###tabs-fontsandcolours";
|
||||
public string Name =>
|
||||
HellionStrings.Settings_Card_FontsAndColours_Title + "###tabs-fontsandcolours";
|
||||
|
||||
internal FontsAndColours(Plugin plugin, Configuration mutable)
|
||||
{
|
||||
@@ -38,7 +39,9 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
|
||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
||||
{
|
||||
if (ImGui.Checkbox(HellionStrings.Theme_UseHellionFont_Name, ref Mutable.UseHellionFont))
|
||||
if (
|
||||
ImGui.Checkbox(HellionStrings.Theme_UseHellionFont_Name, ref Mutable.UseHellionFont)
|
||||
)
|
||||
{
|
||||
if (Mutable.UseHellionFont)
|
||||
Mutable.FontsEnabled = false;
|
||||
@@ -51,7 +54,10 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
ImGuiUtil.FontSizeCombo(Language.Options_FontSize_Name, ref Mutable.FontSizeV2);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.FontSizeCombo(Language.Options_SymbolsFontSize_Name, ref Mutable.SymbolsFontSizeV2);
|
||||
ImGuiUtil.FontSizeCombo(
|
||||
Language.Options_SymbolsFontSize_Name,
|
||||
ref Mutable.SymbolsFontSizeV2
|
||||
);
|
||||
ImGuiUtil.HelpMarker(Language.Options_SymbolsFontSize_Description);
|
||||
|
||||
ImGui.Spacing();
|
||||
@@ -68,7 +74,12 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
}
|
||||
else
|
||||
{
|
||||
var globalChooser = ImGuiUtil.FontChooser(Language.Options_Font_Name, Mutable.GlobalFontV2, false, ref unused);
|
||||
var globalChooser = ImGuiUtil.FontChooser(
|
||||
Language.Options_Font_Name,
|
||||
Mutable.GlobalFontV2,
|
||||
false,
|
||||
ref unused
|
||||
);
|
||||
globalChooser?.ResultTask.ContinueWith(r =>
|
||||
{
|
||||
if (r.IsCompletedSuccessfully)
|
||||
@@ -79,14 +90,27 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("Reset##global"))
|
||||
{
|
||||
Mutable.GlobalFontV2 = new SingleFontSpec { FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular), SizePt = 12.75f };
|
||||
Mutable.GlobalFontV2 = new SingleFontSpec
|
||||
{
|
||||
FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular),
|
||||
SizePt = 12.75f,
|
||||
};
|
||||
}
|
||||
|
||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_Font_Description, Plugin.PluginName));
|
||||
ImGuiUtil.HelpMarker(
|
||||
string.Format(Language.Options_Font_Description, Plugin.PluginName)
|
||||
);
|
||||
ImGuiUtil.WarningText(Language.Options_Font_Warning);
|
||||
ImGui.Spacing();
|
||||
|
||||
var japaneseChooser = ImGuiUtil.FontChooser(Language.Options_JapaneseFont_Name, Mutable.JapaneseFontV2, false, ref unused, id => !id.LocaleNames?.ContainsKey("ja-jp") ?? false, "いろはにほへと ちりぬるを");
|
||||
var japaneseChooser = ImGuiUtil.FontChooser(
|
||||
Language.Options_JapaneseFont_Name,
|
||||
Mutable.JapaneseFontV2,
|
||||
false,
|
||||
ref unused,
|
||||
id => !id.LocaleNames?.ContainsKey("ja-jp") ?? false,
|
||||
"いろはにほへと ちりぬるを"
|
||||
);
|
||||
japaneseChooser?.ResultTask.ContinueWith(r =>
|
||||
{
|
||||
if (r.IsCompletedSuccessfully)
|
||||
@@ -97,13 +121,24 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("Reset##japanese"))
|
||||
{
|
||||
Mutable.JapaneseFontV2 = new SingleFontSpec { FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkMedium), SizePt = 12.75f };
|
||||
Mutable.JapaneseFontV2 = new SingleFontSpec
|
||||
{
|
||||
FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkMedium),
|
||||
SizePt = 12.75f,
|
||||
};
|
||||
}
|
||||
|
||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_JapaneseFont_Description, Plugin.PluginName));
|
||||
ImGuiUtil.HelpMarker(
|
||||
string.Format(Language.Options_JapaneseFont_Description, Plugin.PluginName)
|
||||
);
|
||||
ImGui.Spacing();
|
||||
|
||||
var italicChooser = ImGuiUtil.FontChooser(Language.Options_ItalicFont_Name, Mutable.ItalicFontV2, true, ref Mutable.ItalicEnabled);
|
||||
var italicChooser = ImGuiUtil.FontChooser(
|
||||
Language.Options_ItalicFont_Name,
|
||||
Mutable.ItalicFontV2,
|
||||
true,
|
||||
ref Mutable.ItalicEnabled
|
||||
);
|
||||
italicChooser?.ResultTask.ContinueWith(r =>
|
||||
{
|
||||
if (r.IsCompletedSuccessfully)
|
||||
@@ -115,15 +150,23 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
if (ImGui.Button("Reset##italic"))
|
||||
{
|
||||
Mutable.ItalicEnabled = false;
|
||||
Mutable.ItalicFontV2 = new SingleFontSpec { FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular), SizePt = 12.75f };
|
||||
Mutable.ItalicFontV2 = new SingleFontSpec
|
||||
{
|
||||
FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular),
|
||||
SizePt = 12.75f,
|
||||
};
|
||||
}
|
||||
|
||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_Italic_Description, Plugin.PluginName));
|
||||
ImGuiUtil.HelpMarker(
|
||||
string.Format(Language.Options_Italic_Description, Plugin.PluginName)
|
||||
);
|
||||
ImGui.Spacing();
|
||||
|
||||
if (ImGui.CollapsingHeader(Language.Options_ExtraGlyphs_Name))
|
||||
{
|
||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_ExtraGlyphs_Description, Plugin.PluginName));
|
||||
ImGuiUtil.HelpMarker(
|
||||
string.Format(Language.Options_ExtraGlyphs_Description, Plugin.PluginName)
|
||||
);
|
||||
|
||||
var range = (int)Mutable.ExtraGlyphRanges;
|
||||
foreach (var extra in Enum.GetValues<ExtraGlyphRanges>())
|
||||
@@ -137,7 +180,10 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
ImGui.Spacing();
|
||||
}
|
||||
|
||||
ImGuiUtil.FontSizeCombo(Language.Options_SymbolsFontSize_Name, ref Mutable.SymbolsFontSizeV2);
|
||||
ImGuiUtil.FontSizeCombo(
|
||||
Language.Options_SymbolsFontSize_Name,
|
||||
ref Mutable.SymbolsFontSizeV2
|
||||
);
|
||||
ImGuiUtil.HelpMarker(Language.Options_SymbolsFontSize_Description);
|
||||
|
||||
ImGui.Spacing();
|
||||
@@ -158,7 +204,10 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
ImGui.Separator();
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGui.Checkbox(Language.Options_ColorSelectedInputChannelButton_Name, ref Mutable.ColorSelectedInputChannelButton);
|
||||
ImGui.Checkbox(
|
||||
Language.Options_ColorSelectedInputChannelButton_Name,
|
||||
ref Mutable.ColorSelectedInputChannelButton
|
||||
);
|
||||
ImGuiUtil.HelpMarker(Language.Options_ColorSelectedInputChannelButton_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
@@ -166,14 +215,26 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
{
|
||||
foreach (var type in types)
|
||||
{
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.UndoAlt, $"{type}", Language.Options_ChatColours_Reset))
|
||||
if (
|
||||
ImGuiUtil.IconButton(
|
||||
FontAwesomeIcon.UndoAlt,
|
||||
$"{type}",
|
||||
Language.Options_ChatColours_Reset
|
||||
)
|
||||
)
|
||||
{
|
||||
Mutable.ChatColours.Remove(type);
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.LongArrowAltDown, $"{type}", Language.Options_ChatColours_Import))
|
||||
if (
|
||||
ImGuiUtil.IconButton(
|
||||
FontAwesomeIcon.LongArrowAltDown,
|
||||
$"{type}",
|
||||
Language.Options_ChatColours_Import
|
||||
)
|
||||
)
|
||||
{
|
||||
var gameColour = Plugin.Functions.Chat.GetChannelColor(type);
|
||||
Mutable.ChatColours[type] = gameColour ?? type.DefaultColor() ?? 0;
|
||||
@@ -210,8 +271,14 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
{
|
||||
var border = ColourUtil.RgbaToVector3(ColourUtil.ComponentsToRgba(255, 128, 200));
|
||||
var btn = ColourUtil.RgbaToVector3(ColourUtil.ComponentsToRgba(74, 42, 106));
|
||||
ImGui.PushStyleColor(ImGuiCol.Border, new System.Numerics.Vector4(border.X, border.Y, border.Z, 1f));
|
||||
ImGui.PushStyleColor(ImGuiCol.Button, new System.Numerics.Vector4(btn.X, btn.Y, btn.Z, 1f));
|
||||
ImGui.PushStyleColor(
|
||||
ImGuiCol.Border,
|
||||
new System.Numerics.Vector4(border.X, border.Y, border.Z, 1f)
|
||||
);
|
||||
ImGui.PushStyleColor(
|
||||
ImGuiCol.Button,
|
||||
new System.Numerics.Vector4(btn.X, btn.Y, btn.Z, 1f)
|
||||
);
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.FrameBorderSize, 1.5f);
|
||||
}
|
||||
|
||||
@@ -230,7 +297,10 @@ internal sealed class FontsAndColours : ISettingsTab
|
||||
|
||||
private static string GetPresetLabel(ChatColourPreset preset)
|
||||
{
|
||||
var localized = HellionStrings.ResourceManager.GetString(preset.LocalizationKey, HellionStrings.Culture);
|
||||
var localized = HellionStrings.ResourceManager.GetString(
|
||||
preset.LocalizationKey,
|
||||
HellionStrings.Culture
|
||||
);
|
||||
return string.IsNullOrEmpty(localized) ? preset.DisplayName : localized;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user