Quantcast Cannot change menu backdrops beyond level 2 - WoWInterface
Thread Tools Display Modes
03-02-11, 12:10 PM   #1
A Deviate Faerie Dragon
Join Date: Jan 2009
Posts: 19
Cannot change menu backdrops beyond level 2

I'm busy fine tweaking my UI and I noticed earlier that menus beyond level 2 were not styled properly with a black backdrop / border and instead were the default WoW style. I checked the coding of the piece that modifys the menu and levels beyond 2 weren't included so I added them, that did not work, no errors or anything but it wouldn't change the backdrop.

So I made a script to test the menus, which was:

/script DropDownList3MenuBackdrop:SetScript("OnShow", function() ChatFrame1:AddMessage("Test") end)

Which of course will print out "Test" into the chat window when I open a menu that is 3 levels deep. This produced an error saying that the DropDownList3MenuBackdrop was a nil value.

So I reloaded the game in case it was like how you cannot have .toc changes happen until you reload the game, maybe I couldn't fiddle until I reloaded after the coding was changed. Loaded back in, same problem.

However... I then tried running that above script in game after I had already accessed a menu beyond level 2 (in this case TinyDPS) and it worked fine... but I cannot seem to do it from LUA, it just won't allow me to change the backdrops of menus 3+ levels deep until after you open a menu system in game past level 2.

Anyone have any ideas? I'm quite stumped.
  Reply With Quote
03-02-11, 05:12 PM   #2
A Flamescale Wyrmkin
Akkorian's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 111
Probably, the game doesn’t make the frames until they’re needed. Try finding the function that opens new menu levels, and post-hooking it to change the textures on the frame after it’s created. In PhanxChat we do this to add textures to the temporary chat frames the game creates when you send a conversation to a new window:

local hook = FCF_OpenTemporaryWindow
FCF_OpenTemporaryWindow = function(...)
	local frame = hook(...)
	-- Do stuff to the frame here.
	return frame
There’s probably a similar function related to the dropdown menu system you can hook.
“Be humble, for you are made of earth. Be noble, for you are made of stars.”
  Reply With Quote
03-02-11, 06:36 PM   #3
A Deviate Faerie Dragon
Join Date: Jan 2009
Posts: 19
Got it sorted after your advise to look into the function that creates menu levels, and set up a pre-load of the menus for 5 levels deep. Turned out to be so simple in the end I actually feel a bit stupid! Was originally thinking (before you posted) of making a full menu system X levels deep to get the game to load it in, then destroying the menu... thankfully I didn't

Thanks again for the assistance!

lua Code:
  1. for i = 1, 5 do
  2.     UIDropDownMenu_CreateFrames(i, i)
  3. end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Cannot change menu backdrops beyond level 2

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