diff --git a/MareSynchronos/UI/CharaDataHubUi.cs b/MareSynchronos/UI/CharaDataHubUi.cs index 7b45af5..ef60f34 100644 --- a/MareSynchronos/UI/CharaDataHubUi.cs +++ b/MareSynchronos/UI/CharaDataHubUi.cs @@ -1114,7 +1114,10 @@ public sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase ImGui.TableSetupColumn("Expire"); ImGui.TableSetupColumn("Téléchargements"); ImGui.TableSetupColumn("Accès"); - ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, 220f); + var style = ImGui.GetStyle(); + float BtnWidth(string label) => ImGui.CalcTextSize(label).X + style.FramePadding.X * 2f; + float ownActionsWidth = BtnWidth("Appliquer en GPose") + style.ItemSpacing.X + BtnWidth("Enregistrer") + style.ItemSpacing.X + BtnWidth("Supprimer") + 2f; // small margin + ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, ownActionsWidth); ImGui.TableHeadersRow(); foreach (var entry in _mcdfShareManager.OwnShares) @@ -1134,6 +1137,32 @@ public sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase ImGui.TableNextColumn(); ImGui.TextUnformatted($"UID : {entry.AllowedIndividuals.Count}, Syncshells : {entry.AllowedSyncshells.Count}"); + if (ImGui.IsItemHovered()) + { + ImGui.BeginTooltip(); + if (entry.AllowedIndividuals.Count > 0) + { + ImGui.TextUnformatted("UID autorisés:"); + foreach (var uid in entry.AllowedIndividuals) + ImGui.BulletText(FormatUidWithName(uid)); + } + else + { + ImGui.TextDisabled("Aucun UID autorisé"); + } + ImGui.Separator(); + if (entry.AllowedSyncshells.Count > 0) + { + ImGui.TextUnformatted("Syncshells autorisées:"); + foreach (var gid in entry.AllowedSyncshells) + ImGui.BulletText(FormatSyncshellLabel(gid)); + } + else + { + ImGui.TextDisabled("Aucune syncshell autorisée"); + } + ImGui.EndTooltip(); + } ImGui.TableNextColumn(); using (ImRaii.PushId("ownShare" + entry.Id)) @@ -1177,7 +1206,10 @@ public sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase ImGui.TableSetupColumn("Propriétaire"); ImGui.TableSetupColumn("Expire"); ImGui.TableSetupColumn("Téléchargements"); - ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, 180f); + var style2 = ImGui.GetStyle(); + float BtnWidth2(string label) => ImGui.CalcTextSize(label).X + style2.FramePadding.X * 2f; + float sharedActionsWidth = BtnWidth2("Appliquer") + style2.ItemSpacing.X + BtnWidth2("Enregistrer") + 2f; + ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, sharedActionsWidth); ImGui.TableHeadersRow(); foreach (var entry in _mcdfShareManager.SharedShares) @@ -1188,6 +1220,17 @@ public sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase ImGui.TableNextColumn(); ImGui.TextUnformatted(string.IsNullOrEmpty(entry.OwnerAlias) ? entry.OwnerUid : entry.OwnerAlias); + if (ImGui.IsItemHovered()) + { + ImGui.BeginTooltip(); + ImGui.TextUnformatted($"UID propriétaire: {entry.OwnerUid}"); + if (!string.IsNullOrEmpty(entry.OwnerAlias)) + { + ImGui.Separator(); + ImGui.TextUnformatted($"Alias: {entry.OwnerAlias}"); + } + ImGui.EndTooltip(); + } ImGui.TableNextColumn(); ImGui.TextUnformatted(entry.ExpiresAtUtc.HasValue ? entry.ExpiresAtUtc.Value.ToLocalTime().ToString("g") : "Jamais"); @@ -1334,6 +1377,14 @@ public sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase return trimmed.ToUpperInvariant(); } + private string FormatUidWithName(string uid) + { + if (string.IsNullOrEmpty(uid)) return string.Empty; + var note = _serverConfigurationManager.GetNoteForUid(uid); + if (!string.IsNullOrEmpty(note)) return $"{uid} ({note})"; + return uid; + } + private string FormatPairLabel(string candidate) { if (string.IsNullOrEmpty(candidate)) diff --git a/MareSynchronos/UI/SettingsUi.cs b/MareSynchronos/UI/SettingsUi.cs index 642122c..73dafeb 100644 --- a/MareSynchronos/UI/SettingsUi.cs +++ b/MareSynchronos/UI/SettingsUi.cs @@ -1168,7 +1168,7 @@ public class SettingsUi : WindowMediatorSubscriberBase } _uiShared.DrawHelpText("Active ou désactive complètement l'envoi/la réception et l'affichage des bulles de frappe."); - using (ImRaii.Disabled(!typingEnabled)) + if (typingEnabled) { if (ImGui.Checkbox("Afficher la bulle de frappe sur les plaques", ref typingIndicatorNameplates)) { @@ -1177,7 +1177,7 @@ public class SettingsUi : WindowMediatorSubscriberBase } _uiShared.DrawHelpText("Ajoute une bulle '...' sur la plaque des paires en train d'écrire."); - using (ImRaii.Disabled(!typingIndicatorNameplates)) + if (typingIndicatorNameplates) { using var indentTyping = ImRaii.PushIndent(); var bubbleSize = _configService.Current.TypingIndicatorBubbleSize; @@ -1198,28 +1198,21 @@ public class SettingsUi : WindowMediatorSubscriberBase _configService.Current.TypingIndicatorBubbleSize = selectedBubbleSize.Value; _configService.Save(); } - } - if (ImGui.Checkbox("Tracer la frappe dans la liste de groupe", ref typingIndicatorPartyList)) - { - _configService.Current.TypingIndicatorShowOnPartyList = typingIndicatorPartyList; - _configService.Save(); - } - _uiShared.DrawHelpText("Consigne dans les journaux quand une paire du groupe est en train d'écrire (bulle visuelle ultérieure)."); + if (ImGui.Checkbox("Tracer la frappe dans la liste de groupe", ref typingIndicatorPartyList)) + { + _configService.Current.TypingIndicatorShowOnPartyList = typingIndicatorPartyList; + _configService.Save(); + } + _uiShared.DrawHelpText("Consigne dans les journaux quand une paire du groupe est en train d'écrire (bulle visuelle ultérieure)."); - if (ImGui.Checkbox("Afficher ma propre bulle", ref typingShowSelf)) - { - _configService.Current.TypingIndicatorShowSelf = typingShowSelf; - _configService.Save(); + if (ImGui.Checkbox("Afficher ma propre bulle", ref typingShowSelf)) + { + _configService.Current.TypingIndicatorShowSelf = typingShowSelf; + _configService.Save(); + } + _uiShared.DrawHelpText("Affiche votre propre bulle lorsque vous tapez (utile pour test/retour visuel)."); } - _uiShared.DrawHelpText("Affiche votre propre bulle lorsque vous tapez (utile pour test/retour visuel)."); - - if (ImGui.Button("Redémarrer le système de frappe")) - { - _chatTypingDetectionService.SoftRestart(); - _guiHookService.RequestRedraw(); - } - _uiShared.DrawHelpText("Vide l'état local et réinitialise les timers sans redémarrer le plugin."); } if (ImGui.Checkbox("Show separate Visible group", ref showVisibleSeparate)) diff --git a/MareSynchronos/UI/TypingIndicatorOverlay.cs b/MareSynchronos/UI/TypingIndicatorOverlay.cs index 6a857ad..81344d4 100644 --- a/MareSynchronos/UI/TypingIndicatorOverlay.cs +++ b/MareSynchronos/UI/TypingIndicatorOverlay.cs @@ -345,26 +345,6 @@ public sealed class TypingIndicatorOverlay : WindowMediatorSubscriberBase if (!iconVisible) { - sizeScaleFactor = 2.5f; - var anchor = rootPosition + iconLocalPosition + new Vector2(iconDimensions.X * 0.5f, 0f); - - var distanceOffset = new Vector2(0f, -16f + distance) * scaleVector; - if (iconNode->Height == 24) - { - distanceOffset.Y += 16f * scaleY; - } - distanceOffset.Y += 64f * scaleY; - - var referenceSize = GetConfiguredBubbleSize(scaleX * sizeScaleFactor, scaleY * sizeScaleFactor, false, TypingIndicatorBubbleSize.Small); - var manualOffset = new Vector2(referenceSize.X * 2.00f, referenceSize.Y * 2.00f); - - var iconSizeHidden = GetConfiguredBubbleSize(scaleX * sizeScaleFactor, scaleY * sizeScaleFactor, false); - var center = anchor + distanceOffset + manualOffset; - var topLeft = center - (iconSizeHidden / 2f); - - drawList.AddImage(textureWrap.Handle, topLeft, topLeft + iconSizeHidden, Vector2.Zero, Vector2.One, - ImGui.ColorConvertFloat4ToU32(new Vector4(1f, 1f, 1f, 0.95f))); - return true; } diff --git a/MareSynchronos/WebAPI/SignalR/ApiController.cs b/MareSynchronos/WebAPI/SignalR/ApiController.cs index 57188e3..ac01686 100644 --- a/MareSynchronos/WebAPI/SignalR/ApiController.cs +++ b/MareSynchronos/WebAPI/SignalR/ApiController.cs @@ -180,7 +180,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM InitializeApiHooks(); await _mareHub.StartAsync(token).ConfigureAwait(false); - + _connectionDto = await GetConnectionDto().ConfigureAwait(false); ServerState = ServerState.Connected; diff --git a/MareSynchronos/WebAPI/SignalR/HubFactory.cs b/MareSynchronos/WebAPI/SignalR/HubFactory.cs index cbe3d14..072fb4e 100644 --- a/MareSynchronos/WebAPI/SignalR/HubFactory.cs +++ b/MareSynchronos/WebAPI/SignalR/HubFactory.cs @@ -3,8 +3,6 @@ using MareSynchronos.Services; using MareSynchronos.Services.Mediator; using MareSynchronos.Services.ServerConfiguration; using MareSynchronos.WebAPI.SignalR.Utils; -using MessagePack; -using MessagePack.Resolvers; using Microsoft.AspNetCore.Http.Connections; using Microsoft.AspNetCore.SignalR.Client; using Microsoft.Extensions.DependencyInjection; @@ -172,26 +170,7 @@ public class HubFactory : MediatorSubscriberBase options.SkipNegotiation = hubConfig.SkipNegotiation && (transports == HttpTransportType.WebSockets); options.Transports = transports; }) - .AddMessagePackProtocol(opt => - { - var resolver = CompositeResolver.Create( - AttributeFormatterResolver.Instance, - StandardResolverAllowPrivate.Instance, - BuiltinResolver.Instance, - // replace enum resolver - DynamicEnumAsStringResolver.Instance, - DynamicGenericResolver.Instance, - DynamicUnionResolver.Instance, - DynamicObjectResolver.Instance, - PrimitiveObjectResolver.Instance, - // final fallback(last priority) - StandardResolver.Instance); - - opt.SerializerOptions = - MessagePackSerializerOptions.Standard - .WithCompression(MessagePackCompression.Lz4Block) - .WithResolver(resolver); - }) + .AddJsonProtocol() .WithAutomaticReconnect(new ForeverRetryPolicy(Mediator)) .ConfigureLogging(a => {