Thread Tools Display Modes
03-29-06, 08:26 PM   #1
robodude666
A Cyclonian
 
robodude666's Avatar
Join Date: Mar 2006
Posts: 42
Few UIDropDownMenu Questions

Hello,

I am working on a mod (yay! First mod ) and I am using a Dropdownmenu for it. I was scanning the UIDropDownMenu.lua file and I came up with a few questions.

First, What is the difference between info.value and info.arg1/arg2... As I understand arg1/2 is the arguments given to the func of info.func but info.value is the value set to UIDROPDOWNMENU_MENU_VALUE but thats the same, and BETTER than arg1 because you can have
info.func =myFunc;
info.value = {large table of stuff};

and in myFunc you can just use this.value[#] to get the info from the values... so like whats the real difference? if there is one???

Second, Is there a way to make a var be set to something when you put your mouse over a button that hasArrow? I noticed in the template file theres a button for the arrow which has code that controls the next level. Is there a way to make it work without having to copy and edit 95% of the dropdownmenu UI? Could I maybe have a frame (or button) that inherits the arrow and I add something to it? Again, I want a var to be set to something when you mouseover a button with an arrow. For example, lets say you have this menu:
Let > be a arrow.

Title
button1
button2
--------
button3
button4 >
button5>

If you put your mouse over button 4, MyCoolVar will be set to 4. If you mouseover button 5, MyCoolVar will be set to 5.

Third, what are the start/stop counting functions for? I looked at a lot of examples but couldn't figure it out.

Thank you,
robodude666
__________________
What do you mean there is no cow level?!
  Reply With Quote
04-13-06, 11:09 AM   #2
Esamynn
Featured Artist
Premium Member
Featured
Join Date: Jan 2005
Posts: 395
First, What is the difference between info.value and info.arg1/arg2... As I understand arg1/2 is the arguments given to the func of info.func but info.value is the value set to UIDROPDOWNMENU_MENU_VALUE but thats the same, and BETTER than arg1 because you can have
info.func =myFunc;
info.value = {large table of stuff};

and in myFunc you can just use this.value[#] to get the info from the values... so like whats the real difference? if there is one???
UIDROPDOWNMENU_MENU_VALUE is set by the 2nd argument passed to ToggleDropDownMenu when you are opening a menu. The ONLY time it is set by info.value is when you open the Colour picker frame.

UIDROPDOWNMENU_MENU_VALUE is useful for allowing the menu to be used for a number of different purposes. You can code your dropdown init function to show certain buttons based on it's value or you can have the menu apply to different targets (ie. players).

info.arg1 and info.arg2 are button specific information that are passed to info.func when it is called by the OnClick function. You can use these arguments to allow all of your buttons to share a single function that chooses its actions based on the arguements it is passed.


Second, Is there a way to make a var be set to something when you put your mouse over a button that hasArrow? I noticed in the template file theres a button for the arrow which has code that controls the next level. Is there a way to make it work without having to copy and edit 95% of the dropdownmenu UI? Could I maybe have a frame (or button) that inherits the arrow and I add something to it? Again, I want a var to be set to something when you mouseover a button with an arrow. For example, lets say you have this menu:
Let > be a arrow.

Title
button1
button2
--------
button3
button4 >
button5>

If you put your mouse over button 4, MyCoolVar will be set to 4. If you mouseover button 5, MyCoolVar will be set to 5.
The default dropdown menu code does not support this sort of action as this is not something that is a normal behaviour for a dropdown menu. What exactly are you trying to achomplish and would a menu item that you can Check/Uncheck work just as well or better?


Third, what are the start/stop counting functions for? I looked at a lot of examples but couldn't figure it out.
The Counting functions are used by the Blizzard code to control how long the dropdown can sit unused before it is hidden automatically. You don't need to worry about those.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Few UIDropDownMenu Questions

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