View Single Post
09-03-20, 09:59 AM   #1
benots4
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 20
aceconfig-3.0 options type range set max

Using AceConfig-3.0 Options Tables type "ranged" to display a slider, all is good. Except how do you dynamically set the max value? One example attempt shown below throws error about "db" being nil and that same code works elsewhere.

Code:
selectAction ={
	name = "selector",
	desc = "Pick the entry to display",
	type = "range",
	max = AMine.db.profile.actionCnt,
	min = 1,
	step = 1,
	set = function (info, val) if val <= AMine.db.profile.actionsCnt then AMine.db.profile["actionPicker"] = val end end,
	get =  function(info)if AMine.db.profile.actionPicker == nil then AMine.db.profile = {["actionPicker"] = 0} end
	if AMine.db.profile.actionPicker <=  AMine.db.profile.actionsCnt then return AMine.db.profile.actionPicker 
	else AMine.db.profile.actionPicker = AMine.db.profile.actionCnt  end 
	 end,	
},
  Reply With Quote