Reply
 
Thread Tools Display Modes
Old 05-09-13, 04:11 PM   #1
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 529
Another dropdown taint

"xyz" tried to call the protected function "JoinBattlefield()".
!BugGrabber-r191-release\BugGrabber.lua:587: in function <!BugGrabber\BugGrabber.lua:587>
<in C code>
Blizzard_PVPUI\Blizzard_PVPUI-1.0.lua:475: in function "HonorFrame_Queue"
<string>:"*:OnClick":2: in function <string>:"*:OnClick":1

Locals:
nil

Pops up when i try to queue into a battleground, after i use a dropdown menu from my addon.
The weird part i have another addon with pretty much the same dropdown menu functions and code, and it doesn't causes the taint.
Anyone else run into this problem, and might know a solution for it?
Resike is online now   Reply With Quote
Old 05-09-13, 04:17 PM   #2
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 529
Okay probably found a temporary solution:

Make a copy of "UIDropDownMenuTemplate" frame from the "UIDropDownMenuTemplates.xml", rename it and use that as a template. Need a game restart for it to work.

Edit: JK it's not working, it's total random.

Last edited by Resike : 05-09-13 at 04:22 PM.
Resike is online now   Reply With Quote
Old 05-09-13, 06:03 PM   #3
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 3,983
The battleground queue functions are all super-protected to avoid the apparently earthshattering horrors of automated queuing addons. You're probably leaking a global, or touching something somewhere else in your code. But, without seeing your code it's impossible to say.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addon Turn any code into an addon More addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please dont PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Old 05-09-13, 07:33 PM   #4
semlar
A Firelord
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 470
Any modification to the LFG/battleground icon's context menu on the minimap (or any menu with JoinBattlefield) will cause this.

Last edited by semlar : 05-09-13 at 07:36 PM.
semlar is offline   Reply With Quote
Old 05-10-13, 01:19 AM   #5
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 3,983
Even opening the menu any way other than by clicking on the default minimap button breaks those menu entries; this is why Broker_LFG users can't leave battleground queues -- Blizzard in their infinite wisdom decided that the only way to leave battleground queues should be through an insanely fragile menu attached to an ugly and inconveniently located minimap herpes.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addon Turn any code into an addon More addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please dont PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Old 05-10-13, 04:03 AM   #6
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 529
I has some globals in the code but 95% is savedvariables. That could cause the problem too?
The reason for the globals because of the xml code based options.

Code:
-- Dropdown Menus
function PowaAuras.DropDownMenu_Initialize(owner)
	local info;
	local aura = PowaAuras.Auras[PowaAuras.CurrentAuraId];
	local name = owner:GetName();
	if (aura == nil) then
		aura = PowaAuras:AuraFactory(PowaAuras.BuffTypes.Buff, 0);
	end
	if (name == "PowaStrataDropDown") then
		UIDropDownMenu_SetWidth(owner, 125)
		for i = 1, #PowaAuras.StrataList do
			local info = UIDropDownMenu_CreateInfo();
			info.text = PowaAuras.StrataList[i];
			info.func = function(self)
				local strata = PowaAuras.StrataList[i];
				local AuraID = PowaAuras.CurrentAuraId;
				if PowaAuras.CurrentAuraId > 120 then
					PowaGlobalSet[AuraID]["strata"] = strata;
				end
				PowaSet[AuraID]["strata"] = strata
				UIDropDownMenu_SetSelectedName(PowaStrataDropDown, strata);
				PowaAuras:RedisplayAura(PowaAuras.CurrentAuraId);
			end
			UIDropDownMenu_AddButton(info);
		end
	elseif (name == "PowaTextureStrataDropDown") then
		UIDropDownMenu_SetWidth(owner, 125)
		for i = 1, #PowaAuras.TextureStrataList do
			local info = UIDropDownMenu_CreateInfo();
			info.text = PowaAuras.TextureStrataList[i];
			info.func = function(self)
				local texturestrata = PowaAuras.TextureStrataList[i];
				local AuraID = PowaAuras.CurrentAuraId;
				if PowaAuras.CurrentAuraId > 120 then
					PowaGlobalSet[AuraID]["texturestrata"] = texturestrata;
				end
				PowaSet[AuraID]["texturestrata"] = texturestrata
				UIDropDownMenu_SetSelectedName(PowaTextureStrataDropDown, texturestrata);
				PowaAuras:RedisplayAura(PowaAuras.CurrentAuraId);
			end
			UIDropDownMenu_AddButton(info);
		end
	elseif (name == "PowaBlendModeDropDown") then
		UIDropDownMenu_SetWidth(owner, 125)
		for i = 1, #PowaAuras.BlendModeList do
			local info = UIDropDownMenu_CreateInfo();
			info.text = PowaAuras.BlendModeList[i];
			info.func = function(self)
				local blendmode = PowaAuras.BlendModeList[i];
				local AuraID = PowaAuras.CurrentAuraId;
				if PowaAuras.CurrentAuraId > 120 then
					PowaGlobalSet[AuraID]["blendmode"] = blendmode;
				end
				PowaSet[AuraID]["blendmode"] = blendmode
				UIDropDownMenu_SetSelectedName(PowaBlendModeDropDown, blendmode);
				PowaAuras:RedisplayAura(PowaAuras.CurrentAuraId);
			end
			UIDropDownMenu_AddButton(info);
		end
	elseif (name == "PowaGradientStyleDropDown") then
		UIDropDownMenu_SetWidth(owner, 120)
		for i = 1, #PowaAuras.GradientStyleList do
			local info = UIDropDownMenu_CreateInfo();
			info.text = PowaAuras.GradientStyleList[i];
			info.func = function(self)
				local gradientstyle = PowaAuras.GradientStyleList[i];
				local AuraID = PowaAuras.CurrentAuraId;
				if PowaAuras.CurrentAuraId > 120 then
					PowaGlobalSet[AuraID]["gradientstyle"] = gradientstyle;
				end
				PowaSet[AuraID]["gradientstyle"] = gradientstyle
				UIDropDownMenu_SetSelectedName(PowaGradientStyleDropDown, gradientstyle);
				PowaAuras:RedisplayAura(PowaAuras.CurrentAuraId);
			end
			UIDropDownMenu_AddButton(info);
		end
	elseif (name == "PowaDropDownBuffType") then
		UIDropDownMenu_SetWidth(owner, 175)
		PowaAuras:FillDropdownSorted(PowaAuras.Text.AuraType, {func = PowaAuras.DropDownMenu_OnClickBuffType, owner = owner});
		UIDropDownMenu_SetSelectedValue(PowaDropDownBuffType, aura.bufftype);
	elseif (name == "PowaDropDownPowerType") then
		UIDropDownMenu_SetWidth(owner, 145)
		info = {func = PowaAuras.DropDownMenu_OnClickPowerType, owner = owner};
		for i, name in pairs(PowaAuras.Text.PowerType) do
			info.text = name;
			info.value = i;
			UIDropDownMenu_AddButton(info);
		end
		UIDropDownMenu_SetSelectedValue(PowaDropDownPowerType, aura.PowerType);
	elseif (name == "PowaDropDownStance") then
		UIDropDownMenu_SetWidth(owner, 145)
		info = {func = PowaAuras.DropDownMenu_OnClickStance, owner = owner};
		for k, v in pairs(PowaAuras.PowaStance) do
			info.text = v;
			info.value = k;
			UIDropDownMenu_AddButton(info);
		end
		UIDropDownMenu_SetSelectedValue(PowaDropDownStance, aura.stance);
	elseif (name == "PowaDropDownGTFO") then
		UIDropDownMenu_SetWidth(owner, 145)
		info = {func = PowaAuras.DropDownMenu_OnClickGTFO, owner = owner};
		for i = 0, #(PowaAuras.PowaGTFO) do
			info.text = PowaAuras.PowaGTFO[i];
			info.value = i;
			UIDropDownMenu_AddButton(info);
		end
		UIDropDownMenu_SetSelectedValue(PowaDropDownGTFO, aura.GTFO);
	elseif (name == "PowaDropDownAnimBegin") then
		UIDropDownMenu_SetWidth(owner, 190)
		info = {func = PowaAuras.DropDownMenu_OnClickBegin, owner = owner};
		for i = 0, #PowaAuras.BeginAnimDisplay do
			info.text = PowaAuras.BeginAnimDisplay[i];
			info.value = i;
			UIDropDownMenu_AddButton(info);
		end
		UIDropDownMenu_SetSelectedValue(PowaDropDownAnimBegin, aura.begin);
	elseif (name == "PowaDropDownAnimEnd") then
		UIDropDownMenu_SetWidth(owner, 190)
		info = {func = PowaAuras.DropDownMenu_OnClickEnd, owner = owner};
		local aura = PowaAuras.Auras[PowaAuras.CurrentAuraId];
		if aura ~= nil then
			if aura.UseOldAnimations == false then
				for i = 0, #PowaAuras.EndAnimDisplay do
					info.text = PowaAuras.EndAnimDisplay[i];
					info.value = i;
					UIDropDownMenu_AddButton(info);
				end
			else
				for i = 0, #PowaAuras.EndAnimDisplay - 2  do
					info.text = PowaAuras.EndAnimDisplay[i];
					info.value = i;
					UIDropDownMenu_AddButton(info);
				end
			end
			UIDropDownMenu_SetSelectedValue(PowaDropDownAnimEnd, aura.finish);
		else
			for i = 0, #PowaAuras.EndAnimDisplay - 2  do
				info.text = PowaAuras.EndAnimDisplay[i];
				info.value = i;
				UIDropDownMenu_AddButton(info);
			end
			UIDropDownMenu_SetSelectedID(PowaDropDownAnimEnd, 1);
		end
	elseif (name == "PowaDropDownAnim1") then
		UIDropDownMenu_SetWidth(owner, 190)
		local aura = PowaAuras.Auras[PowaAuras.CurrentAuraId];
		if aura ~= nil then
			if aura.UseOldAnimations == false then
				for i = 1, #(PowaAuras.Anim) do
					info = { };
					info.text = PowaAuras.Anim[i];
					info.value = i;
					info.func = PowaAuras.DropDownMenu_OnClickAnim1;
					UIDropDownMenu_AddButton(info);
				end
			else
				for i = 1, #(PowaAuras.Anim) - 2 do
					info = { };
					info.text = PowaAuras.Anim[i];
					info.value = i;
					info.func = PowaAuras.DropDownMenu_OnClickAnim1;
					UIDropDownMenu_AddButton(info);
				end
			end
			UIDropDownMenu_SetSelectedValue(PowaDropDownAnim1, aura.anim1);
		else
			for i = 1, #(PowaAuras.Anim) - 2 do
				info = { };
				info.text = PowaAuras.Anim[i];
				info.value = i;
				info.func = PowaAuras.DropDownMenu_OnClickAnim1;
				UIDropDownMenu_AddButton(info);
			end
			UIDropDownMenu_SetSelectedID(PowaDropDownAnim1, 1);
		end
	elseif (name == "PowaDropDownAnim2") then
		UIDropDownMenu_SetWidth(owner, 190)
		local aura = PowaAuras.Auras[PowaAuras.CurrentAuraId];
		if aura ~= nil then
			if aura.UseOldAnimations == false then
				for i = 0, #(PowaAuras.Anim) do
					info = { };
					info.text = PowaAuras.Anim[i];
					info.value = i;
					info.func = PowaAuras.DropDownMenu_OnClickAnim2;
					UIDropDownMenu_AddButton(info);
				end
			else
				for i = 0, #(PowaAuras.Anim) - 2 do
					info = { };
					info.text = PowaAuras.Anim[i];
					info.value = i;
					info.func = PowaAuras.DropDownMenu_OnClickAnim2;
					UIDropDownMenu_AddButton(info);
				end
			end
			UIDropDownMenu_SetSelectedValue(PowaDropDownAnim2, aura.anim2);
		else
			for i = 0, #(PowaAuras.Anim) - 2 do
				info = { };
				info.text = PowaAuras.Anim[i];
				info.value = i;
				info.func = PowaAuras.DropDownMenu_OnClickAnim2;
				UIDropDownMenu_AddButton(info);
			end
			UIDropDownMenu_SetSelectedID(PowaDropDownAnim2, 1);
		end
	elseif (name == "PowaDropDownSound") then
		UIDropDownMenu_SetWidth(owner, 210)
		info = {func = PowaAuras.DropDownMenu_OnClickSound, owner = owner};
		for i = 0, 29 do
			if (PowaAuras.Sound[i]) then
				info.text = PowaAuras.Sound[i];
				info.value = i;
				UIDropDownMenu_AddButton(info);
			end
		end
		if (aura.sound < 30) then
			UIDropDownMenu_SetSelectedValue(PowaDropDownSound, aura.sound);
		else
			UIDropDownMenu_SetSelectedValue(PowaDropDownSound, 0);
		end
	elseif (name == "PowaDropDownSound2") then
		UIDropDownMenu_SetWidth(owner, 210)
		info = {func = PowaAuras.DropDownMenu_OnClickSound, owner = owner};
		for i = 30, #PowaAuras.Sound do
			if (PowaAuras.Sound[i]) then
				info.text = PowaAuras.Sound[i];
				info.value = i;
				UIDropDownMenu_AddButton(info);
			end
		end
		if (aura.sound >= 30) then
			UIDropDownMenu_SetSelectedValue(PowaDropDownSound2, aura.sound);
		else
			UIDropDownMenu_SetSelectedValue(PowaDropDownSound2, 30);
		end
	elseif (name == "PowaDropDownSoundEnd") then
		UIDropDownMenu_SetWidth(owner, 210)
		info = {func = PowaAuras.DropDownMenu_OnClickSoundEnd, owner = owner};
		for i = 0, 29 do
			if (PowaAuras.Sound[i]) then
				info.text = PowaAuras.Sound[i];
				info.value = i;
				UIDropDownMenu_AddButton(info);
			end
		end
		if (aura.soundend < 30) then
			UIDropDownMenu_SetSelectedValue(PowaDropDownSoundEnd, aura.soundend);
		else
			UIDropDownMenu_SetSelectedValue(PowaDropDownSoundEnd, 0);
		end
	elseif (name == "PowaDropDownSound2End") then
		UIDropDownMenu_SetWidth(owner, 210)
		info = {func = PowaAuras.DropDownMenu_OnClickSoundEnd, owner = owner};
		for i = 30, #PowaAuras.Sound do
			if (PowaAuras.Sound[i]) then
				info.text = PowaAuras.Sound[i];
				info.value = i;
				UIDropDownMenu_AddButton(info);
			end
		end
		if (aura.soundend >= 30) then
			UIDropDownMenu_SetSelectedValue(PowaDropDownSound2End, aura.soundend);
		else
			UIDropDownMenu_SetSelectedValue(PowaDropDownSound2End, 30);
		end
	elseif (name == "PowaBuffTimerRelative") then
		UIDropDownMenu_SetWidth(owner, 190)
		info = {func = PowaAuras.DropDownMenu_OnClickTimerRelative, owner = owner};
		for _, v in pairs({"NONE", "TOPLEFT", "TOP", "TOPRIGHT", "RIGHT", "BOTTOMRIGHT", "BOTTOM", "BOTTOMLEFT", "LEFT", "CENTER"}) do
			info.text = PowaAuras.Text.Relative[v];
			info.value = v;
			UIDropDownMenu_AddButton(info);
		end
		if (aura.Timer) then
			UIDropDownMenu_SetSelectedValue(PowaBuffTimerRelative, aura.Timer.Relative);
		end
	elseif (name == "PowaBuffStacksRelative") then
		UIDropDownMenu_SetWidth(owner, 190)
		info = {func = PowaAuras.DropDownMenu_OnClickStacksRelative, owner = owner};
		for _, v in pairs({"NONE", "TOPLEFT", "TOP", "TOPRIGHT", "RIGHT", "BOTTOMRIGHT", "BOTTOM", "BOTTOMLEFT", "LEFT", "TOPLEFT", "CENTER"}) do
			info.text = PowaAuras.Text.Relative[v];
			info.value = v;
			UIDropDownMenu_AddButton(info);
		end
		if (aura.Stacks) then
			UIDropDownMenu_SetSelectedValue(PowaBuffStacksRelative, aura.Stacks.Relative);
		end
	end
end

function PowaAuras:FillDropdownSorted(t, info)
	local names = PowaAuras:CopyTable(t);
	local values = PowaAuras:ReverseTable(names);
	table.sort(names);
	--for k,v in ipairs(names) do PowaAuras:Message(k, " ", v, " ", auraReverse[v]) end
	for _, name in pairs(names) do
		info.text = name;
		info.value = values[name];
		UIDropDownMenu_AddButton(info);
	end
end

Last edited by Resike : 05-10-13 at 04:15 AM.
Resike is online now   Reply With Quote
Old 05-16-13, 10:29 PM   #7
gmarco
Premium Member
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 97
Originally Posted by Phanx View Post
Even opening the menu any way other than by clicking on the default minimap button breaks those menu entries; this is why Broker_LFG users can't leave battleground queues -- Blizzard in their infinite wisdom decided that the only way to leave battleground queues should be through an insanely fragile menu attached to an ugly and inconveniently located minimap herpes.
I can't agree more on this ...
This iussue is really a mess :-)
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
gmarco is offline   Reply With Quote
Old 05-18-13, 06:09 PM   #8
Lombra
A Chromatic Dragonspawn
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 176
Maybe this sheds some light on the issue:
http://forums.wowace.com/showthread.php?t=20536
__________________
Grab your sword and fight the Horde!
Lombra is offline   Reply With Quote
Old 05-19-13, 03:18 PM   #9
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 529
Originally Posted by Lombra View Post
Maybe this sheds some light on the issue:
http://forums.wowace.com/showthread.php?t=20536
I dont have any "Menu" type dropdowns taint still happens. It's totally random sometimes i cant trigger a taint even if i want to, sometimes i just open a 1 dropdown, then try to queue and bang taint happens.

Even if i don't have any displayMode assigned i shoul nil it then?

I also wanted to track down this bug, i think it something related with the "UIDropDownMenu_SetSelectedName" or "UIDropDownMenu_SetSelectedvalue" or pretty much any other global function which selects the value onclick. Since i don't use this functions in one of my addon, and i can't trigger a taint with it. Not sure about it tho.

Last edited by Resike : 05-19-13 at 03:23 PM.
Resike is online now   Reply With Quote
Old 05-19-13, 06:11 PM   #10
Lombra
A Chromatic Dragonspawn
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 176
Right, ok. Some investigation shows that assigning a value to dropdown.selectedValue (which is done in UIDropDownMenu_SetSelectedValue) in the dropdown menu func will taint JoinBattlefield, too. I really hope they can can do something about this [soon].

displayMode should be nil if you have not set it, so there should be no need to do anything with it.
__________________
Grab your sword and fight the Horde!
Lombra is offline   Reply With Quote
Old 05-20-13, 12:44 AM   #11
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 529
Originally Posted by Lombra View Post
Right, ok. Some investigation shows that assigning a value to dropdown.selectedValue (which is done in UIDropDownMenu_SetSelectedValue) in the dropdown menu func will taint JoinBattlefield, too. I really hope they can can do something about this [soon].

displayMode should be nil if you have not set it, so there should be no need to do anything with it.
I have a fix for the whole stuff, just need to handle the dropdown menus in a bit different way. But first i'm gonna wait untill 5.3 and see if it gonna fix it or not.

You can skip using "UIDropDownMenu_SetSelected..." by checking the info and setting the text by yourself like this:

Code:
function ADDON.OptionsDropDownMenuInitialize(self)
	local info = UIDropDownMenu_CreateInfo()
	local name = self:GetName()
	if name == "ADDONDropDown" then
		info.text = "Something"
		if VARIABLE == "SOMETHING" then
			info.checked = true
		else
			info.checked = false
		end
		info.func = function(self)
			VARIABLE = "SOMETHING"
			UIDropDownMenu_SetText(ADDONDropDown, "SOMETHING")
		end
		UIDropDownMenu_AddButton(info)
	end
end
Not the best method, but it's working. It's actually doesn't check the dropdown when you click on it, only in the next time when you open then menu.

Last edited by Resike : 05-20-13 at 12:59 AM.
Resike is online now   Reply With Quote
Old 05-27-13, 05:32 AM   #12
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 529
Seems like blizzard fixed this, not sure tho, anyone can confirm?

EDIT: Nah it's not fixed.
UIDropDownMenu_SetSelectedName, UIDropDownMenu_SetSelectedID and UIDropDownMenu_SetSelectedValue still taints the bg queues.

Last edited by Resike : 05-27-13 at 07:32 AM.
Resike is online now   Reply With Quote
Old 11-03-13, 08:03 AM   #13
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 529
Any update on this? Along with the damn slidervalue bug this is driving me crazy.
Resike is online now   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Lua/XML Help » Another dropdown taint

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