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,10 +1,10 @@
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using HellionChat.Code;
|
||||
using HellionChat.Resources;
|
||||
using HellionChat.Util;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
||||
|
||||
namespace HellionChat.Ui.SettingsTabs;
|
||||
|
||||
@@ -42,13 +42,25 @@ internal sealed class Tabs : ISettingsTab
|
||||
|
||||
ImGui.Separator();
|
||||
|
||||
if (ImGui.Selectable(string.Format(Language.Options_Tabs_Preset, Language.Tabs_Presets_General)))
|
||||
if (
|
||||
ImGui.Selectable(
|
||||
string.Format(Language.Options_Tabs_Preset, Language.Tabs_Presets_General)
|
||||
)
|
||||
)
|
||||
Mutable.Tabs.Add(TabsUtil.VanillaGeneral);
|
||||
|
||||
if (ImGui.Selectable(string.Format(Language.Options_Tabs_Preset, Language.Tabs_Presets_Event)))
|
||||
if (
|
||||
ImGui.Selectable(
|
||||
string.Format(Language.Options_Tabs_Preset, Language.Tabs_Presets_Event)
|
||||
)
|
||||
)
|
||||
Mutable.Tabs.Add(TabsUtil.VanillaEvent);
|
||||
|
||||
if (ImGui.Selectable(string.Format(Language.Options_Tabs_Preset, Language.Tabs_Presets_Tell)))
|
||||
if (
|
||||
ImGui.Selectable(
|
||||
string.Format(Language.Options_Tabs_Preset, Language.Tabs_Presets_Tell)
|
||||
)
|
||||
)
|
||||
Mutable.Tabs.Add(TabsUtil.VanillaTellExclusive);
|
||||
}
|
||||
}
|
||||
@@ -68,7 +80,12 @@ internal sealed class Tabs : ISettingsTab
|
||||
|
||||
using var pushedId = ImRaii.PushId($"tab-{i}");
|
||||
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.TrashAlt, tooltip: Language.Options_Tabs_Delete))
|
||||
if (
|
||||
ImGuiUtil.IconButton(
|
||||
FontAwesomeIcon.TrashAlt,
|
||||
tooltip: Language.Options_Tabs_Delete
|
||||
)
|
||||
)
|
||||
{
|
||||
toRemove = i;
|
||||
ToOpen = -1;
|
||||
@@ -76,7 +93,10 @@ internal sealed class Tabs : ISettingsTab
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.ArrowUp, tooltip: Language.Options_Tabs_MoveUp) && i > 0)
|
||||
if (
|
||||
ImGuiUtil.IconButton(FontAwesomeIcon.ArrowUp, tooltip: Language.Options_Tabs_MoveUp)
|
||||
&& i > 0
|
||||
)
|
||||
{
|
||||
(Mutable.Tabs[i - 1], Mutable.Tabs[i]) = (Mutable.Tabs[i], Mutable.Tabs[i - 1]);
|
||||
ToOpen = i - 1;
|
||||
@@ -84,13 +104,24 @@ internal sealed class Tabs : ISettingsTab
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.ArrowDown, tooltip: Language.Options_Tabs_MoveDown) && i < Mutable.Tabs.Count - 1)
|
||||
if (
|
||||
ImGuiUtil.IconButton(
|
||||
FontAwesomeIcon.ArrowDown,
|
||||
tooltip: Language.Options_Tabs_MoveDown
|
||||
)
|
||||
&& i < Mutable.Tabs.Count - 1
|
||||
)
|
||||
{
|
||||
(Mutable.Tabs[i + 1], Mutable.Tabs[i]) = (Mutable.Tabs[i], Mutable.Tabs[i + 1]);
|
||||
ToOpen = i + 1;
|
||||
}
|
||||
|
||||
ImGui.InputText(Language.Options_Tabs_Name, ref tab.Name, 512, ImGuiInputTextFlags.EnterReturnsTrue);
|
||||
ImGui.InputText(
|
||||
Language.Options_Tabs_Name,
|
||||
ref tab.Name,
|
||||
512,
|
||||
ImGuiInputTextFlags.EnterReturnsTrue
|
||||
);
|
||||
|
||||
// v1.2.0 — Per-Tab Icon-Override. Default-Mapping greift falls nichts gesetzt.
|
||||
ImGui.TextUnformatted(HellionStrings.Tabs_Icon_Label);
|
||||
@@ -98,15 +129,19 @@ internal sealed class Tabs : ISettingsTab
|
||||
ImGuiUtil.HelpMarker(HellionStrings.Tabs_Icon_HelpMarker);
|
||||
|
||||
var iconCurrent = string.IsNullOrEmpty(tab.Icon) ? "" : tab.Icon;
|
||||
var iconPreview = iconCurrent.Length == 0
|
||||
? HellionStrings.Tabs_Icon_DefaultOption
|
||||
: iconCurrent;
|
||||
var iconPreview =
|
||||
iconCurrent.Length == 0 ? HellionStrings.Tabs_Icon_DefaultOption : iconCurrent;
|
||||
using (var combo = ImRaii.Combo($"##icon-{i}", iconPreview))
|
||||
{
|
||||
if (combo.Success)
|
||||
{
|
||||
// Erste Option: Default (löscht Icon, lässt Mapping greifen).
|
||||
if (ImGui.Selectable(HellionStrings.Tabs_Icon_DefaultOption, iconCurrent.Length == 0))
|
||||
if (
|
||||
ImGui.Selectable(
|
||||
HellionStrings.Tabs_Icon_DefaultOption,
|
||||
iconCurrent.Length == 0
|
||||
)
|
||||
)
|
||||
{
|
||||
tab.Icon = null;
|
||||
}
|
||||
@@ -116,7 +151,11 @@ internal sealed class Tabs : ISettingsTab
|
||||
// Pool-Optionen aus TabIconGlyphResolver.PickerOptions (Single-Source-of-Truth).
|
||||
foreach (var option in TabIconGlyphResolver.PickerOptions)
|
||||
{
|
||||
var isSelected = string.Equals(iconCurrent, option, StringComparison.OrdinalIgnoreCase);
|
||||
var isSelected = string.Equals(
|
||||
iconCurrent,
|
||||
option,
|
||||
StringComparison.OrdinalIgnoreCase
|
||||
);
|
||||
if (ImGui.Selectable(option, isSelected))
|
||||
{
|
||||
tab.Icon = option;
|
||||
@@ -130,27 +169,53 @@ internal sealed class Tabs : ISettingsTab
|
||||
if (tab.PopOut)
|
||||
{
|
||||
using var _ = ImRaii.PushIndent(10.0f);
|
||||
ImGui.Checkbox(Language.Options_Tabs_IndependentOpacity, ref tab.IndependentOpacity);
|
||||
ImGui.Checkbox(
|
||||
Language.Options_Tabs_IndependentOpacity,
|
||||
ref tab.IndependentOpacity
|
||||
);
|
||||
if (tab.IndependentOpacity)
|
||||
ImGuiUtil.DragFloatVertical(Language.Options_Tabs_Opacity, ref tab.Opacity, 0.25f, 0f, 100f, $"{tab.Opacity:N2}%%", ImGuiSliderFlags.AlwaysClamp);
|
||||
ImGuiUtil.DragFloatVertical(
|
||||
Language.Options_Tabs_Opacity,
|
||||
ref tab.Opacity,
|
||||
0.25f,
|
||||
0f,
|
||||
100f,
|
||||
$"{tab.Opacity:N2}%%",
|
||||
ImGuiSliderFlags.AlwaysClamp
|
||||
);
|
||||
|
||||
ImGui.Checkbox(Language.Options_Tabs_IndependentHide, ref tab.IndependentHide);
|
||||
if (tab.IndependentHide)
|
||||
{
|
||||
using var __ = ImRaii.PushIndent(10.0f);
|
||||
ImGuiUtil.OptionCheckbox(ref tab.HideDuringCutscenes, Language.Options_HideDuringCutscenes_Name);
|
||||
ImGuiUtil.OptionCheckbox(
|
||||
ref tab.HideDuringCutscenes,
|
||||
Language.Options_HideDuringCutscenes_Name
|
||||
);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref tab.HideWhenNotLoggedIn, Language.Options_HideWhenNotLoggedIn_Name);
|
||||
ImGuiUtil.OptionCheckbox(
|
||||
ref tab.HideWhenNotLoggedIn,
|
||||
Language.Options_HideWhenNotLoggedIn_Name
|
||||
);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref tab.HideWhenUiHidden, Language.Options_HideWhenUiHidden_Name);
|
||||
ImGuiUtil.OptionCheckbox(
|
||||
ref tab.HideWhenUiHidden,
|
||||
Language.Options_HideWhenUiHidden_Name
|
||||
);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref tab.HideInLoadingScreens, Language.Options_HideInLoadingScreens_Name);
|
||||
ImGuiUtil.OptionCheckbox(
|
||||
ref tab.HideInLoadingScreens,
|
||||
Language.Options_HideInLoadingScreens_Name
|
||||
);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref tab.HideInBattle, Language.Options_HideInBattle_Name);
|
||||
ImGuiUtil.OptionCheckbox(
|
||||
ref tab.HideInBattle,
|
||||
Language.Options_HideInBattle_Name
|
||||
);
|
||||
ImGui.Spacing();
|
||||
}
|
||||
|
||||
@@ -161,7 +226,12 @@ internal sealed class Tabs : ISettingsTab
|
||||
ImGui.Spacing();
|
||||
}
|
||||
|
||||
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_Tabs_UnreadMode, tab.UnreadMode.Name()))
|
||||
using (
|
||||
var combo = ImGuiUtil.BeginComboVertical(
|
||||
Language.Options_Tabs_UnreadMode,
|
||||
tab.UnreadMode.Name()
|
||||
)
|
||||
)
|
||||
{
|
||||
if (combo.Success)
|
||||
{
|
||||
@@ -182,16 +252,32 @@ internal sealed class Tabs : ISettingsTab
|
||||
ImGui.Checkbox(Language.Options_Tabs_NoInput, ref tab.InputDisabled);
|
||||
if (!tab.InputDisabled)
|
||||
{
|
||||
var input = tab.Channel?.ToChatType().Name() ?? Language.Options_Tabs_NoInputChannel;
|
||||
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_Tabs_InputChannel, input))
|
||||
var input =
|
||||
tab.Channel?.ToChatType().Name() ?? Language.Options_Tabs_NoInputChannel;
|
||||
using (
|
||||
var combo = ImGuiUtil.BeginComboVertical(
|
||||
Language.Options_Tabs_InputChannel,
|
||||
input
|
||||
)
|
||||
)
|
||||
{
|
||||
if (combo.Success)
|
||||
{
|
||||
if (ImGui.Selectable(Language.Options_Tabs_NoInputChannel, tab.Channel == null))
|
||||
if (
|
||||
ImGui.Selectable(
|
||||
Language.Options_Tabs_NoInputChannel,
|
||||
tab.Channel == null
|
||||
)
|
||||
)
|
||||
tab.Channel = null;
|
||||
|
||||
foreach (var channel in Enum.GetValues<InputChannel>())
|
||||
if (ImGui.Selectable(channel.ToChatType().Name(), tab.Channel == channel))
|
||||
if (
|
||||
ImGui.Selectable(
|
||||
channel.ToChatType().Name(),
|
||||
tab.Channel == channel
|
||||
)
|
||||
)
|
||||
tab.Channel = channel;
|
||||
}
|
||||
}
|
||||
@@ -202,7 +288,11 @@ internal sealed class Tabs : ISettingsTab
|
||||
ImGui.Checkbox(Language.Options_Tabs_SenderMessages, ref tab.AllSenderMessages);
|
||||
ImGuiUtil.HelpText(Language.Options_Help_SenderMessages);
|
||||
|
||||
var worlds = Sheets.WorldsOnDatacenter(player).OrderByDescending(world => world.DataCenter.RowId).ThenBy(world => world.Name.ToString()).ToList();
|
||||
var worlds = Sheets
|
||||
.WorldsOnDatacenter(player)
|
||||
.OrderByDescending(world => world.DataCenter.RowId)
|
||||
.ThenBy(world => world.Name.ToString())
|
||||
.ToList();
|
||||
|
||||
using (ImRaii.ItemWidth(ImGui.GetWindowWidth() / 3f))
|
||||
{
|
||||
@@ -225,18 +315,30 @@ internal sealed class Tabs : ISettingsTab
|
||||
}
|
||||
else
|
||||
{
|
||||
var selectedWorld = worlds.FindIndex(world => world.RowId == tab.TellTarget.World);
|
||||
var selectedWorld = worlds.FindIndex(world =>
|
||||
world.RowId == tab.TellTarget.World
|
||||
);
|
||||
if (selectedWorld == -1)
|
||||
selectedWorld = 0;
|
||||
|
||||
using (var combo = ImRaii.Combo("###player-world", worlds[selectedWorld].Name.ToString()))
|
||||
using (
|
||||
var combo = ImRaii.Combo(
|
||||
"###player-world",
|
||||
worlds[selectedWorld].Name.ToString()
|
||||
)
|
||||
)
|
||||
{
|
||||
if (combo.Success)
|
||||
{
|
||||
var lastDc = worlds.First().DataCenter.RowId;
|
||||
foreach (var (idx, world) in worlds.Index())
|
||||
{
|
||||
if (ImGui.Selectable(world.Name.ToString(), selectedWorld == idx))
|
||||
if (
|
||||
ImGui.Selectable(
|
||||
world.Name.ToString(),
|
||||
selectedWorld == idx
|
||||
)
|
||||
)
|
||||
{
|
||||
selectedWorld = idx;
|
||||
tab.TellTarget.World = worlds[selectedWorld].RowId;
|
||||
@@ -253,7 +355,9 @@ internal sealed class Tabs : ISettingsTab
|
||||
}
|
||||
}
|
||||
|
||||
var target = (Plugin.TargetManager.SoftTarget ?? Plugin.TargetManager.Target) as IPlayerCharacter;
|
||||
var target =
|
||||
(Plugin.TargetManager.SoftTarget ?? Plugin.TargetManager.Target)
|
||||
as IPlayerCharacter;
|
||||
using (ImRaii.Disabled(target == null))
|
||||
{
|
||||
if (ImGui.Button("Set to target") && target != null)
|
||||
@@ -263,7 +367,11 @@ internal sealed class Tabs : ISettingsTab
|
||||
}
|
||||
|
||||
ImGuiUtil.ChannelSelector(Language.Options_Tabs_Channels, tab.SelectedChannels);
|
||||
ImGuiUtil.ExtraChatSelector(Language.Options_Tabs_ExtraChatChannels, ref tab.ExtraChatAll, tab.ExtraChatChannels);
|
||||
ImGuiUtil.ExtraChatSelector(
|
||||
Language.Options_Tabs_ExtraChatChannels,
|
||||
ref tab.ExtraChatAll,
|
||||
tab.ExtraChatChannels
|
||||
);
|
||||
}
|
||||
|
||||
if (toRemove > -1)
|
||||
|
||||
Reference in New Issue
Block a user