Skip to content

Commit 8ea0585

Browse files
committed
Exposed a global function TTT_InspectTalents, which allows for macros like /run TTT_InspectTalents("party1")
1 parent 714b707 commit 8ea0585

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

modules/exportInspectedBuild.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ local LEVEL_CAP = 80;
1010
--- @class TalentTreeTweaks_ExportInspectedBuild: AceModule, AceHook-3.0, AceEvent-3.0
1111
local Module = Main:NewModule('ExportInspectedBuild', 'AceHook-3.0', 'AceEvent-3.0');
1212

13+
--- @param unit string
14+
function TTT_InspectTalents(unit)
15+
Module.inspecting[UnitGUID(unit)] = { unit = unit, name = UnitNameUnmodified(unit) };
16+
NotifyInspect(unit);
17+
end
18+
19+
local TTT_InspectTalents = TTT_InspectTalents;
20+
1321
--- @type table<string, { unit: string, name: string }> # [guid] = info
1422
Module.inspecting = {};
1523
Module.overlayPool = {
@@ -141,9 +149,8 @@ function Module:OnUnitPopupMenu(rootDescription, contextData)
141149
rootDescription:Insert(MenuUtil.CreateButton(L['Inspect Talents'], function()
142150
local unit = contextData.unit;
143151
if not unit then return; end
144-
local guid = contextData.playerLocation and contextData.playerLocation:GetGUID();
145-
self.inspecting[guid] = { unit = unit, name = UnitNameUnmodified(unit) };
146-
NotifyInspect(unit);
152+
153+
TTT_InspectTalents(unit);
147154
end), i + 1);
148155

149156
break;

0 commit comments

Comments
 (0)