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:
@@ -14,7 +14,8 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
|
||||
private string? _applyDismissedFor;
|
||||
|
||||
public string Name => HellionStrings.Settings_Card_ThemeAndLayout_Title + "###tabs-themeandlayout";
|
||||
public string Name =>
|
||||
HellionStrings.Settings_Card_ThemeAndLayout_Title + "###tabs-themeandlayout";
|
||||
|
||||
internal ThemeAndLayout(Plugin plugin, Configuration mutable)
|
||||
{
|
||||
@@ -42,7 +43,8 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
var registry = Plugin.ThemeRegistry;
|
||||
var active = registry.Get(Mutable.Theme);
|
||||
|
||||
var activeLabelTemplate = HellionStrings.ResourceManager.GetString("Settings_Themes_Active") ?? "Active: {0}";
|
||||
var activeLabelTemplate =
|
||||
HellionStrings.ResourceManager.GetString("Settings_Themes_Active") ?? "Active: {0}";
|
||||
ImGui.TextUnformatted(string.Format(activeLabelTemplate, active.Name));
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, 0xFF8FA3B5u))
|
||||
ImGui.TextUnformatted(active.Author);
|
||||
@@ -53,7 +55,9 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
ImGui.Separator();
|
||||
ImGui.Spacing();
|
||||
|
||||
var builtInsLabel = HellionStrings.ResourceManager.GetString("Settings_Themes_BuiltIns") ?? "Built-in themes";
|
||||
var builtInsLabel =
|
||||
HellionStrings.ResourceManager.GetString("Settings_Themes_BuiltIns")
|
||||
?? "Built-in themes";
|
||||
ImGui.TextUnformatted(builtInsLabel);
|
||||
ImGui.Spacing();
|
||||
DrawThemeGrid(registry.AllBuiltIns(), active.Slug);
|
||||
@@ -64,7 +68,9 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
ImGui.Spacing();
|
||||
ImGui.Separator();
|
||||
ImGui.Spacing();
|
||||
var customLabel = HellionStrings.ResourceManager.GetString("Settings_Themes_Custom") ?? "Custom themes";
|
||||
var customLabel =
|
||||
HellionStrings.ResourceManager.GetString("Settings_Themes_Custom")
|
||||
?? "Custom themes";
|
||||
ImGui.TextUnformatted(customLabel);
|
||||
ImGui.Spacing();
|
||||
DrawThemeGrid(customs, active.Slug);
|
||||
@@ -74,7 +80,9 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
ImGui.Separator();
|
||||
ImGui.Spacing();
|
||||
|
||||
var openFolderLabel = HellionStrings.ResourceManager.GetString("Settings_Themes_OpenFolder") ?? "Open themes folder";
|
||||
var openFolderLabel =
|
||||
HellionStrings.ResourceManager.GetString("Settings_Themes_OpenFolder")
|
||||
?? "Open themes folder";
|
||||
if (ImGui.Button(openFolderLabel))
|
||||
{
|
||||
var dir = Path.Combine(Plugin.Interface.ConfigDirectory.FullName, "themes");
|
||||
@@ -83,7 +91,9 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
var exportLabel = HellionStrings.ResourceManager.GetString("Settings_Themes_ExportActive") ?? "Export active...";
|
||||
var exportLabel =
|
||||
HellionStrings.ResourceManager.GetString("Settings_Themes_ExportActive")
|
||||
?? "Export active...";
|
||||
if (ImGui.Button(exportLabel))
|
||||
{
|
||||
var dir = Path.Combine(Plugin.Interface.ConfigDirectory.FullName, "themes");
|
||||
@@ -130,12 +140,26 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
if (isActive)
|
||||
{
|
||||
var border = ColourUtil.RgbaToAbgr(theme.Colors.Primary);
|
||||
draw.AddRect(cursorBefore, cursorBefore + new Vector2(w, h), border, 4f, ImDrawFlags.None, 2f);
|
||||
draw.AddRect(
|
||||
cursorBefore,
|
||||
cursorBefore + new Vector2(w, h),
|
||||
border,
|
||||
4f,
|
||||
ImDrawFlags.None,
|
||||
2f
|
||||
);
|
||||
}
|
||||
else if (hovered)
|
||||
{
|
||||
var border = ColourUtil.RgbaToAbgr(theme.Colors.PrimaryLight & 0xFFFFFF99u);
|
||||
draw.AddRect(cursorBefore, cursorBefore + new Vector2(w, h), border, 4f, ImDrawFlags.None, 1f);
|
||||
draw.AddRect(
|
||||
cursorBefore,
|
||||
cursorBefore + new Vector2(w, h),
|
||||
border,
|
||||
4f,
|
||||
ImDrawFlags.None,
|
||||
1f
|
||||
);
|
||||
}
|
||||
|
||||
var mockupOrigin = cursorBefore + new Vector2(12f, 12f);
|
||||
@@ -166,7 +190,8 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
return;
|
||||
|
||||
var alreadyMatching = themeChatColors.Channels.All(kvp =>
|
||||
Mutable.ChatColours.TryGetValue(kvp.Key, out var current) && current == kvp.Value);
|
||||
Mutable.ChatColours.TryGetValue(kvp.Key, out var current) && current == kvp.Value
|
||||
);
|
||||
if (alreadyMatching)
|
||||
return;
|
||||
|
||||
@@ -181,12 +206,15 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
draw.AddRectFilled(origin, origin + new Vector2(width, height), bgFill, 4f);
|
||||
draw.AddRect(origin, origin + new Vector2(width, height), border, 4f, ImDrawFlags.None, 1f);
|
||||
|
||||
var hint = HellionStrings.ResourceManager.GetString("Settings_Themes_ApplyChatColors_Hint")
|
||||
?? "This theme suggests its own chat channel colours.";
|
||||
var applyLabel = HellionStrings.ResourceManager.GetString("Settings_Themes_ApplyChatColors_Apply")
|
||||
?? "Apply";
|
||||
var keepLabel = HellionStrings.ResourceManager.GetString("Settings_Themes_ApplyChatColors_Keep")
|
||||
?? "Keep current";
|
||||
var hint =
|
||||
HellionStrings.ResourceManager.GetString("Settings_Themes_ApplyChatColors_Hint")
|
||||
?? "This theme suggests its own chat channel colours.";
|
||||
var applyLabel =
|
||||
HellionStrings.ResourceManager.GetString("Settings_Themes_ApplyChatColors_Apply")
|
||||
?? "Apply";
|
||||
var keepLabel =
|
||||
HellionStrings.ResourceManager.GetString("Settings_Themes_ApplyChatColors_Keep")
|
||||
?? "Keep current";
|
||||
|
||||
var textColor = ColourUtil.RgbaToAbgr(active.Colors.TextPrimary);
|
||||
draw.AddText(origin + new Vector2(12f, 10f), textColor, hint);
|
||||
@@ -217,7 +245,9 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
|
||||
private void DrawWindowStyleSection()
|
||||
{
|
||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_ThemeAndLayout_WindowStyle_Heading);
|
||||
using var tree = ImRaii.TreeNode(
|
||||
HellionStrings.Settings_ThemeAndLayout_WindowStyle_Heading
|
||||
);
|
||||
if (!tree.Success)
|
||||
return;
|
||||
|
||||
@@ -225,13 +255,18 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
{
|
||||
ImGui.Checkbox(Language.Options_ShowTitleBar_Name, ref Mutable.ShowTitleBar);
|
||||
|
||||
ImGui.Checkbox(Language.Options_ShowPopOutTitleBar_Name, ref Mutable.ShowPopOutTitleBar);
|
||||
ImGui.Checkbox(
|
||||
Language.Options_ShowPopOutTitleBar_Name,
|
||||
ref Mutable.ShowPopOutTitleBar
|
||||
);
|
||||
|
||||
ImGui.Checkbox(Language.Options_ShowHideButton_Name, ref Mutable.ShowHideButton);
|
||||
ImGuiUtil.HelpMarker(Language.Options_ShowHideButton_Description);
|
||||
|
||||
ImGui.Checkbox(Language.Options_SidebarTabView_Name, ref Mutable.SidebarTabView);
|
||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_SidebarTabView_Description, Plugin.PluginName));
|
||||
ImGuiUtil.HelpMarker(
|
||||
string.Format(Language.Options_SidebarTabView_Description, Plugin.PluginName)
|
||||
);
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.Separator();
|
||||
@@ -241,14 +276,17 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
// Untere Schwelle 50 % verhindert versehentliches Komplett-Wegblenden
|
||||
// des Chat-Hintergrunds (war v1.2.0 Bug bei WindowAlpha=0).
|
||||
var opacityPercent = Mutable.WindowOpacity * 100f;
|
||||
if (ImGuiUtil.DragFloatVertical(
|
||||
if (
|
||||
ImGuiUtil.DragFloatVertical(
|
||||
HellionStrings.Settings_ThemeAndLayout_WindowOpacity_Name,
|
||||
ref opacityPercent,
|
||||
.25f,
|
||||
50f,
|
||||
100f,
|
||||
$"{opacityPercent:N0}%%",
|
||||
ImGuiSliderFlags.AlwaysClamp))
|
||||
ImGuiSliderFlags.AlwaysClamp
|
||||
)
|
||||
)
|
||||
{
|
||||
Mutable.WindowOpacity = opacityPercent / 100f;
|
||||
}
|
||||
@@ -258,24 +296,38 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
|
||||
private void DrawTimestampStyleSection()
|
||||
{
|
||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_ThemeAndLayout_TimestampStyle_Heading);
|
||||
using var tree = ImRaii.TreeNode(
|
||||
HellionStrings.Settings_ThemeAndLayout_TimestampStyle_Heading
|
||||
);
|
||||
if (!tree.Success)
|
||||
return;
|
||||
|
||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
||||
{
|
||||
ImGui.Checkbox(Language.Options_PrettierTimestamps_Name, ref Mutable.PrettierTimestamps);
|
||||
ImGui.Checkbox(
|
||||
Language.Options_PrettierTimestamps_Name,
|
||||
ref Mutable.PrettierTimestamps
|
||||
);
|
||||
ImGuiUtil.HelpMarker(Language.Options_PrettierTimestamps_Description);
|
||||
|
||||
if (Mutable.PrettierTimestamps)
|
||||
{
|
||||
ImGui.Checkbox(Language.Options_MoreCompactPretty_Name, ref Mutable.MoreCompactPretty);
|
||||
ImGui.Checkbox(
|
||||
Language.Options_MoreCompactPretty_Name,
|
||||
ref Mutable.MoreCompactPretty
|
||||
);
|
||||
ImGuiUtil.HelpMarker(Language.Options_MoreCompactPretty_Description);
|
||||
|
||||
ImGui.Checkbox(HellionStrings.Appearance_UseCompactDensity_Name, ref Mutable.UseCompactDensity);
|
||||
ImGui.Checkbox(
|
||||
HellionStrings.Appearance_UseCompactDensity_Name,
|
||||
ref Mutable.UseCompactDensity
|
||||
);
|
||||
ImGuiUtil.HelpMarker(HellionStrings.Appearance_UseCompactDensity_Description);
|
||||
|
||||
ImGui.Checkbox(Language.Options_HideSameTimestamps_Name, ref Mutable.HideSameTimestamps);
|
||||
ImGui.Checkbox(
|
||||
Language.Options_HideSameTimestamps_Name,
|
||||
ref Mutable.HideSameTimestamps
|
||||
);
|
||||
ImGuiUtil.HelpMarker(Language.Options_HideSameTimestamps_Description);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user