Merge pull request 'ui-redesign' (#40) from ui-redesign into 1.12.0

Reviewed-on: #40
Reviewed-by: defnotken <defnotken@noreply.git.lightless-sync.org>
This commit was merged in pull request #40.
This commit is contained in:
2025-10-03 23:41:39 +02:00
4 changed files with 69 additions and 34 deletions

View File

@@ -67,6 +67,7 @@ public class LightlessConfig : ILightlessConfiguration
public bool UseFocusTarget { get; set; } = false; public bool UseFocusTarget { get; set; } = false;
public bool overrideFriendColor { get; set; } = false; public bool overrideFriendColor { get; set; } = false;
public bool overridePartyColor { get; set; } = false; public bool overridePartyColor { get; set; } = false;
public bool overrideFcTagColor { get; set; } = false;
public bool useColoredUIDs { get; set; } = true; public bool useColoredUIDs { get; set; } = true;
public bool BroadcastEnabled { get; set; } = false; public bool BroadcastEnabled { get; set; } = false;
public DateTime BroadcastTtl { get; set; } = DateTime.MinValue; public DateTime BroadcastTtl { get; set; } = DateTime.MinValue;

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Authors></Authors> <Authors></Authors>
<Company></Company> <Company></Company>
<Version>1.12.0</Version> <Version>1.12.3</Version>
<Description></Description> <Description></Description>
<Copyright></Copyright> <Copyright></Copyright>
<PackageProjectUrl>https://github.com/Light-Public-Syncshells/LightlessClient</PackageProjectUrl> <PackageProjectUrl>https://github.com/Light-Public-Syncshells/LightlessClient</PackageProjectUrl>

View File

@@ -1,4 +1,4 @@
using Dalamud.Game.ClientState.Objects.Enums; using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.Gui.NamePlate; using Dalamud.Game.Gui.NamePlate;
using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
@@ -68,10 +68,14 @@ public class NameplateService : DisposableMediatorSubscriberBase
(isFriend && !friendColorAllowed) (isFriend && !friendColorAllowed)
)) ))
{ {
//_logger.LogInformation("added nameplate color to {Name}", playerCharacter.Name.TextValue);
handler.NameParts.TextWrap = CreateTextWrap(colors); handler.NameParts.TextWrap = CreateTextWrap(colors);
}
if (_configService.Current.overrideFcTagColor)
{
handler.FreeCompanyTagParts.OuterWrap = CreateTextWrap(colors);
handler.FreeCompanyTagParts.TextWrap = CreateTextWrap(colors);
}
}
} }
} }

View File

@@ -1,4 +1,4 @@
using Dalamud.Bindings.ImGui; using Dalamud.Bindings.ImGui;
using Dalamud.Interface; using Dalamud.Interface;
using Dalamud.Interface.Colors; using Dalamud.Interface.Colors;
using Dalamud.Interface.Utility; using Dalamud.Interface.Utility;
@@ -978,45 +978,68 @@ public class SettingsUi : WindowMediatorSubscriberBase
var colorNames = new[] var colorNames = new[]
{ {
("LightlessPurple", "Lightless Purple", "Primary colors"), ("LightlessPurple", "Primary Purple", "Section titles and dividers"),
("LightlessPurpleActive", "Lightless Purple Active", "Primary colors"), ("LightlessPurpleActive", "Primary Purple (Active)", "Active tabs and hover highlights"),
("LightlessPurpleDefault", "Lightless Purple Inactive", "Primary colors"), ("LightlessPurpleDefault", "Primary Purple (Inactive)", "Inactive tabs and default dividers"),
("LightlessBlue", "Lightless Blue", "Secondary colors"), ("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"), ("LightlessYellow", "Warning Yellow", "Warning colors"),
("LightlessYellow2", "Lightless Yellow 2", "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")
}; };
if (ImGui.BeginTable("##ColorTable", 3, ImGuiTableFlags.Borders | ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit))
foreach (var (colorKey, displayName, description) in colorNames)
{ {
var currentColor = UIColors.Get(colorKey); ImGui.TableSetupColumn("Color", ImGuiTableColumnFlags.WidthFixed);
var colorToEdit = currentColor; ImGui.TableSetupColumn("Description", ImGuiTableColumnFlags.WidthStretch);
ImGui.TableSetupColumn("Reset", ImGuiTableColumnFlags.WidthFixed, 40);
ImGui.TableHeadersRow();
ImGui.AlignTextToFramePadding(); foreach (var (colorKey, displayName, description) in colorNames)
if (ImGui.ColorEdit4($"##color_{colorKey}", ref colorToEdit, ImGuiColorEditFlags.NoInputs | ImGuiColorEditFlags.AlphaPreviewHalf))
{ {
UIColors.Set(colorKey, colorToEdit); ImGui.TableNextRow();
}
// color column
ImGui.SameLine(); ImGui.TableSetColumnIndex(0);
ImGui.TextUnformatted($"{displayName} - {description}"); var currentColor = UIColors.Get(colorKey);
var colorToEdit = currentColor;
if (UIColors.IsCustom(colorKey)) if (ImGui.ColorEdit4($"##color_{colorKey}", ref colorToEdit, ImGuiColorEditFlags.NoInputs | ImGuiColorEditFlags.AlphaPreviewHalf))
{
ImGui.SameLine();
if (_uiShared.IconTextButton(FontAwesomeIcon.Undo, $"Reset {colorKey}"))
{ {
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(); ImGui.Spacing();
@@ -1073,6 +1096,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
var nameColors = _configService.Current.NameplateColors; var nameColors = _configService.Current.NameplateColors;
var isFriendOverride = _configService.Current.overrideFriendColor; var isFriendOverride = _configService.Current.overrideFriendColor;
var isPartyOverride = _configService.Current.overridePartyColor; var isPartyOverride = _configService.Current.overridePartyColor;
var isFcTagOverride = _configService.Current.overrideFcTagColor;
if (ImGui.Checkbox("Override name color of visible paired players", ref nameColorsEnabled)) if (ImGui.Checkbox("Override name color of visible paired players", ref nameColorsEnabled))
{ {
@@ -1103,6 +1127,12 @@ public class SettingsUi : WindowMediatorSubscriberBase
_configService.Save(); _configService.Save();
_nameplateService.RequestRedraw(); _nameplateService.RequestRedraw();
} }
if (ImGui.Checkbox("Override FC tag color", ref isFcTagOverride))
{
_configService.Current.overrideFcTagColor = isFcTagOverride;
_configService.Save();
_nameplateService.RequestRedraw();
}
} }
ImGui.Spacing(); ImGui.Spacing();
@@ -2263,4 +2293,4 @@ public class SettingsUi : WindowMediatorSubscriberBase
_wasOpen = IsOpen; _wasOpen = IsOpen;
IsOpen = false; IsOpen = false;
} }
} }