Added join on mediator for refresh on finder ui

This commit is contained in:
cake
2025-11-21 14:33:28 +01:00
parent 1586a1d7cc
commit cae7cda187
4 changed files with 8 additions and 8 deletions

View File

@@ -107,7 +107,8 @@ public record GPoseLobbyReceiveWorldData(UserData UserData, WorldData WorldData)
public record OpenCharaDataHubWithFilterMessage(UserData UserData) : MessageBase; public record OpenCharaDataHubWithFilterMessage(UserData UserData) : MessageBase;
public record EnableBroadcastMessage(string HashedCid, bool Enabled) : MessageBase; public record EnableBroadcastMessage(string HashedCid, bool Enabled) : MessageBase;
public record BroadcastStatusChangedMessage(bool Enabled, TimeSpan? Ttl) : MessageBase; public record BroadcastStatusChangedMessage(bool Enabled, TimeSpan? Ttl) : MessageBase;
public record UserLeftSyncshellReloadFinderUi(bool hasLeft, string gid) : MessageBase; public record UserLeftSyncshell(string gid) : MessageBase;
public record UserJoinedSyncshell(string gid) : MessageBase;
public record SyncshellBroadcastsUpdatedMessage : MessageBase; public record SyncshellBroadcastsUpdatedMessage : MessageBase;
public record PairRequestReceivedMessage(string HashedCid, string Message) : MessageBase; public record PairRequestReceivedMessage(string HashedCid, string Message) : MessageBase;
public record PairRequestsUpdatedMessage : MessageBase; public record PairRequestsUpdatedMessage : MessageBase;

View File

@@ -111,7 +111,7 @@ public class DrawFolderGroup : DrawFolderBase
if (_uiSharedService.IconTextButton(FontAwesomeIcon.ArrowCircleLeft, "Leave Syncshell", menuWidth, true) && UiSharedService.CtrlPressed()) if (_uiSharedService.IconTextButton(FontAwesomeIcon.ArrowCircleLeft, "Leave Syncshell", menuWidth, true) && UiSharedService.CtrlPressed())
{ {
_ = _apiController.GroupLeave(_groupFullInfoDto); _ = _apiController.GroupLeave(_groupFullInfoDto);
_lightlessMediator.Publish(new UserLeftSyncshellReloadFinderUi(hasLeft: true, _groupFullInfoDto.GID)); _lightlessMediator.Publish(new UserLeftSyncshell(_groupFullInfoDto.GID));
ImGui.CloseCurrentPopup(); ImGui.CloseCurrentPopup();
} }
UiSharedService.AttachToolTip("Hold CTRL and click to leave this Syncshell" + (!string.Equals(_groupFullInfoDto.OwnerUID, _apiController.UID, StringComparison.Ordinal) UiSharedService.AttachToolTip("Hold CTRL and click to leave this Syncshell" + (!string.Equals(_groupFullInfoDto.OwnerUID, _apiController.UID, StringComparison.Ordinal)

View File

@@ -173,6 +173,7 @@ internal class JoinSyncshellUI : WindowMediatorSubscriberBase
joinPermissions.SetDisableAnimations(_ownPermissions.DisableGroupAnimations); joinPermissions.SetDisableAnimations(_ownPermissions.DisableGroupAnimations);
joinPermissions.SetDisableVFX(_ownPermissions.DisableGroupVFX); joinPermissions.SetDisableVFX(_ownPermissions.DisableGroupVFX);
_ = _apiController.GroupJoinFinalize(new GroupJoinDto(_groupJoinInfo.Group, _previousPassword, joinPermissions)); _ = _apiController.GroupJoinFinalize(new GroupJoinDto(_groupJoinInfo.Group, _previousPassword, joinPermissions));
Mediator.Publish(new UserJoinedSyncshell(_groupJoinInfo.Group.GID));
IsOpen = false; IsOpen = false;
} }
} }

View File

@@ -68,7 +68,8 @@ public class SyncshellFinderUI : WindowMediatorSubscriberBase
Mediator.Subscribe<SyncshellBroadcastsUpdatedMessage>(this, async _ => await RefreshSyncshellsAsync().ConfigureAwait(false)); Mediator.Subscribe<SyncshellBroadcastsUpdatedMessage>(this, async _ => await RefreshSyncshellsAsync().ConfigureAwait(false));
Mediator.Subscribe<BroadcastStatusChangedMessage>(this, async _ => await RefreshSyncshellsAsync().ConfigureAwait(false)); Mediator.Subscribe<BroadcastStatusChangedMessage>(this, async _ => await RefreshSyncshellsAsync().ConfigureAwait(false));
Mediator.Subscribe<UserLeftSyncshellReloadFinderUi>(this, async _ => await RefreshSyncshellsAsync(_.gid).ConfigureAwait(false)); Mediator.Subscribe<UserLeftSyncshell>(this, async _ => await RefreshSyncshellsAsync(_.gid).ConfigureAwait(false));
Mediator.Subscribe<UserJoinedSyncshell>(this, async _ => await RefreshSyncshellsAsync(_.gid).ConfigureAwait(false));
} }
public override async void OnOpen() public override async void OnOpen()
@@ -404,12 +405,9 @@ public class SyncshellFinderUI : WindowMediatorSubscriberBase
} }
else else
{ {
using (ImRaii.PushColor(ImGuiCol.Text, UIColors.Get("DimRed"))) using (ImRaii.Disabled())
{ {
using (ImRaii.Disabled()) ImGui.Button(label, buttonSize);
{
ImGui.Button(label, buttonSize);
}
} }
UiSharedService.AttachToolTip("Already a member or owner of this Syncshell."); UiSharedService.AttachToolTip("Already a member or owner of this Syncshell.");