From the taint.log file:
1/27 19:11:04.015 Global variable SHOW_TARGET_OF_TARGET_STATE tainted by MyTest2 - Interface\FrameXML\UIOptionsFrame.lua:436 UIOptionsFrame_Save()
1/27 19:11:04.015 UIOptionsFrameOkay:OnClick()
1/27 19:11:04.015 Execution tainted by MyTest2 while reading SHOW_TARGET_OF_TARGET_STATE - Interface\FrameXML\TargetFrame.lua:646 TargetofTarget_Update()
1/27 19:11:04.015 Interface\FrameXML\TargetFrame.lua:265 TargetFrame_OnUpdate()
1/27 19:11:04.015 TargetFrame:OnUpdate()
1/27 19:11:04.015 An action was blocked in combat because of taint from MyTest2 - TargetofTargetFrame:Show()
1/27 19:11:04.015 Interface\FrameXML\TargetFrame.lua:657 TargetofTarget_Update()
1/27 19:11:04.015 Interface\FrameXML\TargetFrame.lua:265 TargetFrame_OnUpdate()
1/27 19:11:04.015 TargetFrame:OnUpdate()
The problem:
If you create a UIDropDownMenu containing more menu items than the number of menu item buttons that the game has already created, it can cause taint which can prevent the default target of target frame from showing.
Test conditions:
- In the game's Advanced Interface options, "Show target of target" is checked and set to "Always".
- All addons disabled except for this one (MyTest2).
Steps to reproduce the problem:
- Log in or reload the UI.
- Press ESC to open the game menu.
- Click the "Interface" button.
- Click the "Okay" button.
- Click the "Return to game" button.
- Attack a mob.
- The target frame appears, but the target of target frame does not.
- An "Interface action failed because of an AddOn" message appears in the chat window.
The MyTest2.toc file:
## Title: MyTest2
## Interface: 20300
## DefaultState: enabled
MyTest2.lua
The MyTest2.lua file:
function MyTest2_DropDown_InitButtons()
DEFAULT_CHAT_FRAME:AddMessage("UIDROPDOWNMENU_MAXBUTTONS = " .. UIDROPDOWNMENU_MAXBUTTONS);
-- Create one more menu button than the current maximum.
local num = UIDROPDOWNMENU_MAXBUTTONS + 1;
local info;
for i = 1, num do
info = UIDropDownMenu_CreateInfo();
info.text = "Menu item" .. i;
UIDropDownMenu_AddButton(info);
end
end
function MyTest2_Init()
CreateFrame("Frame", "MyTest2", UIParent);
CreateFrame("Frame", "MyTest2_DropDown", MyTest2, "UIDropDownMenuTemplate");
UIDropDownMenu_Initialize(MyTest2_DropDown, MyTest2_DropDown_InitButtons, "MENU");
end
MyTest2_Init();