View Single Post
09-19-19, 09:41 PM   #8
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
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)
__________________
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 09:53 PM.
  Reply With Quote