Add Nameplates + Clean up.
* Yeet Token! * Cleaning up workflow * Testing auto version bump * ExistingNames * Remove a key * Github Token no work * Changing Assembly Version * Version Fix * Fixing version v2 * Cleanup naming * Update LightlessSync.csproj * Add nameplate settings + run code clean up * purple
This commit is contained in:
48
.github/workflows/lightless-tag-and-release.yml
vendored
48
.github/workflows/lightless-tag-and-release.yml
vendored
@@ -81,4 +81,50 @@ jobs:
|
|||||||
name: ${{ steps.package_version.outputs.version }}
|
name: ${{ steps.package_version.outputs.version }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
files: output/LightlessClient.zip
|
files: output/LightlessClient.zip
|
||||||
|
|
||||||
|
- name: Clone plugin hosting repo
|
||||||
|
run: |
|
||||||
|
mkdir LightlessSyncRepo
|
||||||
|
cd LightlessSyncRepo
|
||||||
|
git clone https://github.com/${{ github.repository_owner }}/LightlessSync.git
|
||||||
|
env:
|
||||||
|
GIT_TERMINAL_PROMPT: 0
|
||||||
|
|
||||||
|
- name: Update plogonmaster.json with version
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
VERSION: ${{ steps.package_version.outputs.version }}
|
||||||
|
run: |
|
||||||
|
$pluginJsonPath = "${{ env.PLUGIN_NAME }}/bin/x64/Release/${{ env.PLUGIN_NAME }}.json"
|
||||||
|
$pluginJson = Get-Content $pluginJsonPath | ConvertFrom-Json
|
||||||
|
$repoJsonPath = "LightlessSyncRepo/LightlessSync/plogonmaster.json"
|
||||||
|
$repoJsonRaw = Get-Content $repoJsonPath -Raw
|
||||||
|
$repoJson = $repoJsonRaw | ConvertFrom-Json
|
||||||
|
$version = $env:VERSION
|
||||||
|
$downloadUrl = "https://github.com/${{ github.repository_owner }}/LightlessClient/releases/download/$version/LightlessClient.zip"
|
||||||
|
|
||||||
|
if (-not ($repoJson -is [System.Collections.IEnumerable])) {
|
||||||
|
$repoJson = @($repoJson)
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($plugin in $repoJson) {
|
||||||
|
if ($plugin.InternalName -eq $pluginJson.InternalName) {
|
||||||
|
$plugin.DalamudApiLevel = $pluginJson.DalamudApiLevel
|
||||||
|
$plugin.AssemblyVersion = $version
|
||||||
|
$plugin.DownloadLinkInstall = $downloadUrl
|
||||||
|
$plugin.DownloadLinkTesting = $downloadUrl
|
||||||
|
$plugin.DownloadLinkUpdate = $downloadUrl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$repoJson | ConvertTo-Json -Depth 100 | Set-Content $repoJsonPath
|
||||||
|
|
||||||
|
- name: Commit and push to LightlessSync
|
||||||
|
run: |
|
||||||
|
cd LightlessSyncRepo/LightlessSync
|
||||||
|
git config user.name "github-actions"
|
||||||
|
git config user.email "github-actions@github.com"
|
||||||
|
git add .
|
||||||
|
git commit -m "Update ${{ env.PLUGIN_NAME }} to ${{ steps.package_version.outputs.version }}"
|
||||||
|
git push https://x-access-token:${{ secrets.LIGHTLESS_TOKEN }}@github.com/${{ github.repository_owner }}/LightlessSync.git HEAD:main
|
||||||
@@ -84,7 +84,7 @@ public sealed class IpcCallerPetNames : IIpcCaller
|
|||||||
{
|
{
|
||||||
string localNameData = _getPlayerData.InvokeFunc();
|
string localNameData = _getPlayerData.InvokeFunc();
|
||||||
return string.IsNullOrEmpty(localNameData) ? string.Empty : localNameData;
|
return string.IsNullOrEmpty(localNameData) ? string.Empty : localNameData;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_logger.LogWarning(e, "Could not obtain Pet Nicknames data");
|
_logger.LogWarning(e, "Could not obtain Pet Nicknames data");
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using LightlessSync.LightlessConfiguration.Configurations;
|
using LightlessSync.LightlessConfiguration.Configurations;
|
||||||
using LightlessSync.LightlessConfiguration;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -13,6 +13,8 @@ public class LightlessConfig : ILightlessConfiguration
|
|||||||
public bool EnableDtrEntry { get; set; } = false;
|
public bool EnableDtrEntry { get; set; } = false;
|
||||||
public bool ShowUidInDtrTooltip { get; set; } = true;
|
public bool ShowUidInDtrTooltip { get; set; } = true;
|
||||||
public bool PreferNoteInDtrTooltip { get; set; } = false;
|
public bool PreferNoteInDtrTooltip { get; set; } = false;
|
||||||
|
public bool IsNameplateColorsEnabled { get; set; } = false;
|
||||||
|
public DtrEntry.Colors NameplateColors { get; set; } = new(Foreground: 0xE69138u, Glow: 0xFFBA47u);
|
||||||
public bool UseColorsInDtr { get; set; } = true;
|
public bool UseColorsInDtr { get; set; } = true;
|
||||||
public DtrEntry.Colors DtrColorsDefault { get; set; } = default;
|
public DtrEntry.Colors DtrColorsDefault { get; set; } = default;
|
||||||
public DtrEntry.Colors DtrColorsNotConnected { get; set; } = new(Glow: 0x0428FFu);
|
public DtrEntry.Colors DtrColorsNotConnected { get; set; } = new(Glow: 0x0428FFu);
|
||||||
@@ -60,4 +62,6 @@ public class LightlessConfig : ILightlessConfiguration
|
|||||||
public int Version { get; set; } = 1;
|
public int Version { get; set; } = 1;
|
||||||
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
|
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
|
||||||
public bool UseFocusTarget { get; set; } = false;
|
public bool UseFocusTarget { get; set; } = false;
|
||||||
|
public bool overrideFriendColor { get; set; } = false;
|
||||||
|
public bool overridePartyColor { get; set; } = false;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using LightlessSync.API.Data.Enum;
|
using LightlessSync.API.Data.Enum;
|
||||||
using LightlessSync.LightlessConfiguration.Configurations;
|
|
||||||
|
|
||||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||||
|
|
||||||
@@ -151,6 +151,7 @@ public class LightlessPlugin : MediatorSubscriberBase, IHostedService
|
|||||||
_runtimeServiceScope.ServiceProvider.GetRequiredService<TransientResourceManager>();
|
_runtimeServiceScope.ServiceProvider.GetRequiredService<TransientResourceManager>();
|
||||||
_runtimeServiceScope.ServiceProvider.GetRequiredService<VisibleUserDataDistributor>();
|
_runtimeServiceScope.ServiceProvider.GetRequiredService<VisibleUserDataDistributor>();
|
||||||
_runtimeServiceScope.ServiceProvider.GetRequiredService<NotificationService>();
|
_runtimeServiceScope.ServiceProvider.GetRequiredService<NotificationService>();
|
||||||
|
_runtimeServiceScope.ServiceProvider.GetRequiredService<NameplateService>();
|
||||||
|
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
if (_lightlessConfigService.Current.LogLevel != LogLevel.Information)
|
if (_lightlessConfigService.Current.LogLevel != LogLevel.Information)
|
||||||
@@ -8,7 +8,6 @@ using LightlessSync.PlayerData.Handlers;
|
|||||||
using LightlessSync.Services;
|
using LightlessSync.Services;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using CharacterData = LightlessSync.PlayerData.Data.CharacterData;
|
|
||||||
|
|
||||||
namespace LightlessSync.PlayerData.Factories;
|
namespace LightlessSync.PlayerData.Factories;
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase
|
|||||||
Mediator.Publish(new EventMessage(new Event(PlayerName, Pair.UserData, nameof(PairHandler),
|
Mediator.Publish(new EventMessage(new Event(PlayerName, Pair.UserData, nameof(PairHandler),
|
||||||
EventSeverity.Informational, text)));
|
EventSeverity.Informational, text)));
|
||||||
Mediator.Publish(new RefreshUiMessage());
|
Mediator.Publish(new RefreshUiMessage());
|
||||||
|
Mediator.Publish(new VisibilityChange());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public class Pair
|
|||||||
public long LastAppliedDataTris { get; set; } = -1;
|
public long LastAppliedDataTris { get; set; } = -1;
|
||||||
public long LastAppliedApproximateVRAMBytes { get; set; } = -1;
|
public long LastAppliedApproximateVRAMBytes { get; set; } = -1;
|
||||||
public string Ident => _onlineUserIdentDto?.Ident ?? string.Empty;
|
public string Ident => _onlineUserIdentDto?.Ident ?? string.Empty;
|
||||||
|
public uint PlayerCharacterId => CachedPlayer?.PlayerCharacterId ?? uint.MaxValue;
|
||||||
|
|
||||||
public UserData UserData => UserPair.User;
|
public UserData UserData => UserPair.User;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game;
|
||||||
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Interface.ImGuiFileDialog;
|
using Dalamud.Interface.ImGuiFileDialog;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
@@ -12,6 +13,7 @@ using LightlessSync.PlayerData.Factories;
|
|||||||
using LightlessSync.PlayerData.Pairs;
|
using LightlessSync.PlayerData.Pairs;
|
||||||
using LightlessSync.PlayerData.Services;
|
using LightlessSync.PlayerData.Services;
|
||||||
using LightlessSync.Services;
|
using LightlessSync.Services;
|
||||||
|
using LightlessSync.Services.CharaData;
|
||||||
using LightlessSync.Services.Events;
|
using LightlessSync.Services.Events;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using LightlessSync.Services.ServerConfiguration;
|
using LightlessSync.Services.ServerConfiguration;
|
||||||
@@ -28,8 +30,6 @@ using Microsoft.Extensions.Logging;
|
|||||||
using NReco.Logging.File;
|
using NReco.Logging.File;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using LightlessSync.Services.CharaData;
|
|
||||||
using Dalamud.Game;
|
|
||||||
|
|
||||||
namespace LightlessSync;
|
namespace LightlessSync;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
IFramework framework, IObjectTable objectTable, IClientState clientState, ICondition condition, IChatGui chatGui,
|
IFramework framework, IObjectTable objectTable, IClientState clientState, ICondition condition, IChatGui chatGui,
|
||||||
IGameGui gameGui, IDtrBar dtrBar, IPluginLog pluginLog, ITargetManager targetManager, INotificationManager notificationManager,
|
IGameGui gameGui, IDtrBar dtrBar, IPluginLog pluginLog, ITargetManager targetManager, INotificationManager notificationManager,
|
||||||
ITextureProvider textureProvider, IContextMenu contextMenu, IGameInteropProvider gameInteropProvider, IGameConfig gameConfig,
|
ITextureProvider textureProvider, IContextMenu contextMenu, IGameInteropProvider gameInteropProvider, IGameConfig gameConfig,
|
||||||
ISigScanner sigScanner)
|
ISigScanner sigScanner, INamePlateGui namePlateGui)
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(pluginInterface.ConfigDirectory.FullName))
|
if (!Directory.Exists(pluginInterface.ConfigDirectory.FullName))
|
||||||
Directory.CreateDirectory(pluginInterface.ConfigDirectory.FullName);
|
Directory.CreateDirectory(pluginInterface.ConfigDirectory.FullName);
|
||||||
@@ -228,6 +228,8 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
s.GetRequiredService<CacheMonitor>(), s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<LightlessConfigService>(), s.GetRequiredService<DalamudUtilService>(),
|
s.GetRequiredService<CacheMonitor>(), s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<LightlessConfigService>(), s.GetRequiredService<DalamudUtilService>(),
|
||||||
pluginInterface, textureProvider, s.GetRequiredService<Dalamud.Localization>(), s.GetRequiredService<ServerConfigurationManager>(), s.GetRequiredService<TokenProvider>(),
|
pluginInterface, textureProvider, s.GetRequiredService<Dalamud.Localization>(), s.GetRequiredService<ServerConfigurationManager>(), s.GetRequiredService<TokenProvider>(),
|
||||||
s.GetRequiredService<LightlessMediator>()));
|
s.GetRequiredService<LightlessMediator>()));
|
||||||
|
collection.AddScoped((s) => new NameplateService(s.GetRequiredService<ILogger<NameplateService>>(), s.GetRequiredService<LightlessConfigService>(), namePlateGui, clientState,
|
||||||
|
s.GetRequiredService<PairManager>(), s.GetRequiredService<LightlessMediator>()));
|
||||||
|
|
||||||
collection.AddHostedService(p => p.GetRequiredService<ConfigurationSaveService>());
|
collection.AddHostedService(p => p.GetRequiredService<ConfigurationSaveService>());
|
||||||
collection.AddHostedService(p => p.GetRequiredService<LightlessMediator>());
|
collection.AddHostedService(p => p.GetRequiredService<LightlessMediator>());
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace LightlessSync.Services.CharaData
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace LightlessSync.Services.CharaData
|
|
||||||
{
|
{
|
||||||
internal class CharaDataTogetherManager
|
internal class CharaDataTogetherManager
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using Lumina.Excel.Sheets;
|
|
||||||
using LightlessSync.API.Dto.CharaData;
|
using LightlessSync.API.Dto.CharaData;
|
||||||
|
using Lumina.Excel.Sheets;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Lumina.Data.Files;
|
using LightlessSync.API.Data;
|
||||||
using LightlessSync.API.Data;
|
|
||||||
using LightlessSync.API.Data.Enum;
|
using LightlessSync.API.Data.Enum;
|
||||||
using LightlessSync.FileCache;
|
using LightlessSync.FileCache;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using LightlessSync.UI;
|
using LightlessSync.UI;
|
||||||
using LightlessSync.Utils;
|
using LightlessSync.Utils;
|
||||||
|
using Lumina.Data.Files;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace LightlessSync.Services;
|
namespace LightlessSync.Services;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Dalamud.Game;
|
using Dalamud.Game.ClientState.Conditions;
|
||||||
using Dalamud.Game.ClientState.Conditions;
|
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
using Dalamud.Game.ClientState.Objects.SubKinds;
|
||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
@@ -10,13 +9,13 @@ using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
|||||||
using FFXIVClientStructs.FFXIV.Client.Game.Control;
|
using FFXIVClientStructs.FFXIV.Client.Game.Control;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
||||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||||
using Lumina.Excel.Sheets;
|
|
||||||
using LightlessSync.API.Dto.CharaData;
|
using LightlessSync.API.Dto.CharaData;
|
||||||
using LightlessSync.Interop;
|
using LightlessSync.Interop;
|
||||||
using LightlessSync.LightlessConfiguration;
|
using LightlessSync.LightlessConfiguration;
|
||||||
using LightlessSync.PlayerData.Handlers;
|
using LightlessSync.PlayerData.Handlers;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using LightlessSync.Utils;
|
using LightlessSync.Utils;
|
||||||
|
using Lumina.Excel.Sheets;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
@@ -135,7 +134,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
_cid = RebuildCID();
|
_cid = RebuildCID();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Lazy<ulong> RebuildCID() => new(GetCID);
|
private Lazy<ulong> RebuildCID() => new(GetCID);
|
||||||
|
|
||||||
public bool IsWine { get; init; }
|
public bool IsWine { get; init; }
|
||||||
|
|
||||||
|
|||||||
@@ -93,5 +93,7 @@ public record GPoseLobbyReceiveCharaData(CharaDataDownloadDto CharaDataDownloadD
|
|||||||
public record GPoseLobbyReceivePoseData(UserData UserData, PoseData PoseData) : MessageBase;
|
public record GPoseLobbyReceivePoseData(UserData UserData, PoseData PoseData) : MessageBase;
|
||||||
public record GPoseLobbyReceiveWorldData(UserData UserData, WorldData WorldData) : MessageBase;
|
public record GPoseLobbyReceiveWorldData(UserData UserData, WorldData WorldData) : MessageBase;
|
||||||
public record OpenCharaDataHubWithFilterMessage(UserData UserData) : MessageBase;
|
public record OpenCharaDataHubWithFilterMessage(UserData UserData) : MessageBase;
|
||||||
|
|
||||||
|
public record VisibilityChange : MessageBase;
|
||||||
#pragma warning restore S2094
|
#pragma warning restore S2094
|
||||||
#pragma warning restore MA0048 // File name must match type name
|
#pragma warning restore MA0048 // File name must match type name
|
||||||
91
LightlessSync/Services/NameplateService.cs
Normal file
91
LightlessSync/Services/NameplateService.cs
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
using Dalamud.Game.ClientState.Objects.Enums;
|
||||||
|
using Dalamud.Game.Gui.NamePlate;
|
||||||
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
|
using Dalamud.Plugin.Services;
|
||||||
|
using Dalamud.Utility;
|
||||||
|
using LightlessSync.LightlessConfiguration;
|
||||||
|
using LightlessSync.PlayerData.Pairs;
|
||||||
|
using LightlessSync.Services.Mediator;
|
||||||
|
using LightlessSync.UI;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
namespace LightlessSync.Services;
|
||||||
|
|
||||||
|
public class NameplateService : DisposableMediatorSubscriberBase
|
||||||
|
{
|
||||||
|
private readonly LightlessConfigService _configService;
|
||||||
|
private readonly IClientState _clientState;
|
||||||
|
private readonly INamePlateGui _namePlateGui;
|
||||||
|
private readonly PairManager _pairManager;
|
||||||
|
|
||||||
|
public NameplateService(ILogger<NameplateService> logger,
|
||||||
|
LightlessConfigService configService,
|
||||||
|
INamePlateGui namePlateGui,
|
||||||
|
IClientState clientState,
|
||||||
|
PairManager pairManager,
|
||||||
|
LightlessMediator lightlessMediator) : base(logger, lightlessMediator)
|
||||||
|
{
|
||||||
|
_configService = configService;
|
||||||
|
_namePlateGui = namePlateGui;
|
||||||
|
_clientState = clientState;
|
||||||
|
_pairManager = pairManager;
|
||||||
|
_namePlateGui.OnNamePlateUpdate += OnNamePlateUpdate;
|
||||||
|
_namePlateGui.RequestRedraw();
|
||||||
|
Mediator.Subscribe<VisibilityChange>(this, (_) => _namePlateGui.RequestRedraw());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnNamePlateUpdate(INamePlateUpdateContext context, IReadOnlyList<INamePlateUpdateHandler> handlers)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!_configService.Current.IsNameplateColorsEnabled && !_clientState.IsPvPExcludingDen) return;
|
||||||
|
var visibleUsersIds = _pairManager.GetOnlineUserPairs().Where(u => u.IsVisible && u.PlayerCharacterId != uint.MaxValue).Select(u => (ulong)u.PlayerCharacterId).ToHashSet();
|
||||||
|
var colors = _configService.Current.NameplateColors;
|
||||||
|
|
||||||
|
foreach (var handler in handlers)
|
||||||
|
{
|
||||||
|
var playerCharacter = handler.PlayerCharacter;
|
||||||
|
if (playerCharacter == null) { continue; }
|
||||||
|
var isInParty = playerCharacter.StatusFlags.HasFlag(StatusFlags.PartyMember);
|
||||||
|
var isFriend = playerCharacter.StatusFlags.HasFlag(StatusFlags.Friend);
|
||||||
|
bool partyColorAllowed = (_configService.Current.overridePartyColor && isInParty);
|
||||||
|
bool friendColorAllowed = (_configService.Current.overrideFriendColor && isFriend);
|
||||||
|
|
||||||
|
if (visibleUsersIds.Contains(handler.GameObjectId) &&
|
||||||
|
!(
|
||||||
|
(isInParty && !partyColorAllowed) ||
|
||||||
|
(isFriend && !friendColorAllowed)
|
||||||
|
))
|
||||||
|
{
|
||||||
|
handler.NameParts.TextWrap = CreateTextWrap(colors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RequestRedraw()
|
||||||
|
{
|
||||||
|
_namePlateGui.RequestRedraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static (SeString, SeString) CreateTextWrap(DtrEntry.Colors color)
|
||||||
|
{
|
||||||
|
var left = new Lumina.Text.SeStringBuilder();
|
||||||
|
var right = new Lumina.Text.SeStringBuilder();
|
||||||
|
|
||||||
|
left.PushColorRgba(color.Foreground);
|
||||||
|
right.PopColor();
|
||||||
|
|
||||||
|
left.PushEdgeColorRgba(color.Glow);
|
||||||
|
right.PopEdgeColor();
|
||||||
|
|
||||||
|
return (left.ToReadOnlySeString().ToDalamudString(), right.ToReadOnlySeString().ToDalamudString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
base.Dispose(disposing);
|
||||||
|
_namePlateGui.OnNamePlateUpdate -= OnNamePlateUpdate;
|
||||||
|
_namePlateGui.RequestRedraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -8,187 +8,187 @@ namespace LightlessSync.UI;
|
|||||||
|
|
||||||
internal sealed partial class CharaDataHubUi
|
internal sealed partial class CharaDataHubUi
|
||||||
{
|
{
|
||||||
private static string GetAccessTypeString(AccessTypeDto dto) => dto switch
|
private static string GetAccessTypeString(AccessTypeDto dto) => dto switch
|
||||||
{
|
{
|
||||||
AccessTypeDto.AllPairs => "All Pairs",
|
AccessTypeDto.AllPairs => "All Pairs",
|
||||||
AccessTypeDto.ClosePairs => "Direct Pairs",
|
AccessTypeDto.ClosePairs => "Direct Pairs",
|
||||||
AccessTypeDto.Individuals => "Specified",
|
AccessTypeDto.Individuals => "Specified",
|
||||||
AccessTypeDto.Public => "Everyone"
|
AccessTypeDto.Public => "Everyone"
|
||||||
};
|
};
|
||||||
|
|
||||||
private static string GetShareTypeString(ShareTypeDto dto) => dto switch
|
private static string GetShareTypeString(ShareTypeDto dto) => dto switch
|
||||||
{
|
{
|
||||||
ShareTypeDto.Private => "Code Only",
|
ShareTypeDto.Private => "Code Only",
|
||||||
ShareTypeDto.Shared => "Shared"
|
ShareTypeDto.Shared => "Shared"
|
||||||
};
|
};
|
||||||
|
|
||||||
private static string GetWorldDataTooltipText(PoseEntryExtended poseEntry)
|
private static string GetWorldDataTooltipText(PoseEntryExtended poseEntry)
|
||||||
{
|
{
|
||||||
if (!poseEntry.HasWorldData) return "This Pose has no world data attached.";
|
if (!poseEntry.HasWorldData) return "This Pose has no world data attached.";
|
||||||
return poseEntry.WorldDataDescriptor;
|
return poseEntry.WorldDataDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GposeMetaInfoAction(Action<CharaDataMetaInfoExtendedDto?> gposeActionDraw, string actionDescription, CharaDataMetaInfoExtendedDto? dto, bool hasValidGposeTarget, bool isSpawning)
|
private void GposeMetaInfoAction(Action<CharaDataMetaInfoExtendedDto?> gposeActionDraw, string actionDescription, CharaDataMetaInfoExtendedDto? dto, bool hasValidGposeTarget, bool isSpawning)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
sb.AppendLine(actionDescription);
|
sb.AppendLine(actionDescription);
|
||||||
bool isDisabled = false;
|
bool isDisabled = false;
|
||||||
|
|
||||||
void AddErrorStart(StringBuilder sb)
|
void AddErrorStart(StringBuilder sb)
|
||||||
{
|
{
|
||||||
sb.Append(UiSharedService.TooltipSeparator);
|
sb.Append(UiSharedService.TooltipSeparator);
|
||||||
sb.AppendLine("Cannot execute:");
|
sb.AppendLine("Cannot execute:");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dto == null)
|
if (dto == null)
|
||||||
{
|
{
|
||||||
if (!isDisabled) AddErrorStart(sb);
|
if (!isDisabled) AddErrorStart(sb);
|
||||||
sb.AppendLine("- No metainfo present");
|
sb.AppendLine("- No metainfo present");
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
if (!dto?.CanBeDownloaded ?? false)
|
if (!dto?.CanBeDownloaded ?? false)
|
||||||
{
|
{
|
||||||
if (!isDisabled) AddErrorStart(sb);
|
if (!isDisabled) AddErrorStart(sb);
|
||||||
sb.AppendLine("- Character is not downloadable");
|
sb.AppendLine("- Character is not downloadable");
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
if (!_uiSharedService.IsInGpose)
|
if (!_uiSharedService.IsInGpose)
|
||||||
{
|
{
|
||||||
if (!isDisabled) AddErrorStart(sb);
|
if (!isDisabled) AddErrorStart(sb);
|
||||||
sb.AppendLine("- Requires to be in GPose");
|
sb.AppendLine("- Requires to be in GPose");
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
if (!hasValidGposeTarget && !isSpawning)
|
if (!hasValidGposeTarget && !isSpawning)
|
||||||
{
|
{
|
||||||
if (!isDisabled) AddErrorStart(sb);
|
if (!isDisabled) AddErrorStart(sb);
|
||||||
sb.AppendLine("- Requires a valid GPose target");
|
sb.AppendLine("- Requires a valid GPose target");
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
if (isSpawning && !_charaDataManager.BrioAvailable)
|
if (isSpawning && !_charaDataManager.BrioAvailable)
|
||||||
{
|
{
|
||||||
if (!isDisabled) AddErrorStart(sb);
|
if (!isDisabled) AddErrorStart(sb);
|
||||||
sb.AppendLine("- Requires Brio to be installed.");
|
sb.AppendLine("- Requires Brio to be installed.");
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
using (ImRaii.Group())
|
using (ImRaii.Group())
|
||||||
{
|
{
|
||||||
using var dis = ImRaii.Disabled(isDisabled);
|
using var dis = ImRaii.Disabled(isDisabled);
|
||||||
gposeActionDraw.Invoke(dto);
|
gposeActionDraw.Invoke(dto);
|
||||||
}
|
}
|
||||||
if (sb.Length > 0)
|
if (sb.Length > 0)
|
||||||
{
|
{
|
||||||
UiSharedService.AttachToolTip(sb.ToString());
|
UiSharedService.AttachToolTip(sb.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GposePoseAction(Action poseActionDraw, string poseDescription, bool hasValidGposeTarget)
|
private void GposePoseAction(Action poseActionDraw, string poseDescription, bool hasValidGposeTarget)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
sb.AppendLine(poseDescription);
|
sb.AppendLine(poseDescription);
|
||||||
bool isDisabled = false;
|
bool isDisabled = false;
|
||||||
|
|
||||||
void AddErrorStart(StringBuilder sb)
|
void AddErrorStart(StringBuilder sb)
|
||||||
{
|
{
|
||||||
sb.Append(UiSharedService.TooltipSeparator);
|
sb.Append(UiSharedService.TooltipSeparator);
|
||||||
sb.AppendLine("Cannot execute:");
|
sb.AppendLine("Cannot execute:");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_uiSharedService.IsInGpose)
|
if (!_uiSharedService.IsInGpose)
|
||||||
{
|
{
|
||||||
if (!isDisabled) AddErrorStart(sb);
|
if (!isDisabled) AddErrorStart(sb);
|
||||||
sb.AppendLine("- Requires to be in GPose");
|
sb.AppendLine("- Requires to be in GPose");
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
if (!hasValidGposeTarget)
|
if (!hasValidGposeTarget)
|
||||||
{
|
{
|
||||||
if (!isDisabled) AddErrorStart(sb);
|
if (!isDisabled) AddErrorStart(sb);
|
||||||
sb.AppendLine("- Requires a valid GPose target");
|
sb.AppendLine("- Requires a valid GPose target");
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
if (!_charaDataManager.BrioAvailable)
|
if (!_charaDataManager.BrioAvailable)
|
||||||
{
|
{
|
||||||
if (!isDisabled) AddErrorStart(sb);
|
if (!isDisabled) AddErrorStart(sb);
|
||||||
sb.AppendLine("- Requires Brio to be installed.");
|
sb.AppendLine("- Requires Brio to be installed.");
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
using (ImRaii.Group())
|
using (ImRaii.Group())
|
||||||
{
|
{
|
||||||
using var dis = ImRaii.Disabled(isDisabled);
|
using var dis = ImRaii.Disabled(isDisabled);
|
||||||
poseActionDraw.Invoke();
|
poseActionDraw.Invoke();
|
||||||
}
|
}
|
||||||
if (sb.Length > 0)
|
if (sb.Length > 0)
|
||||||
{
|
{
|
||||||
UiSharedService.AttachToolTip(sb.ToString());
|
UiSharedService.AttachToolTip(sb.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetWindowSizeConstraints(bool? inGposeTab = null)
|
private void SetWindowSizeConstraints(bool? inGposeTab = null)
|
||||||
{
|
{
|
||||||
SizeConstraints = new()
|
SizeConstraints = new()
|
||||||
{
|
{
|
||||||
MinimumSize = new((inGposeTab ?? false) ? 400 : 1000, 500),
|
MinimumSize = new((inGposeTab ?? false) ? 400 : 1000, 500),
|
||||||
MaximumSize = new((inGposeTab ?? false) ? 400 : 1000, 2000)
|
MaximumSize = new((inGposeTab ?? false) ? 400 : 1000, 2000)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateFilteredFavorites()
|
private void UpdateFilteredFavorites()
|
||||||
{
|
{
|
||||||
_ = Task.Run(async () =>
|
_ = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
if (_charaDataManager.DownloadMetaInfoTask != null)
|
if (_charaDataManager.DownloadMetaInfoTask != null)
|
||||||
{
|
{
|
||||||
await _charaDataManager.DownloadMetaInfoTask.ConfigureAwait(false);
|
await _charaDataManager.DownloadMetaInfoTask.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
Dictionary<string, (CharaDataFavorite, CharaDataMetaInfoExtendedDto?, bool)> newFiltered = [];
|
Dictionary<string, (CharaDataFavorite, CharaDataMetaInfoExtendedDto?, bool)> newFiltered = [];
|
||||||
foreach (var favorite in _configService.Current.FavoriteCodes)
|
foreach (var favorite in _configService.Current.FavoriteCodes)
|
||||||
{
|
{
|
||||||
var uid = favorite.Key.Split(":")[0];
|
var uid = favorite.Key.Split(":")[0];
|
||||||
var note = _serverConfigurationManager.GetNoteForUid(uid) ?? string.Empty;
|
var note = _serverConfigurationManager.GetNoteForUid(uid) ?? string.Empty;
|
||||||
bool hasMetaInfo = _charaDataManager.TryGetMetaInfo(favorite.Key, out var metaInfo);
|
bool hasMetaInfo = _charaDataManager.TryGetMetaInfo(favorite.Key, out var metaInfo);
|
||||||
bool addFavorite =
|
bool addFavorite =
|
||||||
(string.IsNullOrEmpty(_filterCodeNote)
|
(string.IsNullOrEmpty(_filterCodeNote)
|
||||||
|| (note.Contains(_filterCodeNote, StringComparison.OrdinalIgnoreCase)
|
|| (note.Contains(_filterCodeNote, StringComparison.OrdinalIgnoreCase)
|
||||||
|| uid.Contains(_filterCodeNote, StringComparison.OrdinalIgnoreCase)))
|
|| uid.Contains(_filterCodeNote, StringComparison.OrdinalIgnoreCase)))
|
||||||
&& (string.IsNullOrEmpty(_filterDescription)
|
&& (string.IsNullOrEmpty(_filterDescription)
|
||||||
|| (favorite.Value.CustomDescription.Contains(_filterDescription, StringComparison.OrdinalIgnoreCase)
|
|| (favorite.Value.CustomDescription.Contains(_filterDescription, StringComparison.OrdinalIgnoreCase)
|
||||||
|| (metaInfo != null && metaInfo!.Description.Contains(_filterDescription, StringComparison.OrdinalIgnoreCase))))
|
|| (metaInfo != null && metaInfo!.Description.Contains(_filterDescription, StringComparison.OrdinalIgnoreCase))))
|
||||||
&& (!_filterPoseOnly
|
&& (!_filterPoseOnly
|
||||||
|| (metaInfo != null && metaInfo!.HasPoses))
|
|| (metaInfo != null && metaInfo!.HasPoses))
|
||||||
&& (!_filterWorldOnly
|
&& (!_filterWorldOnly
|
||||||
|| (metaInfo != null && metaInfo!.HasWorldData));
|
|| (metaInfo != null && metaInfo!.HasWorldData));
|
||||||
if (addFavorite)
|
if (addFavorite)
|
||||||
{
|
{
|
||||||
newFiltered[favorite.Key] = (favorite.Value, metaInfo, hasMetaInfo);
|
newFiltered[favorite.Key] = (favorite.Value, metaInfo, hasMetaInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_filteredFavorites = newFiltered;
|
_filteredFavorites = newFiltered;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateFilteredItems()
|
private void UpdateFilteredItems()
|
||||||
{
|
{
|
||||||
if (_charaDataManager.GetSharedWithYouTask == null)
|
if (_charaDataManager.GetSharedWithYouTask == null)
|
||||||
{
|
{
|
||||||
_filteredDict = _charaDataManager.SharedWithYouData
|
_filteredDict = _charaDataManager.SharedWithYouData
|
||||||
.SelectMany(k => k.Value)
|
.SelectMany(k => k.Value)
|
||||||
.Where(k =>
|
.Where(k =>
|
||||||
(!_sharedWithYouDownloadableFilter || k.CanBeDownloaded)
|
(!_sharedWithYouDownloadableFilter || k.CanBeDownloaded)
|
||||||
&& (string.IsNullOrEmpty(_sharedWithYouDescriptionFilter) || k.Description.Contains(_sharedWithYouDescriptionFilter, StringComparison.OrdinalIgnoreCase)))
|
&& (string.IsNullOrEmpty(_sharedWithYouDescriptionFilter) || k.Description.Contains(_sharedWithYouDescriptionFilter, StringComparison.OrdinalIgnoreCase)))
|
||||||
.GroupBy(k => k.Uploader)
|
.GroupBy(k => k.Uploader)
|
||||||
.ToDictionary(k =>
|
.ToDictionary(k =>
|
||||||
{
|
{
|
||||||
var note = _serverConfigurationManager.GetNoteForUid(k.Key.UID);
|
var note = _serverConfigurationManager.GetNoteForUid(k.Key.UID);
|
||||||
if (note == null) return k.Key.AliasOrUID;
|
if (note == null) return k.Key.AliasOrUID;
|
||||||
return $"{note} ({k.Key.AliasOrUID})";
|
return $"{note} ({k.Key.AliasOrUID})";
|
||||||
}, k => k.ToList(), StringComparer.OrdinalIgnoreCase)
|
}, k => k.ToList(), StringComparer.OrdinalIgnoreCase)
|
||||||
.Where(k => (string.IsNullOrEmpty(_sharedWithYouOwnerFilter) || k.Key.Contains(_sharedWithYouOwnerFilter, StringComparison.OrdinalIgnoreCase)))
|
.Where(k => (string.IsNullOrEmpty(_sharedWithYouOwnerFilter) || k.Key.Contains(_sharedWithYouOwnerFilter, StringComparison.OrdinalIgnoreCase)))
|
||||||
.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase).ToDictionary();
|
.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase).ToDictionary();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.Colors;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
|
using Dalamud.Interface.Utility;
|
||||||
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using LightlessSync.API.Dto.CharaData;
|
using LightlessSync.API.Dto.CharaData;
|
||||||
using LightlessSync.Services.CharaData.Models;
|
using LightlessSync.Services.CharaData.Models;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.Colors;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
|
using Dalamud.Interface.Utility;
|
||||||
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace LightlessSync.UI;
|
namespace LightlessSync.UI;
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
|||||||
var dlProgressPercent = transferredBytes / (double)totalBytes;
|
var dlProgressPercent = transferredBytes / (double)totalBytes;
|
||||||
drawList.AddRectFilled(dlBarStart,
|
drawList.AddRectFilled(dlBarStart,
|
||||||
dlBarEnd with { X = dlBarStart.X + (float)(dlProgressPercent * dlBarWidth) },
|
dlBarEnd with { X = dlBarStart.X + (float)(dlProgressPercent * dlBarWidth) },
|
||||||
UiSharedService.Color(50, 205, 50, transparency), 1);
|
UiSharedService.Color(173, 138, 245, transparency), 1);
|
||||||
|
|
||||||
if (_configService.Current.TransferBarsShowText)
|
if (_configService.Current.TransferBarsShowText)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ using Dalamud.Interface.Utility;
|
|||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using LightlessSync.FileCache;
|
using LightlessSync.FileCache;
|
||||||
using LightlessSync.Localization;
|
|
||||||
using LightlessSync.LightlessConfiguration;
|
using LightlessSync.LightlessConfiguration;
|
||||||
using LightlessSync.LightlessConfiguration.Models;
|
using LightlessSync.LightlessConfiguration.Models;
|
||||||
|
using LightlessSync.Localization;
|
||||||
using LightlessSync.Services;
|
using LightlessSync.Services;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using LightlessSync.Services.ServerConfiguration;
|
using LightlessSync.Services.ServerConfiguration;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ internal class JoinSyncshellUI : WindowMediatorSubscriberBase
|
|||||||
private string _syncshellPassword = string.Empty;
|
private string _syncshellPassword = string.Empty;
|
||||||
|
|
||||||
public JoinSyncshellUI(ILogger<JoinSyncshellUI> logger, LightlessMediator mediator,
|
public JoinSyncshellUI(ILogger<JoinSyncshellUI> logger, LightlessMediator mediator,
|
||||||
UiSharedService uiSharedService, ApiController apiController, PerformanceCollectorService performanceCollectorService)
|
UiSharedService uiSharedService, ApiController apiController, PerformanceCollectorService performanceCollectorService)
|
||||||
: base(logger, mediator, "Join existing Syncshell###LightlessSyncJoinSyncshell", performanceCollectorService)
|
: base(logger, mediator, "Join existing Syncshell###LightlessSyncJoinSyncshell", performanceCollectorService)
|
||||||
{
|
{
|
||||||
_uiSharedService = uiSharedService;
|
_uiSharedService = uiSharedService;
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||||
private readonly UiSharedService _uiShared;
|
private readonly UiSharedService _uiShared;
|
||||||
private readonly IProgress<(int, int, FileCacheEntity)> _validationProgress;
|
private readonly IProgress<(int, int, FileCacheEntity)> _validationProgress;
|
||||||
|
private readonly NameplateService _nameplateService;
|
||||||
private (int, int, FileCacheEntity) _currentProgress;
|
private (int, int, FileCacheEntity) _currentProgress;
|
||||||
private bool _deleteAccountPopupModalShown = false;
|
private bool _deleteAccountPopupModalShown = false;
|
||||||
private bool _deleteFilesPopupModalShown = false;
|
private bool _deleteFilesPopupModalShown = false;
|
||||||
@@ -77,7 +78,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
FileCacheManager fileCacheManager,
|
FileCacheManager fileCacheManager,
|
||||||
FileCompactor fileCompactor, ApiController apiController,
|
FileCompactor fileCompactor, ApiController apiController,
|
||||||
IpcManager ipcManager, CacheMonitor cacheMonitor,
|
IpcManager ipcManager, CacheMonitor cacheMonitor,
|
||||||
DalamudUtilService dalamudUtilService, HttpClient httpClient) : base(logger, mediator, "Lightless Sync Settings", performanceCollector)
|
DalamudUtilService dalamudUtilService, HttpClient httpClient,
|
||||||
|
NameplateService nameplateService) : base(logger, mediator, "Lightless Sync Settings", performanceCollector)
|
||||||
{
|
{
|
||||||
_configService = configService;
|
_configService = configService;
|
||||||
_pairManager = pairManager;
|
_pairManager = pairManager;
|
||||||
@@ -94,6 +96,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
_fileCompactor = fileCompactor;
|
_fileCompactor = fileCompactor;
|
||||||
_uiShared = uiShared;
|
_uiShared = uiShared;
|
||||||
|
_nameplateService = nameplateService;
|
||||||
AllowClickthrough = false;
|
AllowClickthrough = false;
|
||||||
AllowPinning = false;
|
AllowPinning = false;
|
||||||
_validationProgress = new Progress<(int, int, FileCacheEntity)>(v => _currentProgress = v);
|
_validationProgress = new Progress<(int, int, FileCacheEntity)>(v => _currentProgress = v);
|
||||||
@@ -111,6 +114,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
Mediator.Subscribe<CharacterDataCreatedMessage>(this, (msg) => LastCreatedCharacterData = msg.CharacterData);
|
Mediator.Subscribe<CharacterDataCreatedMessage>(this, (msg) => LastCreatedCharacterData = msg.CharacterData);
|
||||||
Mediator.Subscribe<DownloadStartedMessage>(this, (msg) => _currentDownloads[msg.DownloadId] = msg.DownloadStatus);
|
Mediator.Subscribe<DownloadStartedMessage>(this, (msg) => _currentDownloads[msg.DownloadId] = msg.DownloadStatus);
|
||||||
Mediator.Subscribe<DownloadFinishedMessage>(this, (msg) => _currentDownloads.TryRemove(msg.DownloadId, out _));
|
Mediator.Subscribe<DownloadFinishedMessage>(this, (msg) => _currentDownloads.TryRemove(msg.DownloadId, out _));
|
||||||
|
_nameplateService = nameplateService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CharacterData? LastCreatedCharacterData { private get; set; }
|
public CharacterData? LastCreatedCharacterData { private get; set; }
|
||||||
@@ -960,6 +964,41 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var nameColorsEnabled = _configService.Current.IsNameplateColorsEnabled;
|
||||||
|
var nameColors = _configService.Current.NameplateColors;
|
||||||
|
var isFriendOverride = _configService.Current.overrideFriendColor;
|
||||||
|
var isPartyOverride = _configService.Current.overridePartyColor;
|
||||||
|
|
||||||
|
if (ImGui.Checkbox("Override name color of visible paired players", ref nameColorsEnabled))
|
||||||
|
{
|
||||||
|
_configService.Current.IsNameplateColorsEnabled = nameColorsEnabled;
|
||||||
|
_configService.Save();
|
||||||
|
_nameplateService.RequestRedraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
using (ImRaii.Disabled(!nameColorsEnabled))
|
||||||
|
{
|
||||||
|
using var indent = ImRaii.PushIndent();
|
||||||
|
if (InputDtrColors("Name color", ref nameColors))
|
||||||
|
{
|
||||||
|
_configService.Current.NameplateColors = nameColors;
|
||||||
|
_configService.Save();
|
||||||
|
_nameplateService.RequestRedraw();
|
||||||
|
}
|
||||||
|
if (ImGui.Checkbox("Override friend color", ref isFriendOverride))
|
||||||
|
{
|
||||||
|
_configService.Current.overrideFriendColor = isFriendOverride;
|
||||||
|
_configService.Save();
|
||||||
|
_nameplateService.RequestRedraw();
|
||||||
|
}
|
||||||
|
if (ImGui.Checkbox("Override party color", ref isPartyOverride))
|
||||||
|
{
|
||||||
|
_configService.Current.overridePartyColor = isPartyOverride;
|
||||||
|
_configService.Save();
|
||||||
|
_nameplateService.RequestRedraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ImGui.Checkbox("Show separate Visible group", ref showVisibleSeparate))
|
if (ImGui.Checkbox("Show separate Visible group", ref showVisibleSeparate))
|
||||||
{
|
{
|
||||||
_configService.Current.ShowVisibleUsersSeparately = showVisibleSeparate;
|
_configService.Current.ShowVisibleUsersSeparately = showVisibleSeparate;
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ using Dalamud.Plugin.Services;
|
|||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using LightlessSync.FileCache;
|
using LightlessSync.FileCache;
|
||||||
using LightlessSync.Interop.Ipc;
|
using LightlessSync.Interop.Ipc;
|
||||||
using LightlessSync.Localization;
|
|
||||||
using LightlessSync.LightlessConfiguration;
|
using LightlessSync.LightlessConfiguration;
|
||||||
using LightlessSync.LightlessConfiguration.Models;
|
using LightlessSync.LightlessConfiguration.Models;
|
||||||
|
using LightlessSync.Localization;
|
||||||
using LightlessSync.PlayerData.Pairs;
|
using LightlessSync.PlayerData.Pairs;
|
||||||
using LightlessSync.Services;
|
using LightlessSync.Services;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ using LightlessSync.LightlessConfiguration.Models;
|
|||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using static FFXIVClientStructs.FFXIV.Client.Game.UI.MapMarkerData.Delegates;
|
|
||||||
|
|
||||||
namespace LightlessSync.WebAPI;
|
namespace LightlessSync.WebAPI;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using LightlessSync.API.Data;
|
using LightlessSync.API.Data;
|
||||||
using LightlessSync.API.Dto.CharaData;
|
using LightlessSync.API.Dto.CharaData;
|
||||||
using LightlessSync.Services.CharaData.Models;
|
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user