From 8cb28d0ebe6d678f5d0dd46a4d601efe1795540a Mon Sep 17 00:00:00 2001 From: kizer Date: Mon, 18 Jul 2022 00:41:27 +0900 Subject: [PATCH] Call RebuildFonts on next Framework.Tick on NewFontRef (#926) --- Dalamud/Interface/GameFonts/GameFontManager.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Dalamud/Interface/GameFonts/GameFontManager.cs b/Dalamud/Interface/GameFonts/GameFontManager.cs index fa1098be7..af71fe67f 100644 --- a/Dalamud/Interface/GameFonts/GameFontManager.cs +++ b/Dalamud/Interface/GameFonts/GameFontManager.cs @@ -6,6 +6,7 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using Dalamud.Data; +using Dalamud.Game; using Dalamud.Interface.Internal; using Dalamud.Utility.Timing; using ImGuiNET; @@ -184,16 +185,9 @@ namespace Dalamud.Interface.GameFonts needRebuild = !this.fonts.ContainsKey(style); if (needRebuild) { - if (interfaceManager.IsBuildingFontsBeforeAtlasBuild && this.isBetweenBuildFontsAndRightAfterImGuiIoFontsBuild) - { - Log.Information("[GameFontManager] NewFontRef: Building {0} right now, as it is called while BuildFonts is already in progress yet atlas build has not been called yet.", style.ToString()); - this.EnsureFont(style); - } - else - { - Log.Information("[GameFontManager] NewFontRef: Calling RebuildFonts because {0} has been requested.", style.ToString()); - interfaceManager.RebuildFonts(); - } + Log.Information("[GameFontManager] NewFontRef: Queueing RebuildFonts because {0} has been requested.", style.ToString()); + Service.GetAsync() + .ContinueWith(task => task.Result.RunOnTick(() => interfaceManager.RebuildFonts())); } return new(this, style);