default to axis fonts for profile description display

This commit is contained in:
rootdarkarchon
2023-03-20 13:31:49 +01:00
parent 558709109c
commit 126f2b8084
2 changed files with 8 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
using Dalamud.Interface; using Dalamud.Interface;
using Dalamud.Interface.Colors; using Dalamud.Interface.Colors;
using Dalamud.Interface.GameFonts;
using Dalamud.Interface.ImGuiFileDialog; using Dalamud.Interface.ImGuiFileDialog;
using ImGuiNET; using ImGuiNET;
using ImGuiScene; using ImGuiScene;
@@ -99,7 +100,9 @@ public class EditProfileUi : WindowMediatorSubscriberBase
ImGui.BeginDisabled(); ImGui.BeginDisabled();
ImGui.Checkbox("Is NSFW", ref nsfw); ImGui.Checkbox("Is NSFW", ref nsfw);
ImGui.EndDisabled(); ImGui.EndDisabled();
ImGui.PushFont(_uiBuilder.GetGameFontHandle(new GameFontStyle(GameFontFamilyAndSize.Axis12)).ImFont);
UiSharedService.TextWrapped("Description:" + Environment.NewLine + profile.Description); UiSharedService.TextWrapped("Description:" + Environment.NewLine + profile.Description);
ImGui.PopFont();
} }
ImGui.EndChildFrame(); ImGui.EndChildFrame();
@@ -164,7 +167,9 @@ public class EditProfileUi : WindowMediatorSubscriberBase
UiSharedService.DrawHelpText("If your profile description or image can be considered NSFW, toggle this to ON"); UiSharedService.DrawHelpText("If your profile description or image can be considered NSFW, toggle this to ON");
var widthTextBox = UiSharedService.GetWindowContentRegionWidth() - posX + spacing; var widthTextBox = UiSharedService.GetWindowContentRegionWidth() - posX + spacing;
ImGui.TextUnformatted($"Description {_descriptionText.Length}/750"); ImGui.TextUnformatted($"Description {_descriptionText.Length}/750");
ImGui.PushFont(_uiBuilder.GetGameFontHandle(new GameFontStyle(GameFontFamilyAndSize.Axis12)).ImFont);
ImGui.InputTextMultiline("##description", ref _descriptionText, 750, new System.Numerics.Vector2(widthTextBox, 200)); ImGui.InputTextMultiline("##description", ref _descriptionText, 750, new System.Numerics.Vector2(widthTextBox, 200));
ImGui.PopFont();
if (UiSharedService.IconTextButton(FontAwesomeIcon.Save, "Save Description")) if (UiSharedService.IconTextButton(FontAwesomeIcon.Save, "Save Description"))
{ {
_ = _apiController.UserSetProfile(new UserProfileDto(new UserData(_apiController.UID), false, null, null, _descriptionText)); _ = _apiController.UserSetProfile(new UserProfileDto(new UserData(_apiController.UID), false, null, null, _descriptionText));

View File

@@ -9,6 +9,7 @@ using ImGuiScene;
using System.Numerics; using System.Numerics;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using MareSynchronos.Services; using MareSynchronos.Services;
using Dalamud.Interface.GameFonts;
namespace MareSynchronos.UI.Handlers; namespace MareSynchronos.UI.Handlers;
@@ -127,7 +128,9 @@ public class UidDisplayHandler
} }
var posDone = ImGui.GetCursorPos(); var posDone = ImGui.GetCursorPos();
ImGui.PushFont(_uiBuilder.GetGameFontHandle(new GameFontStyle(GameFontFamilyAndSize.Axis12)).ImFont);
UiSharedService.TextWrapped(mareProfile.Profile.Description); UiSharedService.TextWrapped(mareProfile.Profile.Description);
ImGui.PopFont();
ImGui.Unindent(); ImGui.Unindent();
var sepColor = ImGui.GetStyle().Colors[(int)ImGuiCol.Separator]; var sepColor = ImGui.GetStyle().Colors[(int)ImGuiCol.Separator];