Hey guys im looking for a way to get a dropdown listbox using libaddonmenu to display a saved variable on it when it is NOT dropped down but otherwise NOT have that variable as a choice.
The reason is I'm trying to avoid the "double listing" that happens when the saved variable happens to be one of the choices. If i remove it as a choice the dropdown is blank other than the choices.
Any suggestions? heres what im messing with right now:
Code:
{
type = "dropdown",
name = "name",
tooltip = "tooltip",
choices = {
tostring("DISABLED"),
tostring(MyAddon.savedVariables.noDeposit),
tostring(GetUnitName("player")),
},
getFunc = function() return tostring(MyAddon.savedVariables.noDeposit) end,
setFunc = function(var) MyAddon.savedVariables.noDeposit = (var) end,
disabled = function() return not MyAddon.savedVariables.goldDeposit end,
--width = "half",
},