feat: show logo instead of ugly scaled text for testing

This commit is contained in:
goat 2021-12-06 20:14:25 +01:00
parent cc362d5fd7
commit 4ec3673954
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5

View file

@ -1,6 +1,7 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.IO;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
using System.Reflection; using System.Reflection;
@ -24,6 +25,7 @@ using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.System.Framework; using FFXIVClientStructs.FFXIV.Client.System.Framework;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
using ImGuiNET; using ImGuiNET;
using ImGuiScene;
using PInvoke; using PInvoke;
using Serilog.Events; using Serilog.Events;
@ -61,6 +63,8 @@ namespace Dalamud.Interface.Internal
private bool isImGuiDrawDemoWindow = false; private bool isImGuiDrawDemoWindow = false;
private bool isImGuiDrawMetricsWindow = false; private bool isImGuiDrawMetricsWindow = false;
private readonly TextureWrap logoTexture;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="DalamudInterface"/> class. /// Initializes a new instance of the <see cref="DalamudInterface"/> class.
/// </summary> /// </summary>
@ -100,7 +104,12 @@ namespace Dalamud.Interface.Internal
ImGuiManagedAsserts.AssertsEnabled = configuration.AssertsEnabledAtStartup; ImGuiManagedAsserts.AssertsEnabled = configuration.AssertsEnabledAtStartup;
Service<InterfaceManager>.Get().Draw += this.OnDraw; var interfaceManager = Service<InterfaceManager>.Get();
interfaceManager.Draw += this.OnDraw;
var dalamud = Service<Dalamud>.Get();
this.logoTexture =
interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "logo.png"))!;
} }
/// <summary> /// <summary>
@ -122,6 +131,8 @@ namespace Dalamud.Interface.Internal
{ {
Service<InterfaceManager>.Get().Draw -= this.OnDraw; Service<InterfaceManager>.Get().Draw -= this.OnDraw;
this.logoTexture.Dispose();
this.WindowSystem.RemoveAllWindows(); this.WindowSystem.RemoveAllWindows();
this.creditsWindow.Dispose(); this.creditsWindow.Dispose();
@ -363,11 +374,10 @@ namespace Dalamud.Interface.Internal
if (config.DoDalamudTest) if (config.DoDalamudTest)
{ {
ImGui.SetWindowFontScale(2.2f);
ImGuiHelpers.ScaledDummy(20); ImGuiHelpers.ScaledDummy(20);
ImGuiHelpers.ScaledDummy(20); ImGuiHelpers.ScaledDummy(20);
ImGui.SameLine(); ImGui.SameLine();
ImGui.TextColored(ImGuiColors.DPSRed, "Dalamud Staging"); ImGui.Image(this.logoTexture.ImGuiHandle, new Vector2(25, 25));
} }
ImGui.End(); ImGui.End();