Code:
dm = CreateFrame("FRAME", "SLFG_RoleMenu", panel, "UIDropDownMenuTemplate")
dm:SetPoint("LEFT", SLFG_RoleText, "RIGHT", 0, -2)
UIDropDownMenu_SetWidth(dm, 70)
UIDropDownMenu_Initialize(dm, SLFG_RoleMenu_Init)
If this is the actual order of your code then this is calling SLFG_RoleMenu_Init before the function has been created so I'm guessing there is another version of it somewhere else also global.
Code:
function SLFG_RoleMenu_Init(self)
local info = UIDropDownMenu_CreateInfo()
info.text = "Tank"
info.value = 0
info.func = function(self)
UIDropDownMenu_SetSelectedValue(self.owner, self.value)
-- SLFG_Settings.role = "TANK"
-- SLFG_UpdateMsg()
end
info.owner = self
info.check = nil
info.icon = nil
UIDropDownMenu_AddButton(info)
table.wipe(info)
info.text = "Healer"
info.value = 1
info.func = function(self)
UIDropDownMenu_SetSelectedValue(self.owner, self.value)
-- SLFG_Settings.role = "HEALER"
-- SLFG_UpdateMsg()
end
info.owner = self
info.check = nil
info.icon = nil
UIDropDownMenu_AddButton(info)
table.wipe(info)
info.text = "DPS"
info.value = 2
info.func = function(self)
UIDropDownMenu_SetSelectedValue(self.owner, self.value)
-- SLFG_Settings.role = "DPS"
-- SLFG_UpdateMsg()
end
info.owner = self
info.check = nil
info.icon = nil
UIDropDownMenu_AddButton(info)
end
dm = CreateFrame("FRAME", "SLFG_RoleMenu", panel, "UIDropDownMenuTemplate")
dm:SetPoint("LEFT", 20, -2)
UIDropDownMenu_SetWidth(dm, 70)
UIDropDownMenu_Initialize(dm, SLFG_RoleMenu_Init)