View Single Post
09-19-19, 08:44 PM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Lua Code:
  1. local SLFG_DungeonList = {
  2.     "Ragefire Chasm (RFC)",
  3.     "Wailing Caverns (WC)",
  4.     "Deadmines (VC)",
  5.     "Shadowfang Keep (SFK)",
  6.     "Blackfathom Deeps (BFD)",
  7.     "Stockade (Stocks)",
  8.     "Gnomeregan (Gnomer)",
  9.     "Razorfen Kraul (RFK)",
  10.     "SM: Graveyard (GY)",
  11.     "SM: Library (Lib)",
  12.     "SM: Armory (Armory)",
  13.     "SM: Cathedral (Cath)",
  14.     "Razorfen Downs (RFD)",
  15.     "Uldaman (Ulda)",
  16.     "Zul'Farrack (ZF)",
  17.     "Maraudon (Mara)",
  18.     "Sunken Temple (ST)",
  19.     "Blackrock Depths (BRD)",
  20.     "Lower Blackrock Spire (LBRS)",
  21.     "Upper Blackrock Spire (UBRS)",
  22.     -- "Dire Maul: East (DME)",
  23.     -- "Dire Maul: West (DMW)",
  24.     -- "Dire Maul: North (DMN)",
  25.     "Scholomance (Scholo)",
  26.     "Stratholme: Live (Strat Live)",
  27.     "Stratholme: Dead (Strat Dead)",
  28.     "Molten Core (MC)",
  29.     "Onyxia's Lair (Ony)"
  30. }
  31.  
  32. -- DropMenu Setup
  33. local function SLFG_DungeonMenu_Init(self)
  34.     local level = level or 1
  35.     local info = UIDropDownMenu_CreateInfo()
  36.    
  37.    
  38.     for i = 1,#SLFG_DungeonList do
  39.         table.wipe(info)
  40.         info.text = SLFG_DungeonList[i]
  41.         info.value = i-1        -- value should start at 0
  42.         info.func = function(self)
  43.             UIDropDownMenu_SetSelectedValue(self.owner, self.value)
  44. --            SLFG_Settings.dungeon = SLFG_DungeonList[i]
  45. --            print(SLFG_Settings.dungeon.. " has been set.")
  46.             end
  47.         info.owner = self
  48.         info.check = nil
  49.         info.icon = nil
  50.         UIDropDownMenu_AddButton(info, level)
  51.     end
  52. end
  53.  
  54. local dm = CreateFrame("FRAME", "SLFG_DungeonMenu", panel, "UIDropDownMenuTemplate")
  55. dm:SetPoint("LEFT", 20, 0)
  56. UIDropDownMenu_SetWidth(dm, 190)
  57. UIDropDownMenu_Initialize(dm, SLFG_DungeonMenu_Init)

wiped the info table each iteration
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 09-19-19 at 08:49 PM.
  Reply With Quote