WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   PTR API and Graphics Changes (https://www.wowinterface.com/forums/forumdisplay.php?f=175)
-   -   UIDropDownMenu_AddSeparator syntax changed in 8.0.1 (https://www.wowinterface.com/forums/showthread.php?t=56174)

arith 04-23-18 10:39 PM

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


All times are GMT -6. The time now is 08:50 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI