View Single Post
05/15/23, 10:34 AM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Question libaddonmenu dropdown listbox default display

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",
},

Last edited by sinnereso : 05/15/23 at 10:52 AM.
  Reply With Quote