watafak
This commit is contained in:
@@ -94,7 +94,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
IpcManager ipcManager,
|
||||
LightFinderService broadcastService,
|
||||
CharacterAnalyzer characterAnalyzer,
|
||||
PlayerPerformanceConfigService playerPerformanceConfig, PairRequestService pairRequestService, DalamudUtilService dalamudUtilService, NotificationService lightlessNotificationService, PairLedger pairLedger) : base(logger, mediator, "###LightlessSyncMainUI", performanceCollectorService)
|
||||
PlayerPerformanceConfigService playerPerformanceConfig, PairRequestService pairRequestService, DalamudUtilService dalamudUtilService, NotificationService lightlessNotificationService, PairLedger pairLedger, LightFinderScannerService lightFinderScannerService) : base(logger, mediator, "###LightlessSyncMainUI", performanceCollectorService)
|
||||
{
|
||||
_uiSharedService = uiShared;
|
||||
_configService = configService;
|
||||
@@ -114,44 +114,17 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
_broadcastService = broadcastService;
|
||||
_pairLedger = pairLedger;
|
||||
_dalamudUtilService = dalamudUtilService;
|
||||
_tabMenu = new TopTabMenu(Mediator, _apiController, _uiSharedService, pairRequestService, dalamudUtilService, lightlessNotificationService);
|
||||
_tabMenu = new TopTabMenu(Mediator, _apiController, _uiSharedService, pairRequestService, dalamudUtilService, lightlessNotificationService, broadcastService, lightFinderScannerService);
|
||||
Mediator.Subscribe<PairFocusCharacterMessage>(this, msg => RegisterFocusCharacter(msg.Pair));
|
||||
|
||||
AllowPinning = true;
|
||||
AllowClickthrough = false;
|
||||
TitleBarButtons =
|
||||
[
|
||||
new TitleBarButton()
|
||||
{
|
||||
Icon = FontAwesomeIcon.Cog,
|
||||
Click = (msg) =>
|
||||
{
|
||||
Mediator.Publish(new UiToggleMessage(typeof(SettingsUi)));
|
||||
},
|
||||
IconOffset = new(2,1),
|
||||
ShowTooltip = () =>
|
||||
{
|
||||
ImGui.BeginTooltip();
|
||||
ImGui.Text("Open Lightless Settings");
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
},
|
||||
new TitleBarButton()
|
||||
{
|
||||
Icon = FontAwesomeIcon.Book,
|
||||
Click = (msg) =>
|
||||
{
|
||||
Mediator.Publish(new UiToggleMessage(typeof(EventViewerUI)));
|
||||
},
|
||||
IconOffset = new(2,1),
|
||||
ShowTooltip = () =>
|
||||
{
|
||||
ImGui.BeginTooltip();
|
||||
ImGui.Text("Open Lightless Event Viewer");
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
},
|
||||
];
|
||||
WindowBuilder.For(this)
|
||||
.AllowPinning(true)
|
||||
.AllowClickthrough(false)
|
||||
.SetSizeConstraints(new Vector2(375, 400), new Vector2(375, 2000))
|
||||
.AddFlags(ImGuiWindowFlags.NoDocking)
|
||||
.AddTitleBarButton(FontAwesomeIcon.Cog, "Open Lightless Settings", () => Mediator.Publish(new UiToggleMessage(typeof(SettingsUi))))
|
||||
.AddTitleBarButton(FontAwesomeIcon.Book, "Open Lightless Event Viewer", () => Mediator.Publish(new UiToggleMessage(typeof(EventViewerUI))))
|
||||
.Apply();
|
||||
|
||||
_drawFolders = [.. DrawFolders];
|
||||
|
||||
@@ -172,13 +145,6 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
Mediator.Subscribe<DownloadFinishedMessage>(this, (msg) => _currentDownloads.TryRemove(msg.DownloadId, out _));
|
||||
Mediator.Subscribe<RefreshUiMessage>(this, (msg) => _drawFolders = DrawFolders.ToList());
|
||||
|
||||
Flags |= ImGuiWindowFlags.NoDocking;
|
||||
|
||||
SizeConstraints = new WindowSizeConstraints()
|
||||
{
|
||||
MinimumSize = new Vector2(375, 400),
|
||||
MaximumSize = new Vector2(375, 2000),
|
||||
};
|
||||
_characterAnalyzer = characterAnalyzer;
|
||||
_playerPerformanceConfig = playerPerformanceConfig;
|
||||
_lightlessMediator = mediator;
|
||||
@@ -534,7 +500,8 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
|
||||
private void DrawUIDHeader()
|
||||
{
|
||||
var uidText = GetUidText();
|
||||
var uidText = _apiController.ServerState.GetUidText(_apiController.DisplayName);
|
||||
var uidColor = _apiController.ServerState.GetUidColor();
|
||||
|
||||
Vector4? vanityTextColor = null;
|
||||
Vector4? vanityGlowColor = null;
|
||||
@@ -667,7 +634,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.TextColored(GetUidColor(), uidText);
|
||||
ImGui.TextColored(uidColor, uidText);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -754,7 +721,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.TextColored(GetUidColor(), _apiController.UID);
|
||||
ImGui.TextColored(uidColor, _apiController.UID);
|
||||
}
|
||||
|
||||
if (ImGui.IsItemHovered())
|
||||
@@ -781,7 +748,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
else
|
||||
{
|
||||
UiSharedService.ColorTextWrapped(GetServerError(), GetUidColor());
|
||||
UiSharedService.ColorTextWrapped(_apiController.ServerState.GetServerError(_apiController.AuthFailureMessage), uidColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1048,73 +1015,6 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
return SortGroupEntries(entries, group);
|
||||
}
|
||||
|
||||
private string GetServerError()
|
||||
{
|
||||
return _apiController.ServerState switch
|
||||
{
|
||||
ServerState.Connecting => "Attempting to connect to the server.",
|
||||
ServerState.Reconnecting => "Connection to server interrupted, attempting to reconnect to the server.",
|
||||
ServerState.Disconnected => "You are currently disconnected from the Lightless Sync server.",
|
||||
ServerState.Disconnecting => "Disconnecting from the server",
|
||||
ServerState.Unauthorized => "Server Response: " + _apiController.AuthFailureMessage,
|
||||
ServerState.Offline => "Your selected Lightless Sync server is currently offline.",
|
||||
ServerState.VersionMisMatch =>
|
||||
"Your plugin or the server you are connecting to is out of date. Please update your plugin now. If you already did so, contact the server provider to update their server to the latest version.",
|
||||
ServerState.RateLimited => "You are rate limited for (re)connecting too often. Disconnect, wait 10 minutes and try again.",
|
||||
ServerState.Connected => string.Empty,
|
||||
ServerState.NoSecretKey => "You have no secret key set for this current character. Open Settings -> Service Settings and set a secret key for the current character. You can reuse the same secret key for multiple characters.",
|
||||
ServerState.MultiChara => "Your Character Configuration has multiple characters configured with same name and world. You will not be able to connect until you fix this issue. Remove the duplicates from the configuration in Settings -> Service Settings -> Character Management and reconnect manually after.",
|
||||
ServerState.OAuthMisconfigured => "OAuth2 is enabled but not fully configured, verify in the Settings -> Service Settings that you have OAuth2 connected and, importantly, a UID assigned to your current character.",
|
||||
ServerState.OAuthLoginTokenStale => "Your OAuth2 login token is stale and cannot be used to renew. Go to the Settings -> Service Settings and unlink then relink your OAuth2 configuration.",
|
||||
ServerState.NoAutoLogon => "This character has automatic login into Lightless disabled. Press the connect button to connect to Lightless.",
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
private Vector4 GetUidColor()
|
||||
{
|
||||
return _apiController.ServerState switch
|
||||
{
|
||||
ServerState.Connecting => UIColors.Get("LightlessYellow"),
|
||||
ServerState.Reconnecting => UIColors.Get("DimRed"),
|
||||
ServerState.Connected => UIColors.Get("LightlessPurple"),
|
||||
ServerState.Disconnected => UIColors.Get("LightlessYellow"),
|
||||
ServerState.Disconnecting => UIColors.Get("LightlessYellow"),
|
||||
ServerState.Unauthorized => UIColors.Get("DimRed"),
|
||||
ServerState.VersionMisMatch => UIColors.Get("DimRed"),
|
||||
ServerState.Offline => UIColors.Get("DimRed"),
|
||||
ServerState.RateLimited => UIColors.Get("LightlessYellow"),
|
||||
ServerState.NoSecretKey => UIColors.Get("LightlessYellow"),
|
||||
ServerState.MultiChara => UIColors.Get("LightlessYellow"),
|
||||
ServerState.OAuthMisconfigured => UIColors.Get("DimRed"),
|
||||
ServerState.OAuthLoginTokenStale => UIColors.Get("DimRed"),
|
||||
ServerState.NoAutoLogon => UIColors.Get("LightlessYellow"),
|
||||
_ => UIColors.Get("DimRed")
|
||||
};
|
||||
}
|
||||
|
||||
private string GetUidText()
|
||||
{
|
||||
return _apiController.ServerState switch
|
||||
{
|
||||
ServerState.Reconnecting => "Reconnecting",
|
||||
ServerState.Connecting => "Connecting",
|
||||
ServerState.Disconnected => "Disconnected",
|
||||
ServerState.Disconnecting => "Disconnecting",
|
||||
ServerState.Unauthorized => "Unauthorized",
|
||||
ServerState.VersionMisMatch => "Version mismatch",
|
||||
ServerState.Offline => "Unavailable",
|
||||
ServerState.RateLimited => "Rate Limited",
|
||||
ServerState.NoSecretKey => "No Secret Key",
|
||||
ServerState.MultiChara => "Duplicate Characters",
|
||||
ServerState.OAuthMisconfigured => "Misconfigured OAuth2",
|
||||
ServerState.OAuthLoginTokenStale => "Stale OAuth2",
|
||||
ServerState.NoAutoLogon => "Auto Login disabled",
|
||||
ServerState.Connected => _apiController.DisplayName,
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
private void UiSharedService_GposeEnd()
|
||||
{
|
||||
IsOpen = _wasOpen;
|
||||
|
||||
@@ -5,6 +5,7 @@ using LightlessSync.API.Data.Extensions;
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Utils;
|
||||
using LightlessSync.WebAPI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Numerics;
|
||||
@@ -24,13 +25,10 @@ public class CreateSyncshellUI : WindowMediatorSubscriberBase
|
||||
{
|
||||
_apiController = apiController;
|
||||
_uiSharedService = uiSharedService;
|
||||
SizeConstraints = new()
|
||||
{
|
||||
MinimumSize = new(550, 330),
|
||||
MaximumSize = new(550, 330)
|
||||
};
|
||||
|
||||
Flags = ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse;
|
||||
WindowBuilder.For(this)
|
||||
.SetFixedSize(new Vector2(550, 330))
|
||||
.AddFlags(ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse)
|
||||
.Apply();
|
||||
|
||||
Mediator.Subscribe<DisconnectedMessage>(this, (_) => IsOpen = false);
|
||||
}
|
||||
|
||||
@@ -110,19 +110,9 @@ public class DataAnalysisUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
_hasUpdate = true;
|
||||
});
|
||||
SizeConstraints = new()
|
||||
{
|
||||
MinimumSize = new()
|
||||
{
|
||||
X = 1650,
|
||||
Y = 1000
|
||||
},
|
||||
MaximumSize = new()
|
||||
{
|
||||
X = 3840,
|
||||
Y = 2160
|
||||
}
|
||||
};
|
||||
WindowBuilder.For(this)
|
||||
.SetSizeConstraints(new Vector2(1650, 1000), new Vector2(3840, 2160))
|
||||
.Apply();
|
||||
|
||||
_conversionProgress.ProgressChanged += ConversionProgress_ProgressChanged;
|
||||
}
|
||||
@@ -811,7 +801,7 @@ public class DataAnalysisUi : WindowMediatorSubscriberBase
|
||||
var category = TextureMetadataHelper.DetermineCategory(classificationPath);
|
||||
var slot = TextureMetadataHelper.DetermineSlot(category, classificationPath);
|
||||
var format = entry.Format.Value;
|
||||
var suggestion = TextureMetadataHelper.GetSuggestedTarget(format, mapKind);
|
||||
var suggestion = TextureMetadataHelper.GetSuggestedTarget(format, mapKind, classificationPath);
|
||||
TextureCompressionTarget? currentTarget = TextureMetadataHelper.TryMapFormatToTarget(format, out var mappedTarget)
|
||||
? mappedTarget
|
||||
: null;
|
||||
@@ -2131,8 +2121,16 @@ public class DataAnalysisUi : WindowMediatorSubscriberBase
|
||||
});
|
||||
DrawSelectableColumn(isSelected, () =>
|
||||
{
|
||||
Action? tooltipAction = null;
|
||||
ImGui.TextUnformatted(row.Format);
|
||||
return null;
|
||||
if (!row.IsAlreadyCompressed)
|
||||
{
|
||||
ImGui.SameLine(0f, 4f * ImGuiHelpers.GlobalScale);
|
||||
var iconColor = isSelected ? SelectedTextureRowTextColor : UIColors.Get("LightlessYellow");
|
||||
_uiSharedService.IconText(FontAwesomeIcon.ExclamationTriangle, iconColor);
|
||||
tooltipAction = () => UiSharedService.AttachToolTip("Run compression to reduce file size.");
|
||||
}
|
||||
return tooltipAction;
|
||||
});
|
||||
|
||||
DrawSelectableColumn(isSelected, () =>
|
||||
|
||||
@@ -52,7 +52,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
"bmp"
|
||||
};
|
||||
private const string _imageFileDialogFilter = "Images{.png,.jpg,.jpeg,.webp,.bmp}";
|
||||
private readonly List<int> _tagEditorSelection = [];
|
||||
private readonly List<int> _tagEditorSelection;
|
||||
private int[] _profileTagIds = [];
|
||||
private readonly List<SeStringUtils.SeStringSegment> _tagPreviewSegments = new();
|
||||
private enum ProfileEditorMode
|
||||
@@ -120,6 +120,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
_fileDialogManager = fileDialogManager;
|
||||
_lightlessProfileManager = lightlessProfileManager;
|
||||
_profileTagService = profileTagService;
|
||||
_tagEditorSelection = new List<int>(_maxProfileTags);
|
||||
|
||||
Mediator.Subscribe<GposeStartMessage>(this, (_) => { _wasOpen = IsOpen; IsOpen = false; });
|
||||
Mediator.Subscribe<GposeEndMessage>(this, (_) => IsOpen = _wasOpen);
|
||||
@@ -346,8 +347,8 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
|
||||
SyncProfileState(profile);
|
||||
DrawSection("Profile Preview", scale, () => DrawProfileSnapshot(profile, scale));
|
||||
DrawSection("Profile Image", scale, () => DrawProfileImageControls(profile, scale));
|
||||
DrawSection("Profile Banner", scale, () => DrawProfileBannerControls(profile, scale));
|
||||
DrawSection("Profile Image", scale, () => DrawProfileImageControls(profile));
|
||||
DrawSection("Profile Banner", scale, () => DrawProfileBannerControls(profile));
|
||||
DrawSection("Profile Description", scale, () => DrawProfileDescriptionEditor(profile, scale));
|
||||
DrawSection("Profile Tags", scale, () => DrawProfileTagsEditor(profile, scale));
|
||||
DrawSection("Visibility", scale, () => DrawProfileVisibilityControls());
|
||||
@@ -434,7 +435,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
|
||||
}
|
||||
|
||||
private void DrawProfileImageControls(LightlessUserProfileData profile, float scale)
|
||||
private void DrawProfileImageControls(LightlessUserProfileData profile)
|
||||
{
|
||||
_uiSharedService.DrawNoteLine("# ", UIColors.Get("LightlessBlue"), "Profile pictures must be 512x512 and under 2 MiB.");
|
||||
|
||||
@@ -498,7 +499,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawProfileBannerControls(LightlessUserProfileData profile, float scale)
|
||||
private void DrawProfileBannerControls(LightlessUserProfileData profile)
|
||||
{
|
||||
_uiSharedService.DrawNoteLine("# ", UIColors.Get("LightlessBlue"), "Profile banners must be 840x260 and under 2 MiB.");
|
||||
|
||||
@@ -950,21 +951,6 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
ProfileTagRenderer.RenderTag(tag, rectMin, scale, drawList, style, _tagBackgroundColor, _tagBorderColor, defaultTextColorU32, _tagPreviewSegments, ResolveIconWrap, _logger);
|
||||
}
|
||||
|
||||
private void DrawInfoCell(string displayName, string idLabel, float rowHeight, ImGuiStylePtr style)
|
||||
{
|
||||
var cellStart = ImGui.GetCursorPos();
|
||||
var nameSize = ImGui.CalcTextSize(displayName);
|
||||
var idSize = ImGui.CalcTextSize(idLabel);
|
||||
var totalHeight = nameSize.Y + style.ItemSpacing.Y + idSize.Y;
|
||||
var offsetY = MathF.Max(0f, (rowHeight - totalHeight) * 0.5f) - style.CellPadding.Y;
|
||||
if (offsetY < 0f) offsetY = 0f;
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(cellStart.X + style.CellPadding.X, cellStart.Y + offsetY));
|
||||
ImGui.TextUnformatted(displayName);
|
||||
ImGui.SetCursorPos(new Vector2(cellStart.X + style.CellPadding.X, ImGui.GetCursorPosY() + style.ItemSpacing.Y));
|
||||
ImGui.TextDisabled(idLabel);
|
||||
}
|
||||
|
||||
private void DrawReorderCell(
|
||||
string contextPrefix,
|
||||
int tagId,
|
||||
@@ -1002,8 +988,6 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
var cellStart = ImGui.GetCursorPos();
|
||||
var available = ImGui.GetContentRegionAvail();
|
||||
var buttonHeight = MathF.Max(1f, rowHeight - style.CellPadding.Y * 2f);
|
||||
var hovered = BlendTowardsWhite(baseColor, 0.15f);
|
||||
var active = BlendTowardsWhite(baseColor, 0.3f);
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(cellStart.X, cellStart.Y + style.CellPadding.Y));
|
||||
using (ImRaii.PushId(idSuffix))
|
||||
@@ -1013,7 +997,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
}
|
||||
|
||||
private bool ColoredButton(string label, Vector4 baseColor, Vector2 size, float scale, bool disabled)
|
||||
private static bool ColoredButton(string label, Vector4 baseColor, Vector2 size, float scale, bool disabled)
|
||||
{
|
||||
var style = ImGui.GetStyle();
|
||||
var hovered = BlendTowardsWhite(baseColor, 0.15f);
|
||||
|
||||
@@ -5,6 +5,7 @@ using Dalamud.Interface.Utility.Raii;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Events;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Utils;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
@@ -43,11 +44,9 @@ internal class EventViewerUI : WindowMediatorSubscriberBase
|
||||
{
|
||||
_eventAggregator = eventAggregator;
|
||||
_uiSharedService = uiSharedService;
|
||||
SizeConstraints = new()
|
||||
{
|
||||
MinimumSize = new(600, 500),
|
||||
MaximumSize = new(1000, 2000)
|
||||
};
|
||||
WindowBuilder.For(this)
|
||||
.SetSizeConstraints(new Vector2(600, 500), new Vector2(1000, 2000))
|
||||
.Apply();
|
||||
_filteredEvents = RecreateFilter();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using LightlessSync.Localization;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Services.ServerConfiguration;
|
||||
using LightlessSync.Utils;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Numerics;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -46,11 +47,9 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
||||
ShowCloseButton = false;
|
||||
RespectCloseHotkey = false;
|
||||
|
||||
SizeConstraints = new WindowSizeConstraints()
|
||||
{
|
||||
MinimumSize = new Vector2(600, 400),
|
||||
MaximumSize = new Vector2(600, 2000),
|
||||
};
|
||||
WindowBuilder.For(this)
|
||||
.SetSizeConstraints(new Vector2(600, 400), new Vector2(600, 2000))
|
||||
.Apply();
|
||||
|
||||
GetToSLocalization();
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Utility;
|
||||
using LightlessSync.API.Data.Extensions;
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
@@ -47,11 +46,9 @@ namespace LightlessSync.UI
|
||||
_broadcastScannerService = broadcastScannerService;
|
||||
|
||||
IsOpen = false;
|
||||
this.SizeConstraints = new()
|
||||
{
|
||||
MinimumSize = new(600, 465),
|
||||
MaximumSize = new(750, 525)
|
||||
};
|
||||
WindowBuilder.For(this)
|
||||
.SetSizeConstraints(new Vector2(600, 465), new Vector2(750, 525))
|
||||
.Apply();
|
||||
}
|
||||
|
||||
private void RebuildSyncshellDropdownOptions()
|
||||
|
||||
@@ -9,6 +9,7 @@ using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Utils;
|
||||
using LightlessSync.WebAPI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Numerics;
|
||||
|
||||
namespace LightlessSync.UI;
|
||||
|
||||
@@ -28,12 +29,10 @@ public class PermissionWindowUI : WindowMediatorSubscriberBase
|
||||
_uiSharedService = uiSharedService;
|
||||
_apiController = apiController;
|
||||
_ownPermissions = pair.UserPair.OwnPermissions.DeepClone();
|
||||
Flags = ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoResize;
|
||||
SizeConstraints = new()
|
||||
{
|
||||
MinimumSize = new(450, 100),
|
||||
MaximumSize = new(450, 500)
|
||||
};
|
||||
WindowBuilder.For(this)
|
||||
.SetSizeConstraints(new Vector2(450, 100), new Vector2(450, 500))
|
||||
.AddFlags(ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoResize)
|
||||
.Apply();
|
||||
IsOpen = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.ClientState.Objects.Enums;
|
||||
using Dalamud.Game.Text;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Colors;
|
||||
@@ -8,6 +7,7 @@ using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Utility;
|
||||
using LightlessSync.API.Data;
|
||||
using LightlessSync.API.Data.Comparer;
|
||||
using LightlessSync.API.Data.Enum;
|
||||
using LightlessSync.API.Routes;
|
||||
using LightlessSync.FileCache;
|
||||
using LightlessSync.Interop.Ipc;
|
||||
@@ -18,9 +18,11 @@ using LightlessSync.PlayerData.Handlers;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.ActorTracking;
|
||||
using LightlessSync.Services.Events;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Services.PairProcessing;
|
||||
using LightlessSync.Services.ServerConfiguration;
|
||||
using LightlessSync.UI.Models;
|
||||
using LightlessSync.UI.Services;
|
||||
using LightlessSync.UI.Style;
|
||||
using LightlessSync.Utils;
|
||||
@@ -39,7 +41,6 @@ using System.Net.Http.Json;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using static Penumbra.GameData.Files.ShpkFile;
|
||||
|
||||
namespace LightlessSync.UI;
|
||||
|
||||
@@ -62,6 +63,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
private readonly PerformanceCollectorService _performanceCollector;
|
||||
private readonly PlayerPerformanceConfigService _playerPerformanceConfigService;
|
||||
private readonly PairProcessingLimiter _pairProcessingLimiter;
|
||||
private readonly EventAggregator _eventAggregator;
|
||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||
private readonly UiSharedService _uiShared;
|
||||
private readonly IProgress<(int, int, FileCacheEntity)> _validationProgress;
|
||||
@@ -75,11 +77,13 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
private bool _readClearCache = false;
|
||||
private int _selectedEntry = -1;
|
||||
private string _uidToAddForIgnore = string.Empty;
|
||||
private string _lightfinderIconInput = string.Empty;
|
||||
private bool _lightfinderIconInputInitialized = false;
|
||||
private int _lightfinderIconPresetIndex = -1;
|
||||
private bool _selectGeneralTabOnNextDraw = false;
|
||||
private string _pairDebugFilter = string.Empty;
|
||||
private bool _pairDebugVisibleOnly = true;
|
||||
private bool _pairDiagnosticsEnabled;
|
||||
private string? _selectedPairDebugUid = null;
|
||||
private static readonly LightlessConfig DefaultConfig = new();
|
||||
private static readonly JsonSerializerOptions DebugJsonOptions = new() { WriteIndented = true };
|
||||
private MainSettingsTab _selectedMainTab = MainSettingsTab.General;
|
||||
private TransferSettingsTab _selectedTransferTab = TransferSettingsTab.Transfers;
|
||||
private ServerSettingsTab _selectedServerTab = ServerSettingsTab.CharacterManagement;
|
||||
@@ -143,15 +147,6 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
PermissionSettings,
|
||||
}
|
||||
|
||||
private static readonly (string Label, SeIconChar Icon)[] LightfinderIconPresets = new[]
|
||||
{
|
||||
("Link Marker", SeIconChar.LinkMarker), ("Hyadelyn", SeIconChar.Hyadelyn), ("Gil", SeIconChar.Gil),
|
||||
("Quest Sync", SeIconChar.QuestSync), ("Glamoured", SeIconChar.Glamoured),
|
||||
("Glamoured (Dyed)", SeIconChar.GlamouredDyed), ("Auto-Translate Open", SeIconChar.AutoTranslateOpen),
|
||||
("Auto-Translate Close", SeIconChar.AutoTranslateClose), ("Boxed Star", SeIconChar.BoxedStar),
|
||||
("Boxed Plus", SeIconChar.BoxedPlus)
|
||||
};
|
||||
|
||||
private CancellationTokenSource? _validationCts;
|
||||
private Task<List<FileCacheEntity>>? _validationTask;
|
||||
private bool _wasOpen = false;
|
||||
@@ -162,6 +157,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
ServerConfigurationManager serverConfigurationManager,
|
||||
PlayerPerformanceConfigService playerPerformanceConfigService,
|
||||
PairProcessingLimiter pairProcessingLimiter,
|
||||
EventAggregator eventAggregator,
|
||||
LightlessMediator mediator, PerformanceCollectorService performanceCollector,
|
||||
FileUploadManager fileTransferManager,
|
||||
FileTransferOrchestrator fileTransferOrchestrator,
|
||||
@@ -179,6 +175,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
_serverConfigurationManager = serverConfigurationManager;
|
||||
_playerPerformanceConfigService = playerPerformanceConfigService;
|
||||
_pairProcessingLimiter = pairProcessingLimiter;
|
||||
_eventAggregator = eventAggregator;
|
||||
_performanceCollector = performanceCollector;
|
||||
_fileTransferManager = fileTransferManager;
|
||||
_fileTransferOrchestrator = fileTransferOrchestrator;
|
||||
@@ -192,34 +189,14 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
_uiShared = uiShared;
|
||||
_nameplateService = nameplateService;
|
||||
_actorObjectService = actorObjectService;
|
||||
AllowClickthrough = false;
|
||||
AllowPinning = true;
|
||||
_validationProgress = new Progress<(int, int, FileCacheEntity)>(v => _currentProgress = v);
|
||||
|
||||
SizeConstraints = new WindowSizeConstraints()
|
||||
{
|
||||
MinimumSize = new Vector2(900f, 400f),
|
||||
MaximumSize = new Vector2(900f, 2000f),
|
||||
};
|
||||
|
||||
TitleBarButtons = new()
|
||||
{
|
||||
new TitleBarButton()
|
||||
{
|
||||
Icon = FontAwesomeIcon.FileAlt,
|
||||
Click = (msg) =>
|
||||
{
|
||||
Mediator.Publish(new UiToggleMessage(typeof(UpdateNotesUi)));
|
||||
},
|
||||
IconOffset = new(2, 1),
|
||||
ShowTooltip = () =>
|
||||
{
|
||||
ImGui.BeginTooltip();
|
||||
ImGui.Text("View Update Notes");
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
}
|
||||
};
|
||||
WindowBuilder.For(this)
|
||||
.AllowPinning(true)
|
||||
.AllowClickthrough(false)
|
||||
.SetSizeConstraints(new Vector2(900f, 400f), new Vector2(900f, 2000f))
|
||||
.AddTitleBarButton(FontAwesomeIcon.FileAlt, "View Update Notes", () => Mediator.Publish(new UiToggleMessage(typeof(UpdateNotesUi))))
|
||||
.Apply();
|
||||
|
||||
Mediator.Subscribe<OpenSettingsUiMessage>(this, (_) => Toggle());
|
||||
Mediator.Subscribe<OpenLightfinderSettingsMessage>(this, (_) =>
|
||||
@@ -1309,9 +1286,425 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
UiSharedService.TooltipSeparator
|
||||
+ "Keeping LOD enabled can lead to more crashes. Use at your own risk.");
|
||||
|
||||
ImGuiHelpers.ScaledDummy(10f);
|
||||
DrawPairDebugPanel();
|
||||
|
||||
UiSharedService.ColoredSeparator(UIColors.Get("LightlessYellow"), 2f);
|
||||
}
|
||||
|
||||
private void DrawPairDebugPanel()
|
||||
{
|
||||
ImGui.PushStyleColor(ImGuiCol.Text, UIColors.Get("LightlessYellow"));
|
||||
ImGui.TextUnformatted("Pair Diagnostics");
|
||||
ImGui.PopStyleColor();
|
||||
ImGuiHelpers.ScaledDummy(3f);
|
||||
|
||||
ImGui.Checkbox("Enable Pair Diagnostics", ref _pairDiagnosticsEnabled);
|
||||
UiSharedService.AttachToolTip("When disabled the UI stops querying pair handlers and no diagnostics are processed.");
|
||||
|
||||
if (!_pairDiagnosticsEnabled)
|
||||
{
|
||||
UiSharedService.ColorTextWrapped("Diagnostics are disabled. Enable the toggle above to inspect active pairs.", UIColors.Get("LightlessYellow"));
|
||||
return;
|
||||
}
|
||||
|
||||
var snapshot = _pairUiService.GetSnapshot();
|
||||
if (snapshot.PairsByUid.Count == 0)
|
||||
{
|
||||
UiSharedService.ColorTextWrapped("No pairs are currently tracked. Connect to the service and re-open this panel.", UIColors.Get("LightlessYellow"));
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui.SetNextItemWidth(280f * ImGuiHelpers.GlobalScale);
|
||||
ImGui.InputTextWithHint("##pairDebugFilter", "Search by UID, alias, or player name...", ref _pairDebugFilter, 96);
|
||||
UiSharedService.AttachToolTip("Filters the list by UID, aliases, or currently cached player name.");
|
||||
ImGui.SameLine();
|
||||
ImGui.Checkbox("Visible pairs only", ref _pairDebugVisibleOnly);
|
||||
UiSharedService.AttachToolTip("When enabled only currently visible pairs remain in the list.");
|
||||
|
||||
var pairs = snapshot.PairsByUid.Values;
|
||||
var filteredPairs = pairs
|
||||
.Where(p => !_pairDebugVisibleOnly || p.IsVisible)
|
||||
.Where(p => PairMatchesFilter(p, _pairDebugFilter))
|
||||
.OrderByDescending(p => p.IsVisible)
|
||||
.ThenByDescending(p => p.IsOnline)
|
||||
.ThenBy(p => p.UserData.AliasOrUID, StringComparer.OrdinalIgnoreCase)
|
||||
.ToList();
|
||||
|
||||
if (filteredPairs.Count == 0)
|
||||
{
|
||||
UiSharedService.ColorTextWrapped("No pairs match the current filters.", UIColors.Get("LightlessYellow"));
|
||||
_selectedPairDebugUid = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_selectedPairDebugUid is null || !filteredPairs.Any(p => string.Equals(p.UserData.UID, _selectedPairDebugUid, StringComparison.Ordinal)))
|
||||
{
|
||||
_selectedPairDebugUid = filteredPairs[0].UserData.UID;
|
||||
}
|
||||
|
||||
if (_selectedPairDebugUid is null || !snapshot.PairsByUid.TryGetValue(_selectedPairDebugUid, out var selectedPair))
|
||||
{
|
||||
selectedPair = filteredPairs[0];
|
||||
}
|
||||
|
||||
var visibleCount = pairs.Count(p => p.IsVisible);
|
||||
var onlineCount = pairs.Count(p => p.IsOnline);
|
||||
var totalPairs = snapshot.PairsByUid.Count;
|
||||
ImGui.TextUnformatted($"Visible: {visibleCount} / {totalPairs}; Online: {onlineCount}");
|
||||
|
||||
var mainChildHeight = MathF.Max(ImGui.GetTextLineHeightWithSpacing() * 12f, ImGui.GetContentRegionAvail().Y * 0.95f);
|
||||
if (ImGui.BeginChild("##pairDebugPanel", new Vector2(-1, mainChildHeight), true, ImGuiWindowFlags.HorizontalScrollbar))
|
||||
{
|
||||
var childAvail = ImGui.GetContentRegionAvail();
|
||||
var leftWidth = MathF.Max(220f * ImGuiHelpers.GlobalScale, childAvail.X * 0.35f);
|
||||
leftWidth = MathF.Min(leftWidth, childAvail.X * 0.6f);
|
||||
if (ImGui.BeginChild("##pairDebugList", new Vector2(leftWidth, 0), true, ImGuiWindowFlags.HorizontalScrollbar))
|
||||
{
|
||||
if (ImGui.BeginTable("##pairDebugTable", 3, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.ScrollY | ImGuiTableFlags.ScrollX))
|
||||
{
|
||||
ImGui.TableSetupScrollFreeze(0, 1);
|
||||
ImGui.TableSetupColumn("", ImGuiTableColumnFlags.WidthFixed, 20f * ImGuiHelpers.GlobalScale);
|
||||
ImGui.TableSetupColumn("Pair");
|
||||
ImGui.TableSetupColumn("State", ImGuiTableColumnFlags.WidthFixed, 90f * ImGuiHelpers.GlobalScale);
|
||||
ImGui.TableHeadersRow();
|
||||
|
||||
foreach (var entry in filteredPairs)
|
||||
{
|
||||
var isSelected = string.Equals(entry.UserData.UID, _selectedPairDebugUid, StringComparison.Ordinal);
|
||||
ImGui.TableNextRow();
|
||||
ImGui.TableNextColumn();
|
||||
DrawPairStateIndicator(entry);
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
if (ImGui.Selectable($"{entry.UserData.AliasOrUID}##pairDebugSelect_{entry.UserData.UID}", isSelected, ImGuiSelectableFlags.SpanAllColumns))
|
||||
{
|
||||
_selectedPairDebugUid = entry.UserData.UID;
|
||||
}
|
||||
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetTooltip($"UID: {entry.UserData.UID}\nVisible: {entry.IsVisible}\nOnline: {entry.IsOnline}\nDirect pair: {entry.IsDirectlyPaired}");
|
||||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.TextUnformatted(entry.IsVisible ? "Visible" : entry.IsOnline ? "Online" : "Offline");
|
||||
}
|
||||
|
||||
ImGui.EndTable();
|
||||
}
|
||||
}
|
||||
ImGui.EndChild();
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGui.BeginChild("##pairDebugDetails", new Vector2(0, 0), true, ImGuiWindowFlags.HorizontalScrollbar))
|
||||
{
|
||||
DrawPairDebugDetails(selectedPair, snapshot);
|
||||
}
|
||||
ImGui.EndChild();
|
||||
}
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
private static bool PairMatchesFilter(Pair pair, string filter)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(filter))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return pair.UserData.UID.Contains(filter, StringComparison.OrdinalIgnoreCase)
|
||||
|| pair.UserData.AliasOrUID.Contains(filter, StringComparison.OrdinalIgnoreCase)
|
||||
|| (!string.IsNullOrEmpty(pair.PlayerName) && pair.PlayerName.Contains(filter, StringComparison.OrdinalIgnoreCase))
|
||||
|| (!string.IsNullOrEmpty(pair.Ident) && pair.Ident.Contains(filter, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
private static void DrawPairStateIndicator(Pair pair)
|
||||
{
|
||||
var color = pair.IsVisible
|
||||
? UIColors.Get("LightlessGreen")
|
||||
: pair.IsOnline ? UIColors.Get("LightlessYellow")
|
||||
: UIColors.Get("DimRed");
|
||||
|
||||
var drawList = ImGui.GetWindowDrawList();
|
||||
var cursor = ImGui.GetCursorScreenPos();
|
||||
var radius = ImGui.GetTextLineHeight() * 0.35f;
|
||||
var center = cursor + new Vector2(radius, radius);
|
||||
drawList.AddCircleFilled(center, radius, ImGui.ColorConvertFloat4ToU32(color));
|
||||
ImGui.Dummy(new Vector2(radius * 2f, radius * 2f));
|
||||
}
|
||||
|
||||
private void DrawPairDebugDetails(Pair pair, PairUiSnapshot snapshot)
|
||||
{
|
||||
var debugInfo = pair.GetDebugInfo();
|
||||
var statusColor = pair.IsVisible
|
||||
? UIColors.Get("LightlessGreen")
|
||||
: pair.IsOnline ? UIColors.Get("LightlessYellow")
|
||||
: UIColors.Get("DimRed");
|
||||
|
||||
ImGui.TextColored(statusColor, pair.UserData.AliasOrUID);
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(statusColor, $"[{(pair.IsVisible ? "Visible" : pair.IsOnline ? "Online" : "Offline")}]");
|
||||
|
||||
if (ImGui.BeginTable("##pairDebugProperties", 2, ImGuiTableFlags.SizingStretchProp))
|
||||
{
|
||||
DrawPairPropertyRow("UID", pair.UserData.UID);
|
||||
DrawPairPropertyRow("Alias", string.IsNullOrEmpty(pair.UserData.Alias) ? "(none)" : pair.UserData.Alias!);
|
||||
DrawPairPropertyRow("Player Name", pair.PlayerName ?? "(not cached)");
|
||||
DrawPairPropertyRow("Handler Ident", string.IsNullOrEmpty(pair.Ident) ? "(not bound)" : pair.Ident);
|
||||
DrawPairPropertyRow("Character Id", FormatCharacterId(pair.PlayerCharacterId));
|
||||
DrawPairPropertyRow("Direct Pair", FormatBool(pair.IsDirectlyPaired));
|
||||
DrawPairPropertyRow("Individual Status", pair.IndividualPairStatus.ToString());
|
||||
DrawPairPropertyRow("Any Connection", FormatBool(pair.HasAnyConnection()));
|
||||
DrawPairPropertyRow("Paused", FormatBool(pair.IsPaused));
|
||||
DrawPairPropertyRow("Visible", FormatBool(pair.IsVisible), statusColor);
|
||||
DrawPairPropertyRow("Online", FormatBool(pair.IsOnline));
|
||||
DrawPairPropertyRow("Has Handler", FormatBool(debugInfo.HasHandler));
|
||||
DrawPairPropertyRow("Handler Initialized", FormatBool(debugInfo.HandlerInitialized));
|
||||
DrawPairPropertyRow("Handler Visible", FormatBool(debugInfo.HandlerVisible));
|
||||
DrawPairPropertyRow("Handler Scheduled For Deletion", FormatBool(debugInfo.HandlerScheduledForDeletion));
|
||||
DrawPairPropertyRow("Note", pair.GetNote() ?? "(none)");
|
||||
ImGui.EndTable();
|
||||
}
|
||||
|
||||
ImGui.Separator();
|
||||
ImGui.TextUnformatted("Applied Data");
|
||||
if (ImGui.BeginTable("##pairDebugDataStats", 2, ImGuiTableFlags.SizingStretchProp))
|
||||
{
|
||||
DrawPairPropertyRow("Last Data Size", FormatBytes(pair.LastAppliedDataBytes));
|
||||
DrawPairPropertyRow("Approx. VRAM", FormatBytes(pair.LastAppliedApproximateVRAMBytes));
|
||||
DrawPairPropertyRow("Effective VRAM", FormatBytes(pair.LastAppliedApproximateEffectiveVRAMBytes));
|
||||
DrawPairPropertyRow("Last Triangles", pair.LastAppliedDataTris < 0 ? "n/a" : pair.LastAppliedDataTris.ToString(CultureInfo.InvariantCulture));
|
||||
ImGui.EndTable();
|
||||
}
|
||||
|
||||
var lastData = pair.LastReceivedCharacterData;
|
||||
if (lastData is null)
|
||||
{
|
||||
ImGui.TextDisabled("No character data has been received for this pair.");
|
||||
}
|
||||
else
|
||||
{
|
||||
var fileReplacementCount = lastData.FileReplacements.Values.Sum(list => list?.Count ?? 0);
|
||||
var totalGamePaths = lastData.FileReplacements.Values.Sum(list => list?.Sum(replacement => replacement.GamePaths.Length) ?? 0);
|
||||
ImGui.BulletText($"File replacements: {fileReplacementCount} entries across {totalGamePaths} game paths.");
|
||||
ImGui.BulletText($"Customize+: {lastData.CustomizePlusData.Count}, Glamourer entries: {lastData.GlamourerData.Count}");
|
||||
ImGui.BulletText($"Manipulation length: {lastData.ManipulationData.Length}, Heels set: {FormatBool(!string.IsNullOrEmpty(lastData.HeelsData))}");
|
||||
|
||||
if (ImGui.TreeNode("Last Received Character Data (JSON)"))
|
||||
{
|
||||
DrawJsonBlob(lastData);
|
||||
ImGui.TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.Separator();
|
||||
ImGui.TextUnformatted("Application Timeline");
|
||||
if (ImGui.BeginTable("##pairDebugTimeline", 2, ImGuiTableFlags.SizingStretchProp))
|
||||
{
|
||||
DrawPairPropertyRow("Last Data Received", FormatTimestamp(debugInfo.LastDataReceivedAt));
|
||||
DrawPairPropertyRow("Last Apply Attempt", FormatTimestamp(debugInfo.LastApplyAttemptAt));
|
||||
DrawPairPropertyRow("Last Successful Apply", FormatTimestamp(debugInfo.LastSuccessfulApplyAt));
|
||||
ImGui.EndTable();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(debugInfo.LastFailureReason))
|
||||
{
|
||||
UiSharedService.ColorTextWrapped($"Last failure: {debugInfo.LastFailureReason}", UIColors.Get("DimRed"));
|
||||
if (debugInfo.BlockingConditions.Count > 0)
|
||||
{
|
||||
ImGui.TextUnformatted("Blocking conditions:");
|
||||
foreach (var condition in debugInfo.BlockingConditions)
|
||||
{
|
||||
ImGui.BulletText(condition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.Separator();
|
||||
ImGui.TextUnformatted("Application & Download State");
|
||||
if (ImGui.BeginTable("##pairDebugProcessing", 2, ImGuiTableFlags.SizingStretchProp))
|
||||
{
|
||||
DrawPairPropertyRow("Applying Data", FormatBool(debugInfo.IsApplying));
|
||||
DrawPairPropertyRow("Downloading", FormatBool(debugInfo.IsDownloading));
|
||||
DrawPairPropertyRow("Pending Downloads", debugInfo.PendingDownloadCount.ToString(CultureInfo.InvariantCulture));
|
||||
DrawPairPropertyRow("Forbidden Downloads", debugInfo.ForbiddenDownloadCount.ToString(CultureInfo.InvariantCulture));
|
||||
ImGui.EndTable();
|
||||
}
|
||||
|
||||
ImGui.Separator();
|
||||
ImGui.TextUnformatted("Syncshell Memberships");
|
||||
if (snapshot.PairsWithGroups.TryGetValue(pair, out var groups) && groups.Count > 0)
|
||||
{
|
||||
foreach (var group in groups.OrderBy(g => g.Group.AliasOrGID, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
var flags = group.GroupPairUserInfos.TryGetValue(pair.UserData.UID, out var info) ? info : GroupPairUserInfo.None;
|
||||
var flagLabel = flags switch
|
||||
{
|
||||
GroupPairUserInfo.None => string.Empty,
|
||||
_ => $" ({string.Join(", ", GetGroupInfoFlags(flags))})"
|
||||
};
|
||||
ImGui.BulletText($"{group.Group.AliasOrGID} [{group.Group.GID}]{flagLabel}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.TextDisabled("Not a member of any syncshells.");
|
||||
}
|
||||
|
||||
if (pair.UserPair is null)
|
||||
{
|
||||
ImGui.TextDisabled("Pair DTO snapshot unavailable.");
|
||||
}
|
||||
else if (ImGui.TreeNode("Pair DTO Snapshot"))
|
||||
{
|
||||
DrawJsonBlob(pair.UserPair);
|
||||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
ImGui.Separator();
|
||||
DrawPairEventLog(pair);
|
||||
}
|
||||
|
||||
private static IEnumerable<string> GetGroupInfoFlags(GroupPairUserInfo info)
|
||||
{
|
||||
if (info.HasFlag(GroupPairUserInfo.IsModerator))
|
||||
{
|
||||
yield return "Moderator";
|
||||
}
|
||||
|
||||
if (info.HasFlag(GroupPairUserInfo.IsPinned))
|
||||
{
|
||||
yield return "Pinned";
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawPairEventLog(Pair pair)
|
||||
{
|
||||
ImGui.TextUnformatted("Recent Events");
|
||||
var events = _eventAggregator.EventList.Value;
|
||||
var alias = pair.UserData.Alias;
|
||||
var aliasOrUid = pair.UserData.AliasOrUID;
|
||||
var rawUid = pair.UserData.UID;
|
||||
var playerName = pair.PlayerName;
|
||||
|
||||
var relevantEvents = events.Where(e =>
|
||||
EventMatchesIdentifier(e, rawUid)
|
||||
|| EventMatchesIdentifier(e, aliasOrUid)
|
||||
|| EventMatchesIdentifier(e, alias)
|
||||
|| (!string.IsNullOrEmpty(playerName) && string.Equals(e.Character, playerName, StringComparison.OrdinalIgnoreCase)))
|
||||
.OrderByDescending(e => e.EventTime)
|
||||
.Take(40)
|
||||
.ToList();
|
||||
|
||||
if (relevantEvents.Count == 0)
|
||||
{
|
||||
ImGui.TextDisabled("No recent events were logged for this pair.");
|
||||
return;
|
||||
}
|
||||
|
||||
var baseTableHeight = 300f * ImGuiHelpers.GlobalScale;
|
||||
var tableHeight = MathF.Max(baseTableHeight, ImGui.GetContentRegionAvail().Y);
|
||||
if (ImGui.BeginTable("##pairDebugEvents", 3,
|
||||
ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.ScrollX | ImGuiTableFlags.ScrollY,
|
||||
new Vector2(0f, tableHeight)))
|
||||
{
|
||||
ImGui.TableSetupScrollFreeze(0, 1);
|
||||
ImGui.TableSetupColumn("Time", ImGuiTableColumnFlags.WidthFixed, 110f * ImGuiHelpers.GlobalScale);
|
||||
ImGui.TableSetupColumn("Type", ImGuiTableColumnFlags.WidthFixed, 60f * ImGuiHelpers.GlobalScale);
|
||||
ImGui.TableSetupColumn("Details");
|
||||
ImGui.TableHeadersRow();
|
||||
|
||||
foreach (var ev in relevantEvents)
|
||||
{
|
||||
ImGui.TableNextRow();
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.TextUnformatted(ev.EventTime.ToString("T", CultureInfo.CurrentCulture));
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
var (icon, color) = ev.EventSeverity switch
|
||||
{
|
||||
EventSeverity.Informational => (FontAwesomeIcon.InfoCircle, UIColors.Get("LightlessGreen")),
|
||||
EventSeverity.Warning => (FontAwesomeIcon.ExclamationTriangle, UIColors.Get("LightlessYellow")),
|
||||
EventSeverity.Error => (FontAwesomeIcon.ExclamationCircle, UIColors.Get("DimRed")),
|
||||
_ => (FontAwesomeIcon.QuestionCircle, UIColors.Get("LightlessGrey"))
|
||||
};
|
||||
_uiShared.IconText(icon, color);
|
||||
UiSharedService.AttachToolTip(ev.EventSeverity.ToString());
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.TextWrapped($"[{ev.EventSource}] {ev.Message}");
|
||||
}
|
||||
|
||||
ImGui.EndTable();
|
||||
}
|
||||
}
|
||||
|
||||
private static bool EventMatchesIdentifier(Event evt, string? identifier)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(identifier))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return (!string.IsNullOrEmpty(evt.UserId) && string.Equals(evt.UserId, identifier, StringComparison.OrdinalIgnoreCase))
|
||||
|| (!string.IsNullOrEmpty(evt.AliasOrUid) && string.Equals(evt.AliasOrUid, identifier, StringComparison.OrdinalIgnoreCase))
|
||||
|| (!string.IsNullOrEmpty(evt.UID) && string.Equals(evt.UID, identifier, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
private static void DrawJsonBlob(object? value)
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
ImGui.TextDisabled("(null)");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var json = JsonSerializer.Serialize(value, DebugJsonOptions);
|
||||
ImGui.PushStyleColor(ImGuiCol.Text, UIColors.Get("LightlessGrey"));
|
||||
foreach (var line in json.Split('\n'))
|
||||
{
|
||||
ImGui.TextUnformatted(line);
|
||||
}
|
||||
ImGui.PopStyleColor();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
UiSharedService.ColorTextWrapped($"Failed to serialize data: {ex.Message}", UIColors.Get("DimRed"));
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawPairPropertyRow(string label, string value, Vector4? colorOverride = null)
|
||||
{
|
||||
ImGui.TableNextRow();
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.TextUnformatted(label);
|
||||
ImGui.TableNextColumn();
|
||||
if (colorOverride is { } color)
|
||||
{
|
||||
ImGui.TextColored(color, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.TextUnformatted(value);
|
||||
}
|
||||
}
|
||||
|
||||
private static string FormatTimestamp(DateTime? value)
|
||||
{
|
||||
return value is null ? "n/a" : value.Value.ToLocalTime().ToString("G", CultureInfo.CurrentCulture);
|
||||
}
|
||||
|
||||
private static string FormatBytes(long value) => value < 0 ? "n/a" : UiSharedService.ByteToString(value);
|
||||
|
||||
private static string FormatCharacterId(uint id) => id == uint.MaxValue ? "n/a" : $"{id} (0x{id:X8})";
|
||||
|
||||
private static string FormatBool(bool value) => value ? "Yes" : "No";
|
||||
|
||||
|
||||
private void DrawFileStorageSettings()
|
||||
{
|
||||
_lastTab = "FileCache";
|
||||
@@ -2092,11 +2485,6 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
// redo
|
||||
}
|
||||
else
|
||||
{
|
||||
_lightfinderIconInputInitialized = false;
|
||||
_lightfinderIconPresetIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
_uiShared.DrawHelpText("Switch between the Lightfinder text label and an icon on nameplates.");
|
||||
@@ -2105,11 +2493,6 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
//redo
|
||||
}
|
||||
else
|
||||
{
|
||||
_lightfinderIconInputInitialized = false;
|
||||
_lightfinderIconPresetIndex = -1;
|
||||
}
|
||||
|
||||
UiSharedService.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||
ImGui.TreePop();
|
||||
|
||||
@@ -42,6 +42,8 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
||||
private const float DescriptionMaxVisibleLines = 12f;
|
||||
private const string UserDescriptionPlaceholder = "-- User has no description set --";
|
||||
private const string GroupDescriptionPlaceholder = "-- Syncshell has no description set --";
|
||||
private const string LightfinderDisplayName = "Lightfinder User";
|
||||
private readonly string _lightfinderDisplayName = LightfinderDisplayName;
|
||||
private float _lastComputedWindowHeight = -1f;
|
||||
|
||||
public StandaloneProfileUi(
|
||||
@@ -50,6 +52,7 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
||||
UiSharedService uiBuilder,
|
||||
ServerConfigurationManager serverManager,
|
||||
ProfileTagService profileTagService,
|
||||
DalamudUtilService dalamudUtilService,
|
||||
LightlessProfileManager lightlessProfileManager,
|
||||
PairUiService pairUiService,
|
||||
Pair? pair,
|
||||
@@ -58,7 +61,12 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
||||
bool isLightfinderContext,
|
||||
string? lightfinderCid,
|
||||
PerformanceCollectorService performanceCollector)
|
||||
: base(logger, mediator, BuildWindowTitle(userData, groupData, isLightfinderContext), performanceCollector)
|
||||
: base(logger, mediator, BuildWindowTitle(
|
||||
userData,
|
||||
groupData,
|
||||
isLightfinderContext,
|
||||
isLightfinderContext ? ResolveLightfinderDisplayName(dalamudUtilService, lightfinderCid) : null),
|
||||
performanceCollector)
|
||||
{
|
||||
_uiSharedService = uiBuilder;
|
||||
_serverManager = serverManager;
|
||||
@@ -71,17 +79,19 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
||||
_isGroupProfile = groupData is not null;
|
||||
_isLightfinderContext = isLightfinderContext;
|
||||
_lightfinderCid = lightfinderCid;
|
||||
if (_isLightfinderContext)
|
||||
_lightfinderDisplayName = ResolveLightfinderDisplayName(dalamudUtilService, lightfinderCid);
|
||||
|
||||
Flags = ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoResize;
|
||||
|
||||
var fixedSize = new Vector2(840f, 525f) * ImGuiHelpers.GlobalScale;
|
||||
Size = fixedSize;
|
||||
SizeCondition = ImGuiCond.Always;
|
||||
SizeConstraints = new()
|
||||
{
|
||||
MinimumSize = fixedSize,
|
||||
MaximumSize = new Vector2(fixedSize.X, fixedSize.Y * MaxHeightMultiplier)
|
||||
};
|
||||
WindowBuilder.For(this)
|
||||
.SetSizeConstraints(
|
||||
fixedSize,
|
||||
new Vector2(fixedSize.X, fixedSize.Y * MaxHeightMultiplier))
|
||||
.Apply();
|
||||
|
||||
IsOpen = true;
|
||||
}
|
||||
@@ -115,7 +125,7 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
||||
return fallback;
|
||||
}
|
||||
|
||||
private static string BuildWindowTitle(UserData? userData, GroupData? groupData, bool isLightfinderContext)
|
||||
private static string BuildWindowTitle(UserData? userData, GroupData? groupData, bool isLightfinderContext, string? lightfinderDisplayName)
|
||||
{
|
||||
if (groupData is not null)
|
||||
{
|
||||
@@ -126,11 +136,24 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
||||
if (userData is null)
|
||||
return "Lightless Profile##LightlessSyncStandaloneProfileUI";
|
||||
|
||||
var name = userData.AliasOrUID;
|
||||
var name = isLightfinderContext ? lightfinderDisplayName ?? LightfinderDisplayName : userData.AliasOrUID;
|
||||
var suffix = isLightfinderContext ? " (Lightfinder)" : string.Empty;
|
||||
return $"Lightless Profile of {name}{suffix}##LightlessSyncStandaloneProfileUI{name}";
|
||||
}
|
||||
|
||||
private static string ResolveLightfinderDisplayName(DalamudUtilService dalamudUtilService, string? hashedCid)
|
||||
{
|
||||
if (string.IsNullOrEmpty(hashedCid))
|
||||
return LightfinderDisplayName;
|
||||
|
||||
var (name, address) = dalamudUtilService.FindPlayerByNameHash(hashedCid);
|
||||
if (string.IsNullOrEmpty(name))
|
||||
return LightfinderDisplayName;
|
||||
|
||||
var world = dalamudUtilService.GetWorldNameFromPlayerAddress(address);
|
||||
return string.IsNullOrEmpty(world) ? name : $"{name} ({world})";
|
||||
}
|
||||
|
||||
protected override void DrawInternal()
|
||||
{
|
||||
try
|
||||
@@ -300,7 +323,7 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
||||
? Pair.UserData.Alias!
|
||||
: _isLightfinderContext ? "Lightfinder Session" : noteText ?? string.Empty;
|
||||
|
||||
bool hasVanityAlias = userData.HasVanity && !string.IsNullOrWhiteSpace(userData.Alias);
|
||||
bool hasVanityAlias = !_isLightfinderContext && userData.HasVanity && !string.IsNullOrWhiteSpace(userData.Alias);
|
||||
Vector4? vanityTextColor = null;
|
||||
Vector4? vanityGlowColor = null;
|
||||
|
||||
@@ -314,10 +337,12 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
|
||||
bool useVanityColors = vanityTextColor.HasValue || vanityGlowColor.HasValue;
|
||||
string primaryHeaderText = hasVanityAlias ? userData.Alias! : userData.UID;
|
||||
string primaryHeaderText = _isLightfinderContext
|
||||
? _lightfinderDisplayName
|
||||
: hasVanityAlias ? userData.Alias! : userData.UID;
|
||||
|
||||
List<(string Text, bool UseVanityColor, bool Disabled)> secondaryHeaderLines = new();
|
||||
if (hasVanityAlias)
|
||||
if (!_isLightfinderContext && hasVanityAlias)
|
||||
{
|
||||
secondaryHeaderLines.Add((userData.UID, useVanityColors, false));
|
||||
|
||||
@@ -1232,4 +1257,4 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
||||
bool Emphasis,
|
||||
IReadOnlyList<string>? Tooltip = null,
|
||||
string? TooltipTitle = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,11 +60,9 @@ public class SyncshellFinderUI : WindowMediatorSubscriberBase
|
||||
_dalamudUtilService = dalamudUtilService;
|
||||
|
||||
IsOpen = false;
|
||||
SizeConstraints = new()
|
||||
{
|
||||
MinimumSize = new(600, 400),
|
||||
MaximumSize = new(600, 550)
|
||||
};
|
||||
WindowBuilder.For(this)
|
||||
.SetSizeConstraints(new Vector2(600, 400), new Vector2(600, 550))
|
||||
.Apply();
|
||||
|
||||
Mediator.Subscribe<SyncshellBroadcastsUpdatedMessage>(this, async _ => await RefreshSyncshellsAsync().ConfigureAwait(false));
|
||||
Mediator.Subscribe<BroadcastStatusChangedMessage>(this, async _ => await RefreshSyncshellsAsync().ConfigureAwait(false));
|
||||
|
||||
@@ -7,17 +7,14 @@ using Dalamud.Utility;
|
||||
using LightlessSync.API.Data.Enum;
|
||||
using LightlessSync.API.Data.Extensions;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Services.LightFinder;
|
||||
using LightlessSync.Utils;
|
||||
using LightlessSync.UI.Models;
|
||||
using LightlessSync.UI.Style;
|
||||
using LightlessSync.WebAPI;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
namespace LightlessSync.UI;
|
||||
|
||||
@@ -29,6 +26,8 @@ public class TopTabMenu
|
||||
|
||||
private readonly PairRequestService _pairRequestService;
|
||||
private readonly DalamudUtilService _dalamudUtilService;
|
||||
private readonly LightFinderService _lightFinderService;
|
||||
private readonly LightFinderScannerService _lightFinderScannerService;
|
||||
private readonly HashSet<string> _pendingPairRequestActions = new(StringComparer.Ordinal);
|
||||
private bool _pairRequestsExpanded; // useless for now
|
||||
private int _lastRequestCount;
|
||||
@@ -42,7 +41,7 @@ public class TopTabMenu
|
||||
private SelectedTab _selectedTab = SelectedTab.None;
|
||||
private PairUiSnapshot? _currentSnapshot;
|
||||
|
||||
public TopTabMenu(LightlessMediator lightlessMediator, ApiController apiController, UiSharedService uiSharedService, PairRequestService pairRequestService, DalamudUtilService dalamudUtilService, NotificationService lightlessNotificationService)
|
||||
public TopTabMenu(LightlessMediator lightlessMediator, ApiController apiController, UiSharedService uiSharedService, PairRequestService pairRequestService, DalamudUtilService dalamudUtilService, NotificationService lightlessNotificationService, LightFinderService lightFinderService, LightFinderScannerService lightFinderScannerService)
|
||||
{
|
||||
_lightlessMediator = lightlessMediator;
|
||||
_apiController = apiController;
|
||||
@@ -50,6 +49,8 @@ public class TopTabMenu
|
||||
_dalamudUtilService = dalamudUtilService;
|
||||
_uiSharedService = uiSharedService;
|
||||
_lightlessNotificationService = lightlessNotificationService;
|
||||
_lightFinderService = lightFinderService;
|
||||
_lightFinderScannerService = lightFinderScannerService;
|
||||
}
|
||||
|
||||
private enum SelectedTab
|
||||
@@ -154,7 +155,7 @@ public class TopTabMenu
|
||||
Selune.RegisterHighlight(ImGui.GetItemRectMin(), ImGui.GetItemRectMax(), SeluneHighlightMode.Both, true, buttonBorderThickness, exactSize: true, clipToElement: true, roundingOverride: buttonRounding);
|
||||
}
|
||||
}
|
||||
UiSharedService.AttachToolTip("Zone Chat");
|
||||
UiSharedService.AttachToolTip("Lightless Chat");
|
||||
ImGui.SameLine();
|
||||
|
||||
ImGui.SameLine();
|
||||
@@ -786,12 +787,28 @@ public class TopTabMenu
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Globe, "Syncshell Finder", buttonX, center: true))
|
||||
var syncshellFinderLabel = GetSyncshellFinderLabel();
|
||||
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Globe, syncshellFinderLabel, buttonX, center: true))
|
||||
{
|
||||
_lightlessMediator.Publish(new UiToggleMessage(typeof(SyncshellFinderUI)));
|
||||
}
|
||||
}
|
||||
|
||||
private string GetSyncshellFinderLabel()
|
||||
{
|
||||
if (!_lightFinderService.IsBroadcasting)
|
||||
return "Syncshell Finder";
|
||||
|
||||
var nearbyCount = _lightFinderScannerService
|
||||
.GetActiveSyncshellBroadcasts()
|
||||
.Where(b => !string.IsNullOrEmpty(b.GID))
|
||||
.Select(b => b.GID!)
|
||||
.Distinct(StringComparer.Ordinal)
|
||||
.Count();
|
||||
|
||||
return nearbyCount > 0 ? $"Syncshell Finder ({nearbyCount})" : "Syncshell Finder";
|
||||
}
|
||||
|
||||
private void DrawUserConfig(float availableWidth, float spacingX)
|
||||
{
|
||||
var buttonX = (availableWidth - spacingX) / 2f;
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace LightlessSync.UI
|
||||
{ "LightlessGreen", "#7cd68a" },
|
||||
{ "LightlessGreenDefault", "#468a50" },
|
||||
{ "LightlessOrange", "#ffb366" },
|
||||
{ "LightlessGrey", "#8f8f8f" },
|
||||
{ "PairBlue", "#88a2db" },
|
||||
{ "DimRed", "#d44444" },
|
||||
{ "LightlessAdminText", "#ffd663" },
|
||||
|
||||
@@ -13,6 +13,7 @@ using YamlDotNet.Serialization;
|
||||
using YamlDotNet.Serialization.NamingConventions;
|
||||
using Dalamud.Interface;
|
||||
using LightlessSync.UI.Models;
|
||||
using LightlessSync.Utils;
|
||||
|
||||
namespace LightlessSync.UI;
|
||||
|
||||
@@ -69,21 +70,20 @@ public class UpdateNotesUi : WindowMediatorSubscriberBase
|
||||
_uiShared = uiShared;
|
||||
_configService = configService;
|
||||
|
||||
AllowClickthrough = false;
|
||||
AllowPinning = false;
|
||||
RespectCloseHotkey = true;
|
||||
ShowCloseButton = true;
|
||||
|
||||
Flags = ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse |
|
||||
ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoMove;
|
||||
|
||||
SizeConstraints = new WindowSizeConstraints()
|
||||
{
|
||||
MinimumSize = new Vector2(800, 700), MaximumSize = new Vector2(800, 700),
|
||||
};
|
||||
|
||||
PositionCondition = ImGuiCond.Always;
|
||||
|
||||
WindowBuilder.For(this)
|
||||
.AllowPinning(false)
|
||||
.AllowClickthrough(false)
|
||||
.SetFixedSize(new Vector2(800, 700))
|
||||
.Apply();
|
||||
|
||||
LoadEmbeddedResources();
|
||||
logger.LogInformation("UpdateNotesUi constructor completed successfully");
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Globalization;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using LightlessSync.API.Data;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
@@ -13,7 +9,6 @@ using Dalamud.Interface.Utility.Raii;
|
||||
using LightlessSync.API.Dto.Chat;
|
||||
using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.LightlessConfiguration.Models;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services;
|
||||
using LightlessSync.Services.Chat;
|
||||
using LightlessSync.Services.Mediator;
|
||||
@@ -75,7 +70,7 @@ public sealed class ZoneChatUi : WindowMediatorSubscriberBase
|
||||
ChatConfigService chatConfigService,
|
||||
ApiController apiController,
|
||||
PerformanceCollectorService performanceCollectorService)
|
||||
: base(logger, mediator, "Zone Chat", performanceCollectorService)
|
||||
: base(logger, mediator, "Lightless Chat", performanceCollectorService)
|
||||
{
|
||||
_uiSharedService = uiSharedService;
|
||||
_zoneChatService = zoneChatService;
|
||||
@@ -93,11 +88,11 @@ public sealed class ZoneChatUi : WindowMediatorSubscriberBase
|
||||
RefreshWindowFlags();
|
||||
Size = new Vector2(450, 420) * ImGuiHelpers.GlobalScale;
|
||||
SizeCondition = ImGuiCond.FirstUseEver;
|
||||
SizeConstraints = new()
|
||||
{
|
||||
MinimumSize = new Vector2(320f, 260f) * ImGuiHelpers.GlobalScale,
|
||||
MaximumSize = new Vector2(900f, 900f) * ImGuiHelpers.GlobalScale
|
||||
};
|
||||
WindowBuilder.For(this)
|
||||
.SetSizeConstraints(
|
||||
new Vector2(320f, 260f) * ImGuiHelpers.GlobalScale,
|
||||
new Vector2(900f, 900f) * ImGuiHelpers.GlobalScale)
|
||||
.Apply();
|
||||
|
||||
Mediator.Subscribe<ChatChannelMessageAdded>(this, OnChatChannelMessageAdded);
|
||||
Mediator.Subscribe<ChatChannelHistoryCleared>(this, msg =>
|
||||
|
||||
Reference in New Issue
Block a user