Fix MCDF & Masquer sa propre bulle + Bulles uniquement en groupe

This commit is contained in:
2025-11-05 21:22:19 +01:00
parent e3d9300ca3
commit d777dc599f
5 changed files with 69 additions and 66 deletions

View File

@@ -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))

View File

@@ -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))

View File

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