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
05-18-13, 06:09 PM   #8
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Maybe this sheds some light on the issue:
http://forums.wowace.com/showthread.php?t=20536
__________________
Grab your sword and fight the Horde!
  Reply With Quote
05-19-13, 03:18 PM   #9
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
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.
  Reply With Quote
05-19-13, 06:11 PM   #10
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
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!
  Reply With Quote
05-20-13, 12:44 AM   #11
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
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.
  Reply With Quote
05-27-13, 05:32 AM   #12
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
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.
  Reply With Quote
11-03-13, 09:03 AM   #13
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Any update on this? Along with the damn slidervalue bug this is driving me crazy.
  Reply With Quote
09-12-14, 10:06 PM   #14
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Did you ever solved this problem?

I'm having a simliar problem with using dropdowns within my config window. Every time I'm casting Shadowfiend as a priest a taint error is thrown.

I was able to hunt it down to the dropdowns. My guess is, it has something to do with the the context menue of the Shadowfiend unit frame that uses the dropdown feature and will be set up on the fly if the Shadowfiend exists for the first time.

But I have no clue how to work around this. :/

Last edited by Duugu : 09-12-14 at 10:19 PM.
  Reply With Quote
09-13-14, 12:15 AM   #15
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Just create custom dropdowns, you can use their template and system as a base if you'd like, not that hard to counter.
  Reply With Quote
09-13-14, 01:36 AM   #16
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
https://github.com/Phanx/PhanxConfig...ngDropdown.lua

It even scrolls long lists, and unlike Ace3 scrolling dropdowns, auto-scrolls the selected entry into view. Feel free to use it as a base, or just use it, though it's not officially "released" so I'd recommend renaming yours so my arbitrary API changes don't break your addon.
__________________
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
09-13-14, 09:58 AM   #17
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Thanks to both of you. I've just tried to create my own copy of UIDropDown and it's absolutly simple.

Scary cat: I'll definitly switch to your dropdown replacement at some point in the future as I'm extremly unhappy with the overburdened and over-complicated Blizzard dropdown implementation for a long time.
Unfortunately I can't afford the time to customize my existing code right now. :/

For everyone who has taint issues with dropdown and stumbles upon this thread:
Copy UIDropDownMenuTemplates.xml, UIDropDownMenu.xml, and UIDropDownMenu.lua from the Blizzard UI and load them with your addon.
Then use a text editor to rename every occurence of "DropDown" to "DropDownNoTaint" within all 3 files and within you existing code that uses dropdowns.
And last but not least in UIDropDownMenuTemplates.xml rename "UI-DropDownNoTaintRadioChecks" back to "UI-DropDownRadioChecks"
That's all. Takes 1 minute and eliminates all dropdown taint problems.

Last edited by Duugu : 09-13-14 at 10:21 AM.
  Reply With Quote
09-14-14, 11:02 PM   #18
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Duugu View Post
Scary cat: I'll definitly switch to your dropdown replacement at some point in the future as I'm extremly unhappy with the overburdened and over-complicated Blizzard dropdown implementation for a long time.
Unfortunately I can't afford the time to customize my existing code right now. :/
If you need an example of it in use with a simple list of values, see Diplomancer. It also supports some of the EasyMenu spec (info tables with name, value, selected, disabled; see Hydra/Core.lua for an example of that) and if there's interest in other properties I may add support for them in the future. I don't plan to support nested menus, though, as configuration dropdowns should not have those.

It's also easy to use it to show SharedMedia stuff with previews; see oUF_Phanx for fonts and statusbars, or ShieldsUp for sounds. None of my addons with background or border selections though, so if you want previews for those you'll have to figure out how to do it yourself.
__________________
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
09-17-14, 07:33 AM   #19
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by p3lim View Post
Just create custom dropdowns, you can use their template and system as a base if you'd like, not that hard to counter.
This already happened with the template, since the template calls the functions which cause the taints.

If you rename the global functions, or use this lib, then you can use these custom templates taint free:

http://www.wowinterface.com/download...pDownMenu.html

Last edited by Resike : 09-17-14 at 07:35 AM.
  Reply With Quote
10-21-14, 08:35 AM   #20
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
I'm now using your lib. Thanks again.

Feedback:
Don't know if you care, but if you provide a "name" arg I would expect that it is used.

Code:
function lib:New(parent, name, tooltipText, items, keepShownOnClick, pOnClickFunc)
<...>
	local dropdown = CreateFrame("Frame", name, parent)
instead of

Code:
function lib:New(parent, name, tooltipText, items, keepShownOnClick, pOnClickFunc)
<...>
	local dropdown = CreateFrame("Frame", nil, parent)

[e]
I would consider a dropdown list that closes if the mouse is leaving it as more useful:

Lua Code:
  1. local list = CreateFrame("Button", "PhanxConfigScrollingDropdown" .. id, dropdown)
  2. list:SetScript("OnLeave", function(self)
  3.     if (GetMouseFocus():GetParent():GetName() ~= self:GetName()) == true then
  4.         CloseDropDownMenus()
  5.     end
  6. end)

Oh, and disabled list buttons are still clickable. But I guess this is intentionally, right?


Originally Posted by Phanx View Post
https://github.com/Phanx/PhanxConfig...ngDropdown.lua

It even scrolls long lists, and unlike Ace3 scrolling dropdowns, auto-scrolls the selected entry into view. Feel free to use it as a base, or just use it, though it's not officially "released" so I'd recommend renaming yours so my arbitrary API changes don't break your addon.

Last edited by Duugu : 10-21-14 at 10:39 AM.
  Reply With Quote

WoWInterface » 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