Merge branch '1.11.6' of https://git.lightless-sync.org/Lightless-Sync/LightlessClient into 1.11.6
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.UI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
@@ -15,6 +15,7 @@ public class LightlessConfig : ILightlessConfiguration
|
||||
public bool PreferNoteInDtrTooltip { get; set; } = false;
|
||||
public bool IsNameplateColorsEnabled { get; set; } = false;
|
||||
public DtrEntry.Colors NameplateColors { get; set; } = new(Foreground: 0xE69138u, Glow: 0xFFBA47u);
|
||||
public Dictionary<string, string> CustomUIColors { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
public bool UseColorsInDtr { get; set; } = true;
|
||||
public DtrEntry.Colors DtrColorsDefault { get; set; } = default;
|
||||
public DtrEntry.Colors DtrColorsNotConnected { get; set; } = new(Glow: 0x0428FFu);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.PlayerData.Services;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Services.ServerConfiguration;
|
||||
using LightlessSync.UI;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -98,6 +99,7 @@ public class LightlessPlugin : MediatorSubscriberBase, IHostedService
|
||||
Mediator.Subscribe<DalamudLoginMessage>(this, (_) => DalamudUtilOnLogIn());
|
||||
Mediator.Subscribe<DalamudLogoutMessage>(this, (_) => DalamudUtilOnLogOut());
|
||||
|
||||
UIColors.Initialize(_lightlessConfigService);
|
||||
Mediator.StartQueueProcessing();
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Globalization;
|
||||
using System.Globalization;
|
||||
using System.Numerics;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
|
||||
namespace LightlessSync.UI
|
||||
{
|
||||
@@ -14,12 +15,17 @@ namespace LightlessSync.UI
|
||||
{ "DimRed", "#d44444" },
|
||||
};
|
||||
|
||||
private static readonly Dictionary<string, Vector4> CustomColors = new(StringComparer.OrdinalIgnoreCase);
|
||||
private static LightlessConfigService? _configService;
|
||||
|
||||
public static void Initialize(LightlessConfigService configService)
|
||||
{
|
||||
_configService = configService;
|
||||
}
|
||||
|
||||
public static Vector4 Get(string name)
|
||||
{
|
||||
if (CustomColors.TryGetValue(name, out var customColor))
|
||||
return customColor;
|
||||
if (_configService?.Current.CustomUIColors.TryGetValue(name, out var customColorHex) == true)
|
||||
return HexToRgba(customColorHex);
|
||||
|
||||
if (!DefaultHexColors.TryGetValue(name, out var hex))
|
||||
throw new ArgumentException($"Color '{name}' not found in UIColors.");
|
||||
@@ -32,17 +38,29 @@ namespace LightlessSync.UI
|
||||
if (!DefaultHexColors.ContainsKey(name))
|
||||
throw new ArgumentException($"Color '{name}' not found in UIColors.");
|
||||
|
||||
CustomColors[name] = color;
|
||||
if (_configService != null)
|
||||
{
|
||||
_configService.Current.CustomUIColors[name] = RgbaToHex(color);
|
||||
_configService.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Reset(string name)
|
||||
{
|
||||
CustomColors.Remove(name);
|
||||
if (_configService != null)
|
||||
{
|
||||
_configService.Current.CustomUIColors.Remove(name);
|
||||
_configService.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ResetAll()
|
||||
{
|
||||
CustomColors.Clear();
|
||||
if (_configService != null)
|
||||
{
|
||||
_configService.Current.CustomUIColors.Clear();
|
||||
_configService.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector4 GetDefault(string name)
|
||||
@@ -55,7 +73,7 @@ namespace LightlessSync.UI
|
||||
|
||||
public static bool IsCustom(string name)
|
||||
{
|
||||
return CustomColors.ContainsKey(name);
|
||||
return _configService?.Current.CustomUIColors.ContainsKey(name) == true;
|
||||
}
|
||||
|
||||
public static IEnumerable<string> GetColorNames()
|
||||
|
||||
Submodule PenumbraAPI updated: dd14131793...953dd227af
Reference in New Issue
Block a user