I think I found the issue - you are using info.check in the new code, but info.checked in the old code (and checked is what Blizzard code is using).
Once the Blizzard code starts setting info.checked, all further buttons will be considered checked, since you just set "check" to nil, rather than "checked" - this can only happen if Blizzard code is reinitializing the dropdown all the time, which I would hope it wouldn't, but...
I'm sorry for the brevity of my original comment, I'll expound on it a bit. By creating a new function for each button, you are causing unnecessary garbage collection, when your function can easily be rewritten to a reusable format.
Original code:
Lua Code:
function SLFG_DungeonMenu_Init(self)
local level = level or 1
local info = UIDropDownMenu_CreateInfo()
for i = 1,#SLFG_DungeonList do
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
Proposed change:
Lua Code:
function SLFG_DungeonMenu_DropdownFunc(self)
UIDropDownMenu_SetSelectedValue(self.owner, self.value)
SLFG_Settings.dungeon = SLFG_DungeonList[self.value+1]
print(SLFG_Settings.dungeon.. " has been set.")
end
function SLFG_DungeonMenu_Init(self)
local level = level or 1
local info = UIDropDownMenu_CreateInfo()
for i = 1,#SLFG_DungeonList do
info.text = SLFG_DungeonList[i]
info.value = i-1 -- value should start at 0
info.func = SLFG_DungeonMenu_DropdownFunc
info.owner = self
info.checked = nil
info.icon = nil
UIDropDownMenu_AddButton(info, level)
end
end