mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-19 14:27:45 +01:00
Easier SingleFontChooserDialog ctor, window pos/size/flags, and more docs (#1704)
* Make SingleFontChooserDialog ctor less confusing The current constructor expects a new fresh instance of IFontAtlas, which can be easy to miss, resulting in wasted time troubleshooting without enough clues. New constructor is added that directly takes an instance of UiBuilder, and the old constructor has been obsoleted and should be changed to private on api 10. * Add position, size, and window flags conf to SFCD * Improve documentations * Add test for PopupPosition/Size --------- Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
This commit is contained in:
parent
a26bb58fdb
commit
cf4a9e3055
6 changed files with 327 additions and 60 deletions
|
|
@ -12,7 +12,6 @@ using Dalamud.Interface.GameFonts;
|
|||
using Dalamud.Interface.ImGuiFontChooserDialog;
|
||||
using Dalamud.Interface.Internal.Windows.PluginInstaller;
|
||||
using Dalamud.Interface.Internal.Windows.Settings.Widgets;
|
||||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
using Dalamud.Interface.ManagedFontAtlas.Internals;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Utility;
|
||||
|
|
@ -199,10 +198,10 @@ public class SettingsTabLook : SettingsTab
|
|||
if (ImGui.Button(Loc.Localize("DalamudSettingChooseDefaultFont", "Choose Default Font")))
|
||||
{
|
||||
var faf = Service<FontAtlasFactory>.Get();
|
||||
var fcd = new SingleFontChooserDialog(
|
||||
faf.CreateFontAtlas($"{nameof(SettingsTabLook)}:Default", FontAtlasAutoRebuildMode.Async));
|
||||
var fcd = new SingleFontChooserDialog(faf, $"{nameof(SettingsTabLook)}:Default");
|
||||
fcd.SelectedFont = (SingleFontSpec)this.defaultFontSpec;
|
||||
fcd.FontFamilyExcludeFilter = x => x is DalamudDefaultFontAndFamilyId;
|
||||
fcd.SetPopupPositionAndSizeToCurrentWindowCenter();
|
||||
interfaceManager.Draw += fcd.Draw;
|
||||
fcd.ResultTask.ContinueWith(
|
||||
r => Service<Framework>.Get().RunOnFrameworkThread(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue