diff --git a/LightlessSync/LightlessConfiguration/Configurations/LightlessConfig.cs b/LightlessSync/LightlessConfiguration/Configurations/LightlessConfig.cs index 7194c60..6703f1c 100644 --- a/LightlessSync/LightlessConfiguration/Configurations/LightlessConfig.cs +++ b/LightlessSync/LightlessConfiguration/Configurations/LightlessConfig.cs @@ -67,6 +67,7 @@ public class LightlessConfig : ILightlessConfiguration public bool UseFocusTarget { get; set; } = false; public bool overrideFriendColor { get; set; } = false; public bool overridePartyColor { get; set; } = false; + public bool overrideFcTagColor { get; set; } = false; public bool useColoredUIDs { get; set; } = true; public bool BroadcastEnabled { get; set; } = false; public DateTime BroadcastTtl { get; set; } = DateTime.MinValue; diff --git a/LightlessSync/LightlessSync.csproj b/LightlessSync/LightlessSync.csproj index 344e968..5b31c88 100644 --- a/LightlessSync/LightlessSync.csproj +++ b/LightlessSync/LightlessSync.csproj @@ -3,7 +3,7 @@ - 1.12.0 + 1.12.3 https://github.com/Light-Public-Syncshells/LightlessClient diff --git a/LightlessSync/Services/NameplateService.cs b/LightlessSync/Services/NameplateService.cs index 6a94a53..27fa06f 100644 --- a/LightlessSync/Services/NameplateService.cs +++ b/LightlessSync/Services/NameplateService.cs @@ -1,4 +1,4 @@ -using Dalamud.Game.ClientState.Objects.Enums; +using Dalamud.Game.ClientState.Objects.Enums; using Dalamud.Game.Gui.NamePlate; using Dalamud.Game.Text.SeStringHandling; using Dalamud.Plugin.Services; @@ -68,10 +68,14 @@ public class NameplateService : DisposableMediatorSubscriberBase (isFriend && !friendColorAllowed) )) { - //_logger.LogInformation("added nameplate color to {Name}", playerCharacter.Name.TextValue); handler.NameParts.TextWrap = CreateTextWrap(colors); - } + if (_configService.Current.overrideFcTagColor) + { + handler.FreeCompanyTagParts.OuterWrap = CreateTextWrap(colors); + handler.FreeCompanyTagParts.TextWrap = CreateTextWrap(colors); + } + } } } diff --git a/LightlessSync/UI/SettingsUi.cs b/LightlessSync/UI/SettingsUi.cs index 2047fa0..cb34877 100644 --- a/LightlessSync/UI/SettingsUi.cs +++ b/LightlessSync/UI/SettingsUi.cs @@ -1,4 +1,4 @@ -using Dalamud.Bindings.ImGui; +using Dalamud.Bindings.ImGui; using Dalamud.Interface; using Dalamud.Interface.Colors; using Dalamud.Interface.Utility; @@ -978,45 +978,68 @@ public class SettingsUi : WindowMediatorSubscriberBase var colorNames = new[] { - ("LightlessPurple", "Lightless Purple", "Primary colors"), - ("LightlessPurpleActive", "Lightless Purple Active", "Primary colors"), - ("LightlessPurpleDefault", "Lightless Purple Inactive", "Primary colors"), - ("LightlessBlue", "Lightless Blue", "Secondary colors"), + ("LightlessPurple", "Primary Purple", "Section titles and dividers"), + ("LightlessPurpleActive", "Primary Purple (Active)", "Active tabs and hover highlights"), + ("LightlessPurpleDefault", "Primary Purple (Inactive)", "Inactive tabs and default dividers"), + ("LightlessBlue", "Secondary Blue", "Secondary title colors, visable pairs"), - ("LightlessGreen", "Lightless Green", "Active elements"), + ("LightlessGreen", "Success Green", "Join buttons and success messages"), - ("LightlessYellow", "Lightless Yellow", "Warning colors"), - ("LightlessYellow2", "Lightless Yellow 2", "Warning colors"), + ("LightlessYellow", "Warning Yellow", "Warning colors"), + ("LightlessYellow2", "Warning Yellow (Alt)", "Warning colors"), - ("PairBlue", "Pair Blue", "Pair UI elements"), + ("PairBlue", "Syncshell Blue", "Syncshell headers, toggle highlights, and moderator actions"), - ("DimRed", "Dim Red", "Error and offline") + ("DimRed", "Error Red", "Error and offline colors") }; - - foreach (var (colorKey, displayName, description) in colorNames) + if (ImGui.BeginTable("##ColorTable", 3, ImGuiTableFlags.Borders | ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit)) { - var currentColor = UIColors.Get(colorKey); - var colorToEdit = currentColor; + ImGui.TableSetupColumn("Color", ImGuiTableColumnFlags.WidthFixed); + ImGui.TableSetupColumn("Description", ImGuiTableColumnFlags.WidthStretch); + ImGui.TableSetupColumn("Reset", ImGuiTableColumnFlags.WidthFixed, 40); + ImGui.TableHeadersRow(); - ImGui.AlignTextToFramePadding(); - - if (ImGui.ColorEdit4($"##color_{colorKey}", ref colorToEdit, ImGuiColorEditFlags.NoInputs | ImGuiColorEditFlags.AlphaPreviewHalf)) + foreach (var (colorKey, displayName, description) in colorNames) { - UIColors.Set(colorKey, colorToEdit); - } - - ImGui.SameLine(); - ImGui.TextUnformatted($"{displayName} - {description}"); - - if (UIColors.IsCustom(colorKey)) - { - ImGui.SameLine(); - if (_uiShared.IconTextButton(FontAwesomeIcon.Undo, $"Reset {colorKey}")) + ImGui.TableNextRow(); + + // color column + ImGui.TableSetColumnIndex(0); + var currentColor = UIColors.Get(colorKey); + var colorToEdit = currentColor; + if (ImGui.ColorEdit4($"##color_{colorKey}", ref colorToEdit, ImGuiColorEditFlags.NoInputs | ImGuiColorEditFlags.AlphaPreviewHalf)) { - UIColors.Reset(colorKey); + UIColors.Set(colorKey, colorToEdit); } - UiSharedService.AttachToolTip("Reset this color to default"); + ImGui.SameLine(); + ImGui.AlignTextToFramePadding(); + ImGui.TextUnformatted(displayName); + + // description column + ImGui.TableSetColumnIndex(1); + ImGui.AlignTextToFramePadding(); + ImGui.TextUnformatted(description); + + // actions column + ImGui.TableSetColumnIndex(2); + using var resetId = ImRaii.PushId($"Reset_{colorKey}"); + var availableWidth = ImGui.GetContentRegionAvail().X; + var isCustom = UIColors.IsCustom(colorKey); + + using (ImRaii.Disabled(!isCustom)) + { + using (ImRaii.PushFont(UiBuilder.IconFont)) + { + if (ImGui.Button(FontAwesomeIcon.Undo.ToIconString(), new Vector2(availableWidth, 0))) + { + UIColors.Reset(colorKey); + } + } + } + UiSharedService.AttachToolTip(isCustom ? "Reset this color to default" : "Color is already at default value"); } + + ImGui.EndTable(); } ImGui.Spacing(); @@ -1073,6 +1096,7 @@ public class SettingsUi : WindowMediatorSubscriberBase var nameColors = _configService.Current.NameplateColors; var isFriendOverride = _configService.Current.overrideFriendColor; var isPartyOverride = _configService.Current.overridePartyColor; + var isFcTagOverride = _configService.Current.overrideFcTagColor; if (ImGui.Checkbox("Override name color of visible paired players", ref nameColorsEnabled)) { @@ -1103,6 +1127,12 @@ public class SettingsUi : WindowMediatorSubscriberBase _configService.Save(); _nameplateService.RequestRedraw(); } + if (ImGui.Checkbox("Override FC tag color", ref isFcTagOverride)) + { + _configService.Current.overrideFcTagColor = isFcTagOverride; + _configService.Save(); + _nameplateService.RequestRedraw(); + } } ImGui.Spacing(); @@ -2263,4 +2293,4 @@ public class SettingsUi : WindowMediatorSubscriberBase _wasOpen = IsOpen; IsOpen = false; } -} \ No newline at end of file +}