Thread Tools Display Modes
05-09-13, 04:11 PM   #1
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
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?
  Reply With Quote
05-09-13, 04:17 PM   #2
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
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.
  Reply With Quote
05-09-13, 06:03 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-09-13, 07:33 PM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
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.
  Reply With Quote
05-10-13, 01:19 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-10-13, 04:03 AM   #6
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
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.
  Reply With Quote
05-16-13, 10:29 PM   #7
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Another dropdown taint


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