From d7cad81eb0b9683f1a17833ed1f052b7e575f3cb Mon Sep 17 00:00:00 2001 From: rootdarkarchon Date: Sun, 29 Jan 2023 18:05:12 +0100 Subject: [PATCH] fix tags pausing/resuming, give back owner the same rights as mod --- MareSynchronos/MareSynchronos.csproj | 2 +- MareSynchronos/UI/Components/PairGroupsUi.cs | 2 +- MareSynchronos/UI/GroupPanel.cs | 30 ++++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/MareSynchronos/MareSynchronos.csproj b/MareSynchronos/MareSynchronos.csproj index 5af7d23..84d8767 100644 --- a/MareSynchronos/MareSynchronos.csproj +++ b/MareSynchronos/MareSynchronos.csproj @@ -3,7 +3,7 @@ - 0.7.5 + 0.7.6 https://github.com/Penumbra-Sync/client diff --git a/MareSynchronos/UI/Components/PairGroupsUi.cs b/MareSynchronos/UI/Components/PairGroupsUi.cs index a42de16..0f845a7 100644 --- a/MareSynchronos/UI/Components/PairGroupsUi.cs +++ b/MareSynchronos/UI/Components/PairGroupsUi.cs @@ -49,7 +49,7 @@ namespace MareSynchronos.UI.Components if (visiblePairsInThisTag.Any() || onlinePairsInThisTag.Any() || offlinePairsInThisTag.Any()) { DrawName(tag); - UiShared.DrawWithID($"group-{tag}-buttons", () => DrawButtons(tag, visiblePairsInThisTag)); + UiShared.DrawWithID($"group-{tag}-buttons", () => DrawButtons(tag, visiblePairsInThisTag.Concat(onlinePairsInThisTag).Concat(offlinePairsInThisTag).ToList())); if (_tagHandler.IsTagOpen(tag)) { ImGui.Indent(20); diff --git a/MareSynchronos/UI/GroupPanel.cs b/MareSynchronos/UI/GroupPanel.cs index 6a38bb7..bbb148d 100644 --- a/MareSynchronos/UI/GroupPanel.cs +++ b/MareSynchronos/UI/GroupPanel.cs @@ -736,16 +736,16 @@ namespace MareSynchronos.UI } } - private void DrawSyncshellPairedClient(Pair pair, GroupPairFullInfoDto entry, string ownerUid, bool isOwner, bool isModerator) + private void DrawSyncshellPairedClient(Pair pair, GroupPairFullInfoDto entry, string ownerUid, bool userIsOwner, bool userIsModerator) { var plusButtonSize = UiShared.GetIconButtonSize(FontAwesomeIcon.Plus); var barButtonSize = UiShared.GetIconButtonSize(FontAwesomeIcon.Bars); var entryUID = entry.UserAliasOrUID; var textSize = ImGui.CalcTextSize(entryUID); var originalY = ImGui.GetCursorPosY(); - var userIsMod = entry.GroupPairStatusInfo.IsModerator(); - var userIsOwner = string.Equals(pair.UserData.UID, ownerUid, StringComparison.Ordinal); - var isPinned = entry.GroupPairStatusInfo.IsPinned(); + var entryIsMod = entry.GroupPairStatusInfo.IsModerator(); + var entryIsOwner = string.Equals(pair.UserData.UID, ownerUid, StringComparison.Ordinal); + var entryIsPinned = entry.GroupPairStatusInfo.IsPinned(); var isPaused = pair.IsPaused; var presenceIcon = pair.IsVisible ? FontAwesomeIcon.Eye : (pair.IsOnline ? FontAwesomeIcon.Link : FontAwesomeIcon.Unlink); var presenceColor = (pair.IsOnline || pair.IsVisible) ? ImGuiColors.ParsedGreen : ImGuiColors.DalamudRed; @@ -787,7 +787,7 @@ namespace MareSynchronos.UI ImGui.PopFont(); UiShared.AttachToolTip(presenceText); - if (userIsOwner) + if (entryIsOwner) { ImGui.SameLine(); ImGui.SetCursorPosY(textPos); @@ -796,7 +796,7 @@ namespace MareSynchronos.UI ImGui.PopFont(); UiShared.AttachToolTip("User is owner of this Syncshell"); } - else if (userIsMod) + else if (entryIsMod) { ImGui.SameLine(); ImGui.SetCursorPosY(textPos); @@ -805,7 +805,7 @@ namespace MareSynchronos.UI ImGui.PopFont(); UiShared.AttachToolTip("User is moderator of this Syncshell"); } - else if (isPinned) + else if (entryIsPinned) { ImGui.SameLine(); ImGui.SetCursorPosY(textPos); @@ -886,7 +886,7 @@ namespace MareSynchronos.UI if (plusButtonShown) { - var barWidth = isOwner || (isModerator && !userIsMod && !userIsOwner) + var barWidth = userIsOwner || (userIsModerator && !entryIsMod && !entryIsOwner) ? barButtonSize.X + ImGui.GetStyle().ItemSpacing.X : 0; ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - plusButtonSize.X - barWidth); @@ -899,7 +899,7 @@ namespace MareSynchronos.UI UiShared.AttachToolTip("Pair with " + entryUID + " individually"); } - if (isOwner || (isModerator && !userIsMod && !userIsOwner)) + if (userIsOwner || (userIsModerator && !entryIsMod && !entryIsOwner)) { ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - barButtonSize.X); ImGui.SetCursorPosY(originalY); @@ -914,7 +914,7 @@ namespace MareSynchronos.UI if ((animDisabled || soundsDisabled) && pair.UserPair == null) { var infoIconPosDist = (plusButtonShown ? plusButtonSize.X + ImGui.GetStyle().ItemSpacing.X : 0) - + ((isOwner || (isModerator && !userIsMod && !userIsOwner)) ? barButtonSize.X + ImGui.GetStyle().ItemSpacing.X : 0); + + ((userIsOwner || (userIsModerator && !entryIsMod && !entryIsOwner)) ? barButtonSize.X + ImGui.GetStyle().ItemSpacing.X : 0); var icon = FontAwesomeIcon.InfoCircle; var iconwidth = UiShared.GetIconSize(icon); @@ -949,7 +949,7 @@ namespace MareSynchronos.UI } } - if (!plusButtonShown && !(isOwner || (isModerator && !userIsMod && !userIsOwner))) + if (!plusButtonShown && !(userIsOwner || (userIsModerator && !entryIsMod && !entryIsOwner))) { ImGui.SameLine(); ImGui.Dummy(barButtonSize with { X = 0 }); @@ -957,9 +957,9 @@ namespace MareSynchronos.UI if (ImGui.BeginPopup("Popup")) { - if ((isModerator) && !(userIsMod || userIsOwner)) + if ((userIsModerator || userIsOwner) && !(entryIsMod || entryIsOwner)) { - var pinText = isPinned ? "Unpin user" : "Pin user"; + var pinText = entryIsPinned ? "Unpin user" : "Pin user"; if (UiShared.IconTextButton(FontAwesomeIcon.Thumbtack, pinText)) { ImGui.CloseCurrentPopup(); @@ -986,9 +986,9 @@ namespace MareSynchronos.UI UiShared.AttachToolTip("Ban user from this Syncshell"); } - if (isOwner) + if (userIsOwner) { - string modText = userIsMod ? "Demod user" : "Mod user"; + string modText = entryIsMod ? "Demod user" : "Mod user"; if (UiShared.IconTextButton(FontAwesomeIcon.UserShield, modText)) { if (UiShared.CtrlPressed())