Skip to content

Commit

Permalink
Fixed an error when dumping nodeInfo for a choice selection node
Browse files Browse the repository at this point in the history
  • Loading branch information
Numynum committed Nov 27, 2022
1 parent 464170d commit 911b5ba
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions modules/debugNodeInfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function Module:GetOptions(defaultOptionsTable, db)
viragDevTool = true,
luaBrowser = true,
slashDump = false,
addButtonToTable = true,
}
self.db = db;
for k, v in pairs(defaultDb) do
Expand All @@ -48,6 +49,14 @@ function Module:GetOptions(defaultOptionsTable, db)
name = 'You can toggle any of the following on/off to enable/disable the integration with that debug tool.',
order = increment(),
};
defaultOptionsTable.args.addButtonToTable = {
type = 'toggle',
name = 'Add the button to NodeInfo table when dumped',
desc = 'Adds a _button property to the nodeInfo table, which is a reference to the talent button.',
get = get,
set = set,
order = increment(),
};
defaultOptionsTable.args.tinspect = {
type = 'toggle',
name = '/tinspect',
Expand Down Expand Up @@ -90,15 +99,19 @@ function Module:OnButtonClick(buttonFrame, mouseButton)
if mouseButton ~= 'LeftButton' or not IsControlKeyDown() then
return;
end
local nodeInfo = buttonFrame.nodeInfo
local nodeInfo = buttonFrame.nodeInfo or buttonFrame.GetNodeInfo and buttonFrame:GetNodeInfo() or {};
if self.db.addButtonToTable then
nodeInfo = Mixin({}, nodeInfo);
nodeInfo._button = buttonFrame;
end

if self.db.tinspect then
UIParentLoadAddOn("Blizzard_DebugTools");
DisplayTableInspectorWindow(nodeInfo);
end

if self.db.viragDevTool and ViragDevTool_AddData then
ViragDevTool_AddData(nodeInfo, 'NodeInfo ID ' .. nodeInfo.ID);
ViragDevTool_AddData(nodeInfo, 'NodeInfo ID ' .. (nodeInfo.ID or 'nil'));
end

if self.db.luaBrowser and SlashCmdList.LuaBrowser then
Expand Down

0 comments on commit 911b5ba

Please sign in to comment.