Quantcast UIDropDownMenu_AddSeparator syntax changed in 8.0.1 - WoWInterface
Thread Tools Display Modes
04-23-18, 10:39 PM   #1
arith
A Cyclonian
 
arith's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 41
UIDropDownMenu_AddSeparator syntax changed in 8.0.1

Prior to WoW 8.0.1, the syntax of UIDropDownMenu_AddSeparator is:
Lua Code:
  1. UIDropDownMenu_AddSeparator(info, level)
Depends on how you use the info and how you re-use it, it may bring some issue once you call UIDropDownMenu_AddSeparator as it will also manipulate the info values.
For example, UIDropDownMenu_AddSeparator() will set info.isTitle to true. And if your next menu item did not reset info.isTitle to nil then you will run into trouble.

After WoW 8.0.1, the function call has been changed to:
Lua Code:
  1. UIDropDownMenu_AddSeparator(level)
So you don't need to worry about passing info array to it as it make no sense.
Make sure you revise your code to remove info while calling UIDropDownMenu_AddSeparator.
And if you are adding separator to level 1 of your menu, you can simply call UIDropDownMenu_AddSeparator() without feeding any value to it.


Below you can see the full details of the function:
Lua Code:
  1. local separatorInfo
  2.  
  3. function UIDropDownMenu_AddSeparator(level)
  4.     if not separatorInfo then
  5.         separatorInfo = {
  6.             hasArrow = false;
  7.             dist = 0;
  8.             isTitle = true;
  9.             isUninteractable = true;
  10.             notCheckable = true;
  11.             iconOnly = true;
  12.             icon = "Interface\\Common\\UI-TooltipDivider-Transparent";
  13.             tCoordLeft = 0;
  14.             tCoordRight = 1;
  15.             tCoordTop = 0;
  16.             tCoordBottom = 1;
  17.             tSizeX = 0;
  18.             tSizeY = 8;
  19.             tFitDropDownSizeX = true;
  20.             iconInfo = {
  21.                 tCoordLeft = 0,
  22.                 tCoordRight = 1,
  23.                 tCoordTop = 0,
  24.                 tCoordBottom = 1,
  25.                 tSizeX = 0,
  26.                 tSizeY = 8,
  27.                 tFitDropDownSizeX = true
  28.             },
  29.         };
  30.     end
  31.  
  32.     UIDropDownMenu_AddButton(separatorInfo, level);
  33. end
  Reply With Quote

WoWInterface » PTR » PTR API and Graphics Changes » UIDropDownMenu_AddSeparator syntax changed in 8.0.1

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