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 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;

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<Authors></Authors>
<Company></Company>
<Version>1.12.0</Version>
<Version>1.12.3</Version>
<Description></Description>
<Copyright></Copyright>
<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.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);
}
}
}
}

View File

@@ -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;
}
}
}