feat: clear font, style, color stack when fonts are rebuilt

This commit is contained in:
goat 2023-06-07 19:57:19 +02:00
parent 46bf3c0c21
commit 69725bbfe9
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
3 changed files with 16 additions and 1 deletions

View file

@ -802,6 +802,11 @@ internal class DalamudInterface : IDisposable, IServiceType
ImGui.SetWindowFocus(null);
}
if (ImGui.MenuItem("Clear stacks"))
{
Service<InterfaceManager>.Get().ClearStacks();
}
if (ImGui.MenuItem("Dump style"))
{
var info = string.Empty;

View file

@ -435,6 +435,15 @@ internal class InterfaceManager : IDisposable, IServiceType
return null;
}
/// <summary>
/// Clear font, style, and color stack. Dangerous, only use when you know
/// no one else has something pushed they may try to pop.
/// </summary>
public void ClearStacks()
{
this.scene?.ClearStacksOnContext();
}
/// <summary>
/// Toggle Windows 11 immersive mode on the game window.
/// </summary>
@ -892,6 +901,7 @@ internal class InterfaceManager : IDisposable, IServiceType
Log.Verbose("[FONT] ImGui.IO.Build will be called.");
ioFonts.Build();
gameFontManager.AfterIoFontsBuild();
this.ClearStacks();
Log.Verbose("[FONT] ImGui.IO.Build OK!");
gameFontManager.AfterBuildFonts();

@ -1 +1 @@
Subproject commit 262d3b0668196fb236e2191c4a37e9be94e5a7a3
Subproject commit 99b735d7a7fe36aaf92c027c75173dd150871c6b