Lua Code:
local SLFG_DungeonList = {
"Ragefire Chasm (RFC)",
"Wailing Caverns (WC)",
"Deadmines (VC)",
"Shadowfang Keep (SFK)",
"Blackfathom Deeps (BFD)",
"Stockade (Stocks)",
"Gnomeregan (Gnomer)",
"Razorfen Kraul (RFK)",
"SM: Graveyard (GY)",
"SM: Library (Lib)",
"SM: Armory (Armory)",
"SM: Cathedral (Cath)",
"Razorfen Downs (RFD)",
"Uldaman (Ulda)",
"Zul'Farrack (ZF)",
"Maraudon (Mara)",
"Sunken Temple (ST)",
"Blackrock Depths (BRD)",
"Lower Blackrock Spire (LBRS)",
"Upper Blackrock Spire (UBRS)",
-- "Dire Maul: East (DME)",
-- "Dire Maul: West (DMW)",
-- "Dire Maul: North (DMN)",
"Scholomance (Scholo)",
"Stratholme: Live (Strat Live)",
"Stratholme: Dead (Strat Dead)",
"Molten Core (MC)",
"Onyxia's Lair (Ony)"
}
-- DropMenu Setup
local function SLFG_DungeonMenu_Init(self)
local level = level or 1
local info = UIDropDownMenu_CreateInfo()
for i = 1,#SLFG_DungeonList do
table.wipe(info)
info.text = SLFG_DungeonList[i]
info.value = i-1 -- value should start at 0
info.func = function(self)
UIDropDownMenu_SetSelectedValue(self.owner, self.value)
-- SLFG_Settings.dungeon = SLFG_DungeonList[i]
-- print(SLFG_Settings.dungeon.. " has been set.")
end
info.owner = self
info.check = nil
info.icon = nil
UIDropDownMenu_AddButton(info, level)
end
end
local dm = CreateFrame("FRAME", "SLFG_DungeonMenu", panel, "UIDropDownMenuTemplate")
dm:SetPoint("LEFT", 20, 0)
UIDropDownMenu_SetWidth(dm, 190)
UIDropDownMenu_Initialize(dm, SLFG_DungeonMenu_Init)
wiped the info table each iteration