feat: add new ConsoleWindow

This commit is contained in:
goat 2021-07-17 22:45:59 +02:00
parent dc992e15ae
commit c287e28832
No known key found for this signature in database
GPG key ID: F18F057873895461
5 changed files with 529 additions and 190 deletions

View file

@ -140,6 +140,11 @@ namespace Dalamud.Interface.Internal
/// </summary>
public static ImFontPtr IconFont { get; private set; }
/// <summary>
/// Gets an included monospaced font.
/// </summary>
public static ImFontPtr MonoFont { get; private set; }
/// <summary>
/// Gets or sets an action that is exexuted when fonts are rebuilt.
/// </summary>
@ -464,6 +469,13 @@ namespace Dalamud.Interface.Internal
GCHandleType.Pinned);
IconFont = ImGui.GetIO().Fonts.AddFontFromFileTTF(fontPathIcon, 17.0f, null, iconRangeHandle.AddrOfPinnedObject());
var fontPathMono = Path.Combine(this.dalamud.AssetDirectory.FullName, "UIRes", "Inconsolata-Regular.ttf");
if (!File.Exists(fontPathMono))
ShowFontError(fontPathMono);
MonoFont = ImGui.GetIO().Fonts.AddFontFromFileTTF(fontPathMono, 16.0f);
Log.Verbose("[FONT] Invoke OnBuildFonts");
this.OnBuildFonts?.Invoke();
Log.Verbose("[FONT] OnBuildFonts OK!");