mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-21 15:27:43 +01:00
stuff
This commit is contained in:
parent
f0c480ef4b
commit
2105cb5b7c
2 changed files with 45 additions and 1 deletions
|
|
@ -292,7 +292,11 @@ namespace Dalamud
|
||||||
break;
|
break;
|
||||||
case TippyState.Timeout:
|
case TippyState.Timeout:
|
||||||
if (this.tippyLogicTimer.ElapsedMilliseconds > 60000) {
|
if (this.tippyLogicTimer.ElapsedMilliseconds > 60000) {
|
||||||
SetNewTip();
|
SetTippyAnim(TippyAnimState.Idle, true);
|
||||||
|
this.tippyText = string.Empty;
|
||||||
|
this.showTippyButton = false;
|
||||||
|
|
||||||
|
this.tippyLogicTimer.Restart();
|
||||||
this.tippyState = TippyState.Tips;
|
this.tippyState = TippyState.Tips;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -332,11 +332,26 @@ namespace Dalamud.Interface
|
||||||
this.inputAddonName, this.inputAddonIndex);
|
this.inputAddonName, this.inputAddonIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui.Button("Find Agent")) {
|
||||||
|
this.findAgentInterfacePtr = FindAgentInterface(this.inputAddonName);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.resultAddon != null) {
|
if (this.resultAddon != null) {
|
||||||
ImGui.TextUnformatted(
|
ImGui.TextUnformatted(
|
||||||
$"{this.resultAddon.Name} - 0x{this.resultAddon.Address.ToInt64():x}\n v:{this.resultAddon.Visible} x:{this.resultAddon.X} y:{this.resultAddon.Y} s:{this.resultAddon.Scale}, w:{this.resultAddon.Width}, h:{this.resultAddon.Height}");
|
$"{this.resultAddon.Name} - 0x{this.resultAddon.Address.ToInt64():x}\n v:{this.resultAddon.Visible} x:{this.resultAddon.X} y:{this.resultAddon.Y} s:{this.resultAddon.Scale}, w:{this.resultAddon.Width}, h:{this.resultAddon.Height}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.findAgentInterfacePtr != IntPtr.Zero) {
|
||||||
|
ImGui.TextUnformatted(
|
||||||
|
$"Agent: 0x{this.findAgentInterfacePtr.ToInt64():x}");
|
||||||
|
ImGui.SameLine();
|
||||||
|
|
||||||
|
if (ImGui.Button("C"))
|
||||||
|
{
|
||||||
|
ImGui.SetClipboardText(this.findAgentInterfacePtr.ToInt64().ToString("x"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ImGui.Button("Get Base UI object")) {
|
if (ImGui.Button("Get Base UI object")) {
|
||||||
var addr = this.dalamud.Framework.Gui.GetBaseUIObject().ToInt64().ToString("x");
|
var addr = this.dalamud.Framework.Gui.GetBaseUIObject().ToInt64().ToString("x");
|
||||||
Log.Information("{0}", addr);
|
Log.Information("{0}", addr);
|
||||||
|
|
@ -409,6 +424,31 @@ namespace Dalamud.Interface
|
||||||
return isOpen;
|
return isOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IntPtr findAgentInterfacePtr;
|
||||||
|
|
||||||
|
private unsafe IntPtr FindAgentInterface(string addonName)
|
||||||
|
{
|
||||||
|
var addon = this.dalamud.Framework.Gui.GetUiObjectByName(addonName, 1);
|
||||||
|
if (addon == IntPtr.Zero) return IntPtr.Zero;
|
||||||
|
SafeMemory.Read<short>(addon + 0x1CE, out var id);
|
||||||
|
|
||||||
|
if (id == 0)
|
||||||
|
_ = SafeMemory.Read(addon + 0x1CC, out id);
|
||||||
|
|
||||||
|
var framework = this.dalamud.Framework.Address.BaseAddress;
|
||||||
|
var uiModule = *(IntPtr*)(framework + 0x29F8);
|
||||||
|
var agentModule = uiModule + 0xC3E78;
|
||||||
|
for (var i = 0; i < 379; i++)
|
||||||
|
{
|
||||||
|
var agent = *(IntPtr*)(agentModule + 0x20 + i * 8);
|
||||||
|
if (agent == IntPtr.Zero)
|
||||||
|
continue;
|
||||||
|
if (*(short*)(agent + 0x20) == id)
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
return IntPtr.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
private void PrintActor(Actor actor, string tag) {
|
private void PrintActor(Actor actor, string tag) {
|
||||||
var actorString =
|
var actorString =
|
||||||
$"{actor.Address.ToInt64():X}:{actor.ActorId:X}[{tag}] - {actor.ObjectKind} - {actor.Name} - X{actor.Position.X} Y{actor.Position.Y} Z{actor.Position.Z} D{actor.YalmDistanceX} R{actor.Rotation} - Target: {actor.TargetActorID:X}\n";
|
$"{actor.Address.ToInt64():X}:{actor.ActorId:X}[{tag}] - {actor.ObjectKind} - {actor.Name} - X{actor.Position.X} Y{actor.Position.Y} Z{actor.Position.Z} D{actor.YalmDistanceX} R{actor.Rotation} - Target: {actor.TargetActorID:X}\n";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue