Thread Tools Display Modes
12-18-21, 11:21 AM   #1
maqjav
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 60
Fixing taint issues

Hello.

In my addon I was hooking several options to the ingame worldmap dropDownMenu and of course, this was producing taint issues. So, in order to solve them I have done the next changes:
1. No more hooking options in the worldmap DropDownMenu.
2. Replace the widget UIDropDownMenu everywhere and instead use LibUIDropDownMenu.

After all these changes the addon works perfectly and I don't get more errors.

Now I'm trying to readd my addons options to the worldmap, but this time in a separated button. I'm using Krowi_WorldMapButtons-1.0 to do it, and again, this produces taint issues:
Code:
12/18 18:33:32.446  Execution tainted by RareScanner while reading UIDROPDOWNMENU_MENU_LEVEL - Interface\SharedXML\UIDropDownMenu.lua:858 UIDropDownMenu_GetSelectedID()
12/18 18:33:32.446      Interface\SharedXML\UIDropDownMenu.lua:533 UIDropDownMenu_AddButton()
12/18 18:33:32.446      Interface\AddOns\Blizzard_WorldMap\Blizzard_WorldMapTemplates.lua:221 <unnamed>:InitializeDropDown()
12/18 18:33:32.446      Interface\AddOns\Blizzard_WorldMap\Blizzard_WorldMapTemplates.lua:50 initFunction()
12/18 18:33:32.446      Interface\SharedXML\UIDropDownMenu.lua:78 UIDropDownMenu_Initialize()
12/18 18:33:32.446      Interface\SharedXML\UIDropDownMenu.lua:1069 ToggleDropDownMenu()
12/18 18:33:32.446      Interface\AddOns\Blizzard_WorldMap\Blizzard_WorldMapTemplates.lua:65
12/18 18:33:35.024  Execution tainted by RareScanner while reading UIDROPDOWNMENU_MENU_LEVEL - Interface\SharedXML\UIDropDownMenu.lua:715 UIDropDownMenu_Refresh()
12/18 18:33:35.024      Interface\SharedXML\UIDropDownMenu.lua:837 UIDropDownMenu_SetSelectedValue()
12/18 18:33:35.024      Interface\FrameXML\LFGList.lua:1009 LFGListEntryCreation_OnPlayStyleSelected()
12/18 18:33:35.024      Interface\FrameXML\LFGList.lua:647 LFGListEntryCreation_Show()
12/18 18:33:35.024      Interface\FrameXML\LFGList.lua:2057
The error is very easy to reproduce following this steps:
1. Open the worldmap in a city and navigate to a map outside (in my example I'm in the Kyrian covenant house, and I'm changing the map to Bastion)
2. Click on the dropDownMenu in the worldmap (I haven't changed it, so now it shows the original options).
3. In the quest list, try to create a group in an elite world quest (clicking the green eye icon beside the quest)
4. Error

I have noticed that in the cities, the options displayed in the dropDownMenu are less than outside, so it seems that the error is caused when the list changes.

The new library adds the button using the method:
Code:
WorldMapFrame:AddOverlayFrame
I guess that the problem is here, but I don't know how to solve it.

Ideas?

Last edited by maqjav : 12-18-21 at 11:39 AM.
  Reply With Quote
12-18-21, 12:10 PM   #2
maqjav
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 60
Ok so I found the problem and the solution.

The method:
Code:
WorldMapFrame:AddOverlayFrame
Internally adds to a table the new frame:
Code:
tinsert(self.overlayFrames, frame);
The WorldMapFrame has the method:
Code:
WorldMapMixin:RefreshOverlayFrames()
That invokes the method "Refresh" of every overlayFrame in the table "overlayFrames". This is what is causing the error.

The solution is as simple as stop using "WorldMapFrame:AddOverlayFrame" and instead add the frame manually:
Code:
local frame = CreateFrame("FRAME", nil, WorldMapFrame, "MyTemplateName");
frame:SetPoint("TOPRIGHT", WorldMapFrame:GetCanvasContainer(), "TOPRIGHT", -xOffset, -2);
frame.relativeFrame = WorldMapFrame:GetCanvasContainer() --This might not be necessary

Last edited by maqjav : 12-19-21 at 04:47 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Fixing taint issues

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off