From 558709109c0f32b0d7200a5144958d81f282ffaf Mon Sep 17 00:00:00 2001 From: rootdarkarchon Date: Mon, 20 Mar 2023 12:44:35 +0100 Subject: [PATCH] fix nsfw and profile text box rendering --- MareSynchronos/MareSynchronos.csproj | 2 +- MareSynchronos/Services/MareProfileManager.cs | 2 +- MareSynchronos/UI/EditProfileUi.cs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MareSynchronos/MareSynchronos.csproj b/MareSynchronos/MareSynchronos.csproj index 092b627..f855594 100644 --- a/MareSynchronos/MareSynchronos.csproj +++ b/MareSynchronos/MareSynchronos.csproj @@ -3,7 +3,7 @@ - 0.8.10 + 0.8.11 https://github.com/Penumbra-Sync/client diff --git a/MareSynchronos/Services/MareProfileManager.cs b/MareSynchronos/Services/MareProfileManager.cs index 43879eb..d3116ac 100644 --- a/MareSynchronos/Services/MareProfileManager.cs +++ b/MareSynchronos/Services/MareProfileManager.cs @@ -61,7 +61,7 @@ public class MareProfileManager : MediatorSubscriberBase var profile = await _apiController.UserGetProfile(new API.Dto.User.UserDto(data)).ConfigureAwait(false); MareProfileData profileData = new(profile.Disabled, profile.IsNSFW ?? false, string.IsNullOrEmpty(profile.ProfilePictureBase64) ? _mareLogo : profile.ProfilePictureBase64, string.IsNullOrEmpty(profile.Description) ? _noDescription : profile.Description); - if (profileData.IsNSFW && !_mareConfigService.Current.ProfilesAllowNsfw) + if (profileData.IsNSFW && !_mareConfigService.Current.ProfilesAllowNsfw && _apiController.UID != data.UID) { _mareProfiles[data] = NsfwProfileData; } diff --git a/MareSynchronos/UI/EditProfileUi.cs b/MareSynchronos/UI/EditProfileUi.cs index 350839e..3b7359a 100644 --- a/MareSynchronos/UI/EditProfileUi.cs +++ b/MareSynchronos/UI/EditProfileUi.cs @@ -46,7 +46,7 @@ public class EditProfileUi : WindowMediatorSubscriberBase Mediator.Subscribe(this, (_) => IsOpen = false); Mediator.Subscribe(this, (msg) => { - if (msg.UserData != null || string.Equals(msg.UserData.UID, _apiController.UID, StringComparison.Ordinal)) + if (msg.UserData == null || string.Equals(msg.UserData.UID, _apiController.UID, StringComparison.Ordinal)) { _pfpTextureWrap?.Dispose(); _pfpTextureWrap = null; @@ -89,10 +89,10 @@ public class EditProfileUi : WindowMediatorSubscriberBase ImGui.Image(_pfpTextureWrap.ImGuiHandle, new System.Numerics.Vector2(_pfpTextureWrap.Width, _pfpTextureWrap.Height)); } - ImGui.SameLine(256); - var posX = ImGui.GetCursorPosX(); var spacing = ImGui.GetStyle().ItemSpacing.X; - var width = UiSharedService.GetWindowContentRegionWidth() - posX + spacing; + ImGui.SameLine(256 + spacing * 2); + var posX = ImGui.GetCursorPosX(); + var width = UiSharedService.GetWindowContentRegionWidth() - posX + spacing * 2; if (ImGui.BeginChildFrame(100, new System.Numerics.Vector2(width, 256))) { var nsfw = profile.IsNSFW;