mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 12:44:16 +01:00
feat: ImGui info command
This commit is contained in:
parent
311968ed57
commit
ff64c01643
2 changed files with 35 additions and 1 deletions
|
|
@ -22,6 +22,7 @@ using Dalamud.Game.Network;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Core;
|
using Serilog.Core;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
|
@ -234,6 +235,8 @@ namespace Dalamud {
|
||||||
this.isImguiDrawCreditsWindow = true;
|
this.isImguiDrawCreditsWindow = true;
|
||||||
}
|
}
|
||||||
ImGui.MenuItem("Draw ImGui demo", "", ref this.isImguiDrawDemoWindow);
|
ImGui.MenuItem("Draw ImGui demo", "", ref this.isImguiDrawDemoWindow);
|
||||||
|
if (ImGui.MenuItem("Dump ImGui info"))
|
||||||
|
OnDebugImInfoCommand(null, null);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
if (ImGui.MenuItem("Unload Dalamud"))
|
if (ImGui.MenuItem("Unload Dalamud"))
|
||||||
{
|
{
|
||||||
|
|
@ -434,6 +437,12 @@ namespace Dalamud {
|
||||||
{
|
{
|
||||||
HelpMessage = Loc.Localize("DalamudLanguageHelp", "Set the language for the in-game addon and plugins that support it.")
|
HelpMessage = Loc.Localize("DalamudLanguageHelp", "Set the language for the in-game addon and plugins that support it.")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.CommandManager.AddHandler("/imdebug", new CommandInfo(OnDebugImInfoCommand)
|
||||||
|
{
|
||||||
|
HelpMessage = "ImGui DEBUG",
|
||||||
|
ShowInHelp = false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnUnloadCommand(string command, string arguments) {
|
private void OnUnloadCommand(string command, string arguments) {
|
||||||
|
|
@ -620,6 +629,28 @@ namespace Dalamud {
|
||||||
this.isImguiDrawDevMenu = true;
|
this.isImguiDrawDevMenu = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDebugImInfoCommand(string command, string arguments) {
|
||||||
|
var io = this.InterfaceManager.LastImGuiIoPtr;
|
||||||
|
var info = $"WantCaptureKeyboard: {io.WantCaptureKeyboard}\n";
|
||||||
|
info += $"WantCaptureMouse: {io.WantCaptureMouse}\n";
|
||||||
|
info += $"WantSetMousePos: {io.WantSetMousePos}\n";
|
||||||
|
info += $"WantTextInput: {io.WantTextInput}\n";
|
||||||
|
info += $"WantSaveIniSettings: {io.WantSaveIniSettings}\n";
|
||||||
|
info += $"BackendFlags: {(int) io.BackendFlags}\n";
|
||||||
|
info += $"DeltaTime: {io.DeltaTime}\n";
|
||||||
|
info += $"DisplaySize: {io.DisplaySize.X} {io.DisplaySize.Y}\n";
|
||||||
|
info += $"Framerate: {io.Framerate}\n";
|
||||||
|
info += $"MetricsActiveWindows: {io.MetricsActiveWindows}\n";
|
||||||
|
info += $"MetricsRenderWindows: {io.MetricsRenderWindows}\n";
|
||||||
|
info += $"MousePos: {io.MousePos.X} {io.MousePos.Y}\n";
|
||||||
|
info += $"MouseClicked: {io.MouseClicked}\n";
|
||||||
|
info += $"MouseDown: {io.MouseDown}\n";
|
||||||
|
info += $"NavActive: {io.NavActive}\n";
|
||||||
|
info += $"NavVisible: {io.NavVisible}\n";
|
||||||
|
|
||||||
|
Log.Information(info);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnOpenInstallerCommand(string command, string arguments) {
|
private void OnOpenInstallerCommand(string command, string arguments) {
|
||||||
this.pluginWindow = new PluginInstallerWindow(this.PluginManager, PluginRepository, this.StartInfo.GameVersion);
|
this.pluginWindow = new PluginInstallerWindow(this.PluginManager, PluginRepository, this.StartInfo.GameVersion);
|
||||||
this.isImguiDrawPluginWindow = true;
|
this.isImguiDrawPluginWindow = true;
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@ namespace Dalamud.Interface
|
||||||
private delegate void InstallRTSSHook();
|
private delegate void InstallRTSSHook();
|
||||||
private string rtssPath;
|
private string rtssPath;
|
||||||
|
|
||||||
|
public ImGuiIOPtr LastImGuiIoPtr;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This event gets called by a plugin UiBuilder when read
|
/// This event gets called by a plugin UiBuilder when read
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -297,7 +299,8 @@ namespace Dalamud.Interface
|
||||||
// they will see both cursors.
|
// they will see both cursors.
|
||||||
// Doing this here because it's somewhat application-specific behavior
|
// Doing this here because it's somewhat application-specific behavior
|
||||||
//ImGui.GetIO().MouseDrawCursor = ImGui.GetIO().WantCaptureMouse;
|
//ImGui.GetIO().MouseDrawCursor = ImGui.GetIO().WantCaptureMouse;
|
||||||
this.lastWantCapture = ImGui.GetIO().WantCaptureMouse;
|
this.LastImGuiIoPtr = ImGui.GetIO();
|
||||||
|
this.lastWantCapture = this.LastImGuiIoPtr.WantCaptureMouse;
|
||||||
|
|
||||||
OnDraw?.Invoke();
|
OnDraw?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue