Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » aceconfig-3.0 options type range set max

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off