mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
add /xldata
This commit is contained in:
parent
107924c7e2
commit
d71e0b2188
3 changed files with 55 additions and 9 deletions
|
|
@ -78,6 +78,12 @@ namespace Dalamud
|
|||
ShowInHelp = false,
|
||||
});
|
||||
|
||||
this.dalamud.CommandManager.AddHandler("/xldata", new CommandInfo(this.OnDebugDrawDataMenu)
|
||||
{
|
||||
HelpMessage = Loc.Localize("DalamudDevDataMenuHelp", "Draw dev data menu DEBUG. Usage: /xldata [Data Dropdown Type]"),
|
||||
ShowInHelp = false,
|
||||
});
|
||||
|
||||
this.dalamud.CommandManager.AddHandler("/xllog", new CommandInfo(this.OnOpenLog)
|
||||
{
|
||||
HelpMessage = Loc.Localize("DalamudDevLogHelp", "Open dev log DEBUG"),
|
||||
|
|
@ -223,6 +229,14 @@ namespace Dalamud
|
|||
this.dalamud.DalamudUi.IsDevMenu = !this.dalamud.DalamudUi.IsDevMenu;
|
||||
}
|
||||
|
||||
private void OnDebugDrawDataMenu(string command, string arguments)
|
||||
{
|
||||
if (string.IsNullOrEmpty(arguments))
|
||||
this.dalamud.DalamudUi.ToggleData();
|
||||
else
|
||||
this.dalamud.DalamudUi.ToggleData(arguments);
|
||||
}
|
||||
|
||||
private void OnOpenLog(string command, string arguments)
|
||||
{
|
||||
this.dalamud.DalamudUi.ToggleLog();
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ namespace Dalamud.Interface
|
|||
private string serverOpString;
|
||||
|
||||
private int currentKind;
|
||||
private string[] dataKinds = new[]
|
||||
{
|
||||
"ServerOpCode", "Address", "Actor Table", "Font Test", "Party List", "Plugin IPC", "Condition",
|
||||
"Gauge", "Command", "Addon", "Addon Inspector", "StartInfo", "Target", "Toast",
|
||||
};
|
||||
|
||||
private bool drawActors = false;
|
||||
private float maxActorDrawDistance = 20;
|
||||
|
|
@ -73,6 +78,31 @@ namespace Dalamud.Interface
|
|||
this.Load();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the DataKind dropdown menu.
|
||||
/// </summary>
|
||||
/// <param name="dataKind">Data kind name, can be lower and/or without spaces.</param>
|
||||
public void SetDataKind(string dataKind)
|
||||
{
|
||||
if (string.IsNullOrEmpty(dataKind))
|
||||
return;
|
||||
|
||||
if (dataKind == "ai")
|
||||
dataKind = "Addon Inspector";
|
||||
|
||||
int index;
|
||||
dataKind = dataKind.Replace(" ", string.Empty).ToLower();
|
||||
var dataKinds = this.dataKinds.Select(k => k.Replace(" ", string.Empty).ToLower()).ToList();
|
||||
if ((index = dataKinds.IndexOf(dataKind)) != -1)
|
||||
{
|
||||
this.currentKind = index;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dalamud.Framework.Gui.Chat.PrintError("/xldata: Invalid Data Type");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw the window via ImGui.
|
||||
/// </summary>
|
||||
|
|
@ -87,15 +117,7 @@ namespace Dalamud.Interface
|
|||
var copy = ImGui.Button("Copy all");
|
||||
ImGui.SameLine();
|
||||
|
||||
ImGui.Combo(
|
||||
"Data kind",
|
||||
ref this.currentKind,
|
||||
new[]
|
||||
{
|
||||
"ServerOpCode", "Address", "Actor Table", "Font Test", "Party List", "Plugin IPC", "Condition",
|
||||
"Gauge", "Command", "Addon", "Addon Inspector", "StartInfo", "Target", "Toast",
|
||||
},
|
||||
14);
|
||||
ImGui.Combo("Data kind", ref this.currentKind, dataKinds, dataKinds.Length);
|
||||
|
||||
ImGui.Checkbox("Resolve GameData", ref this.resolveGameData);
|
||||
|
||||
|
|
|
|||
|
|
@ -460,6 +460,16 @@ namespace Dalamud.Interface
|
|||
this.dataWindow.IsOpen ^= true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggle the data window and preset the dropdown.
|
||||
/// </summary>
|
||||
internal void ToggleData(string dataKind)
|
||||
{
|
||||
this.dataWindow.IsOpen ^= true;
|
||||
if (this.dataWindow.IsOpen)
|
||||
this.dataWindow.SetDataKind(dataKind);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggle the credits window.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue