feat: add some texture load debug to Data window

This commit is contained in:
goat 2021-04-19 22:32:26 +02:00
parent d6cd69508a
commit c0e34420a7
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 27 additions and 2 deletions

View file

@ -251,7 +251,7 @@ namespace Dalamud
}
}
this.Data = new DataManager(this.StartInfo.Language);
this.Data = new DataManager(this.StartInfo.Language, this.InterfaceManager);
try
{
this.Data.Initialize(this.AssetDirectory.FullName);

View file

@ -16,6 +16,7 @@ using Dalamud.Interface.Colors;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;
using ImGuiNET;
using ImGuiScene;
using Newtonsoft.Json;
using Serilog;
@ -35,7 +36,7 @@ namespace Dalamud.Interface
private string[] dataKinds = new[]
{
"ServerOpCode", "Address", "Actor Table", "Font Test", "Party List", "Plugin IPC", "Condition",
"Gauge", "Command", "Addon", "Addon Inspector", "StartInfo", "Target", "Toast", "ImGui"
"Gauge", "Command", "Addon", "Addon Inspector", "StartInfo", "Target", "Toast", "ImGui", "Tex",
};
private bool drawActors = false;
@ -62,6 +63,9 @@ namespace Dalamud.Interface
private int questToastIconId = 0;
private bool questToastCheckmark = false;
private string inputTexPath = string.Empty;
private TextureWrap debugTex = null;
private uint copyButtonIndex = 0;
/// <summary>
@ -347,6 +351,27 @@ namespace Dalamud.Interface
ImGui.Text("Monitor count: " + ImGui.GetPlatformIO().Monitors.Size);
break;
// Tex
case 15:
ImGui.InputText("Tex Path", ref this.inputTexPath, 255);
if (ImGui.Button("Load Tex"))
{
try
{
this.debugTex = this.dalamud.Data.GetImGuiTexture(this.inputTexPath);
}
catch (Exception ex)
{
Log.Error(ex, "Could not load tex.");
}
}
if (this.debugTex != null)
ImGui.Image(this.debugTex.ImGuiHandle, new Vector2(this.debugTex.Width, this.debugTex.Height));
break;
}
}
else