local AddName, Ns = ...
local L = Ns.L


------------------------------
--		Stat Options		--
------------------------------
local Both, Enhanced, Base, Damage, DamageTaken, Melee, Ranged, World, Realm, Equipped, Overall, Level, Honor, Max, Live, Enchanted, Ingenuity = 3, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 2
local Percentage, Rating, MainHand, OffHand, SameLevel, BossLevel, Regen, Casting, Critical, CritDamage, Average, Low, Static, Normal, Shadowflame = 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 3, 2, 1, 1
local Season, Expansion, Spark, Splinter, Gigantic, Plump = 1, 2, 1, 2, 1, 2

Ns.ConfigWidth = 950
Ns.ConfigHeight = 540
if GetLocale() == "frFR" or GetLocale() == "zhCN" or GetLocale() == "zhTW" or GetLocale() == "koKR" then
	Ns.ConfigWidth = 960
end

--local honorIcon = 73824
--local faction = UnitFactionGroup("player")
--if faction == "Horde" then honorIcon = 59641 end

------------------------------
--		Global Updater		--
------------------------------
function Ns.MeleeUpdate() end
function Ns.DefenseUpdate() end
function Ns.RangedUpdate() end
function Ns.SpellUpdate() end

------------------------------
--		Display Order		--
------------------------------
Ns.DefaultOrder = { -- grp = SpellClass, options order = display order, ["on"]/["off"] option is implied in all stats so not required in the table. The [1]..[2] not required but just for example
	{ stat="CritChance", onupdate=true, events={}, spell=275336, spellclass="Enhancement", widget={ type="CheckBox" }, options={ Percent_Rating=true, Display_Basic=true, Decimals_Crit=true, Cap_Crit=true }, subgroup=true, activeonload=true, },
	{ stat="Haste", onupdate=true, events={}, spell=342245, spellclass="Enhancement", widget={ type="CheckBox" }, options={ Percent_Rating=true, Display_Basic=true, Decimals_Haste=true, Cap_Haste=true }, subgroup=true },
	{ stat="Mastery", onupdate=true, events={}, spell=207684, spellclass="Enhancement", widget={ type="CheckBox" }, options={ Percent_Rating=true, Display_Basic=true, Decimals_Mastery=true, Cap_Mastery=true }, subgroup=true },
	{ stat="Versatility", onupdate=true, events={}, spell=202137, spellclass="Enhancement", widget={ type="CheckBox" }, options={ Damage_Taken=true, Display_Rating=true, Decimals_Versatility=true, Cap_Versa=true }, subgroup=true },
	{ stat="Avoidance", onupdate=true, events={}, spell=202138, spellclass="Enhancement", widget={ type="CheckBox" }, options={ Percent_Rating=true, Display_Basic=true, Decimals_Avoidance=true, Cap_Avoid=true }, subgroup=true },
	{ stat="Leech", onupdate=true, events={}, spell=204021, spellclass="Enhancement", widget={ type="CheckBox" }, options={ Percent_Rating=true, Display_Basic=true, Decimals_Leech=true, Cap_Leech=true }, subgroup=true },
	{ stat="Speed", onupdate=true, events={}, updatespeed=1, spell=109215, spellclass="Enhancement", widget={ type="CheckBox" }, options={ Speed_Static=true, Decimals_Speed=true }, subgroup=true },
	{ stat="Strength", onupdate=true, events={}, spell=48743, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, }, subgroup=true, activeonload=true, },
	{ stat="Agility", onupdate=true, events={}, spell=319032, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, }, subgroup=true },
	{ stat="Intellect", onupdate=true, events={}, spell=155147, spellclass="Spell", widget={ type="CheckBox" }, options={ Enhanced_Base=true, }, subgroup=true, activeonload=true, },
	{ stat="AP", onupdate=true, events={}, spell=29838, spellclass="Physical", widget={ type="CheckBox" }, options={ Melee_Ranged=true, }, subgroup=true },
	{ stat="DMG", onupdate=true, events={}, spell=315720, spellclass="Physical", widget={ type="CheckBox" }, options={ Max_Average_Damage=true, Display_MainHand=true, Decimals_Damage=true }, subgroup=true },
	{ stat="DMGMod", onupdate=true, events={}, spell=152175, spellclass="Physical", widget={ type="CheckBox" }, options={ Melee_Ranged=true, Decimals_DmgMod=true }, subgroup=true },
	{ stat="DPS", onupdate=true, events={}, spell=115080, spellclass="Physical", widget={ type="CheckBox" }, options={ Melee_Ranged=true, Display_MainHand=true, Decimals_DPS=true }, subgroup=true },
	{ stat="SpellPower", onupdate=true, events={}, spell=321358, spellclass="Spell", widget={ type="CheckBox" }, options={ Enhanced_Base=true, }, subgroup=true },
	{ stat="DMGModSpell", onupdate=true, events={}, spell=385899, spellclass="Spell", widget={ type="CheckBox" }, options={ Decimals_DmgModSpell=true }, subgroup=true },
	{ stat="Healing", onupdate=true, events={}, spell=2050, spellclass="Spell", widget={ type="CheckBox" }, options={ Enhanced_Base=true, }, subgroup=true },
	{ stat="weaponSpeed", onupdate=true, events={}, spell=321281, spellclass="Physical", widget={ type="CheckBox" }, options={ Melee_Ranged=true, Decimals_WepSpeed=true }, subgroup=true },
	{ stat="ManaRegen", onupdate=true, events={}, spell=63733, spellclass="Spell", widget={ type="CheckBox" }, options={ Enhanced_Base=true, Decimals_ManaRegen=true }, subgroup=true },
	{ stat="EnergyRegen", onupdate=true, events={}, spell=212283, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, Decimals_Energy=true }, subgroup=true },
	{ stat="Stamina", onupdate=true, events={}, spell=320380, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, }, subgroup=true },
	{ stat="Armor", onupdate=true, events={}, spell=321708, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, }, subgroup=true },
	{ stat="Dodge", onupdate=true, events={}, spell=115008, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, Decimals_Dodge=true }, subgroup=true },
	{ stat="Parry", onupdate=true, events={}, spell=118038, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, Decimals_Parry=true }, subgroup=true },
	{ stat="Block", onupdate=true, events={}, spell=203177, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, Decimals_Block=true }, subgroup=true },
	{ stat="Absorb", onupdate=true, events={}, spell=343744, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, }, subgroup=true },
	{ stat="Stagger", onupdate=true, events={}, spell=280195, spellclass="Physical", widget={ type="CheckBox" }, options={ Enhanced_Base=true, Decimals_Stagger=true }, subgroup=true },
	{ stat="TargetSpeed", onupdate=true, events={}, spell=52358, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true, activeonload=true, },
	{ stat="Threat", onupdate=true, events={}, spell=185245, spellclass="Misc", widget={ type="CheckBox" }, options={ Percent_Rating=true, }, subgroup=true },
	{ stat="ItemLevel", onupdate=true, events={}, spell=48792, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, Equipped_Overall=true, Decimals_iLVL=true }, subgroup=true },
	{ stat="PvPiLvl", onupdate=true, events={}, spell=347503, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, Decimals_pvpiLVL=true }, subgroup=true },
	{ stat="MythicPlus", events={ CHALLENGE_MODE_COMPLETED=true, }, spell=393977, spellclass="Misc", widget={ type="CheckBox" }, options={ Season_Exp=true }, subgroup=true },
	{ stat="GlobalCD", events={ UNIT_SPELLCAST_SUCCEEDED={ "player" }, }, spell=363929, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, Decimals_Gcd=true }, subgroup=true },
	{ stat="Durability", events={ UPDATE_INVENTORY_DURABILITY=true, }, spell=3100, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="Flightstones", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2245, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true, activeonload=true },
	{ stat="AspectCrest", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2812, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, Normal_Enchanted=true, Display_Max=true }, subgroup=true },
	{ stat="WyrmCrest", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2809, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, Normal_Enchanted=true, Display_Max=true, }, subgroup=true },
	{ stat="DrakeCrest", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2807, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, Display_Max=true, }, subgroup=true, },
	{ stat="WhelplingCrest", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2806, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, Normal_Enchanted=true, Display_Max=true, }, subgroup=true, },
	{ stat="Renascent", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2912, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="SparkDreams", events={ UNIT_INVENTORY_CHANGED=true, }, item=206959, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, Splint_Spark=true, }, subgroup=true },
	{ stat="Bullion", events={ UNIT_INVENTORY_CHANGED=true, }, item=213089, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="Bronze", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2778, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, Decimals_Bronze=true, }, subgroup=true },
	{ stat="Threads", onupdate=true, events={}, item=219282, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, Decimals_Threads=true, }, subgroup=true },
	{ stat="Mysterious", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2657, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="GigaSeed", events={ UNIT_INVENTORY_CHANGED=true, }, item=208047, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, Giga_Plump=true, }, subgroup=true },
	{ stat="SeedBloom", events={ UNIT_INVENTORY_CHANGED=true, }, item=211376, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="DewDrop", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2650, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="DreamWardens", onupdate=true, events={}, currency=2653, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, Display_Percentage=true }, subgroup=true },
	{ stat="LoammNiffen", onupdate=true, events={}, spell=409490, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, Display_Percentage=true }, subgroup=true },
	{ stat="Renown", events={ CURRENCY_DISPLAY_UPDATE=true, }, spell=364603, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, Hide_Reputation=true }, subgroup=true },
	{ stat="DreamSurge", events={ UNIT_INVENTORY_CHANGED=true, }, item=207026, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true }, subgroup=true },
	{ stat="Flakes", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2594, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="ValorPoints", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=1191, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="DragonSupplies", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2003, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="StormSigil", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2122, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="EleOverflow", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2118, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="BloodyTokens", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2123, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="Honor", events={ CURRENCY_DISPLAY_UPDATE=true, }, spell=269083, spellclass="Currency", widget={ type="CheckBox" }, options={ Level_HonorPoints=true, Display_Rated=true, }, subgroup=true },
	{ stat="Conquest", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=1602, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="Timewarped", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=1166, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="TraderTender", events={ CURRENCY_DISPLAY_UPDATE=true, }, currency=2032, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="Lag", onupdate=true, events={}, spell=190447, spellclass="Misc", widget={ type="CheckBox" }, options={ World_Realm=true, }, subgroup=true },
	{ stat="FPS", onupdate=true, events={}, updatespeed=1, spell=6196, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="Gold", events={ PLAYER_MONEY=true, }, spell=303624, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
	{ stat="WowToken", onupdate=true, events={}, item=122284, spellclass="Currency", widget={ type="CheckBox" }, options={ Show=true, Display_Short=true, }, subgroup=true },
	{ stat="RepairCost", events={ UPDATE_INVENTORY_DURABILITY=true, }, spell=52774, spellclass="Misc", widget={ type="CheckBox" }, options={ Show=true, }, subgroup=true },
}

------------------------------
--		Global Events		--
------------------------------
Ns.GlobalEvents = {
	UNIT_AURA={ "player", "target", },
	UNIT_INVENTORY_CHANGED={ "player", },
	UNIT_STATS={ "player", },
	UPDATE_INVENTORY_DURABILITY=true,
	UPDATE_FACTION=true,
	BIND_ENCHANT=true,
	CHARACTER_POINTS_CHANGED=true,
	PLAYER_LEVEL_UP=true,
	PLAYER_TARGET_CHANGED=true,
	REPLACE_ENCHANT=true,
	GET_ITEM_INFO_RECEIVED=true,
	TRAIT_CONFIG_UPDATED=true,
}

------------------------------
--		Settings Groups		--
------------------------------
Ns.SpellClass = {
	[0] = { stat="Settings", grp=Ns.SettingsGroupOrder, order=Ns.SettingsDisplayOrder, icon="Settings", },
	[1] = { stat="Enhancement", icon="Melee", },
	[2] = { stat="Physical", icon="Defense", },
	[3] = { stat="Spell", icon="Spell", },
	[4] = { stat="Currency", icon="Currency", },
	[5] = { stat="Misc", icon="Misc", },
}

------------------------------
--		Stat Options		--
------------------------------
Ns.Options = {
	{ stat="Show", widget={ type="CheckBox", } },
	{ stat="Enhanced_Base", spellclass="Enhanced_Base", widget={ type="Radio", }, tooltip=true,  default=1, labels={ "Enhanced", "Base", "Both"}, },
	{ stat="Percent_Rating", spellclass="Percent_Rating", widget={ type="Radio", }, tooltip=true, default=1, labels={ "Percentage", "Rating", "Both"}, },
	{ stat="Damage_Taken", spellclass="Damage_Taken", widget={ type="Radio", }, tooltip=true,  default=1, labels={ "Damage", "DamageTaken", "Both"}, },
	{ stat="Melee_Ranged", spellclass="Melee_Ranged", widget={ type="Radio", }, tooltip=true,  default=1, labels={ "Melee", "Ranged", "Both"}, },
	{ stat="Display_Average", spellclass="Display_Average", widget={ type="CheckBox", }, tooltip=true,  default=false, labels={ "Display_Average"}, },
	{ stat="World_Realm", spellclass="World_Realm", widget={ type="Radio", }, tooltip=true,  default=1, labels={ "World", "Realm", "Both"}, },
	{ stat="Equipped_Overall", spellclass="Equipped_Overall", widget={ type="Radio", }, tooltip=true,  default=1, labels={ "Equipped", "Max", "Both"}, },
	{ stat="Level_HonorPoints", spellclass="Level_HonorPoints", widget={ type="Radio", }, tooltip=true,  default=1, labels={ "Level", "Honor", "Both"}, },
	{ stat="Max_Average_Damage", spellclass="Max_Average_Damage", widget={ type="Radio", }, tooltip=true, default=1, labels={ "Max", "Average", "Low"}, },
	{ stat="Display_Rated", spellclass="Display_Rated", widget={ type="CheckBox", }, tooltip=true,  default=false, labels={ "Display_Rated"}, },
	{ stat="Display_Rating", spellclass="Display_Rating", widget={ type="CheckBox", }, tooltip=true,  default=false, labels={ "Display_Rating"}, },
	{ stat="Display_Basic", spellclass="Display_Basic", widget={ type="CheckBox", }, tooltip=true, default=false, labels={ "Display_Basic"}, },
	{ stat="Display_Percentage", spellclass="Display_Percentage", widget={ type="CheckBox", }, tooltip=true, default=false, labels={ "Display_Percentage"}, },
	{ stat="Hide_Reputation", spellclass="Hide_Reputation", widget={ type="CheckBox", }, tooltip=true, default=false, labels={ "Hide_Reputation"}, },
	{ stat="Display_MainHand", spellclass="Display_MainHand", widget={ type="CheckBox", }, tooltip=true, default=false, labels={ "Display_MainHand"}, },
	{ stat="Speed_Static", spellclass="Speed_Static", widget={ type="Radio", }, tooltip=true, default=1, labels={ "Live", "Static", "Both"}, },
	{ stat="Display_Short", spellclass="Display_Short", widget={ type="CheckBox", }, tooltip=false,  default=false, labels={ "Display_Short"}, },
	{ stat="Normal_Enchanted", spellclass="Normal_Enchanted", widget={ type="Radio", }, tooltip=true, default=1, labels={ "Normal", "Enchanted", "Both"}, },
	{ stat="Shadow_Ing", spellclass="Shadow_Ing", widget={ type="Radio", }, tooltip=true, default=1, labels={ "Shadowflame", "Ingenuity", "Both"}, },
	{ stat="Season_Exp", spellclass="Season_Exp", widget={ type="Radio", }, tooltip=true, default=1, labels={ "Season", "Expansion", "Both"}, },
	{ stat="Splint_Spark", spellclass="Splint_Spark", widget={ type="Radio", }, tooltip=true, default=1, labels={ "Spark", "Splinter", "Both"}, },
	{ stat="Giga_Plump", spellclass="Giga_Plump", widget={ type="Radio", }, tooltip=true, default=1, labels={ "Gigantic", "Plump", "Both"}, },
	{ stat="Display_Max", spellclass="Display_Max", widget={ type="CheckBox", }, tooltip=true, default=true, labels={ "Display_Max"}, },
	-- decimals
	{ stat="Decimals_Crit", spellclass="Decimals_Crit", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Haste", spellclass="Decimals_Haste", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Mastery", spellclass="Decimals_Mastery", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Versatility", spellclass="Decimals_Versatility", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Avoidance", spellclass="Decimals_Avoidance", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Leech", spellclass="Decimals_Leech", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Speed", spellclass="Decimals_Speed", default=0, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Damage", spellclass="Decimals_Damage", default=0, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Block", spellclass="Decimals_Block", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Parry", spellclass="Decimals_Parry", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Dodge", spellclass="Decimals_Dodge", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Stagger", spellclass="Decimals_Stagger", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Energy", spellclass="Decimals_Energy", default=1, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_ManaRegen", spellclass="Decimals_ManaRegen", default=0, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_iLVL", spellclass="Decimals_iLVL", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_pvpiLVL", spellclass="Decimals_pvpiLVL", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Gcd", spellclass="Decimals_Gcd", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_DPS", spellclass="Decimals_DPS", default=0, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_WepSpeed", spellclass="Decimals_WepSpeed", default=2, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_DmgMod", spellclass="Decimals_DmgMod", default=0, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_DmgModSpell", spellclass="Decimals_DmgModSpell", default=0, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Bronze", spellclass="Decimals_Bronze", default=0, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	{ stat="Decimals_Threads", spellclass="Decimals_Threads", default=0, widget={ type="Slider", min=0, max=3, valuestep=1, width=140, } , newline=true, },
	-- caps
	{ stat="Cap_Crit", spellclass="Cap_Crit", default=100, tooltip=true, widget={ type="EditBox", width=60, height=20, numeric=true, format="%.2f%%", }, },
	{ stat="Cap_Haste", spellclass="Cap_Haste", default=100, tooltip=true, widget={ type="EditBox", width=60, height=20, numeric=true, format="%.2f%%", }, },
	{ stat="Cap_Mastery", spellclass="Cap_Mastery", default=100, tooltip=true, widget={ type="EditBox", width=60, height=20, numeric=true, format="%.2f%%", }, },
	{ stat="Cap_Versa", spellclass="Cap_Versa", default=100, tooltip=true, widget={ type="EditBox", width=60, height=20, numeric=true, format="%.2f%%", }, },
	{ stat="Cap_Avoid", spellclass="Cap_Avoid", default=100, tooltip=true, widget={ type="EditBox", width=60, height=20, numeric=true, format="%.2f", }, },
	{ stat="Cap_Leech", spellclass="Cap_Leech", default=100, tooltip=true, widget={ type="EditBox", width=60, height=20, numeric=true, format="%.2f", }, },
}

--------------------------
--		Class & ID		--
--------------------------
Ns.byPlayerClass = {
--10.0 DF
	["EVOKER"] = 13,
--7.0 Legion
	["DEMONHUNTER"] = 12,
--5.0 Pandaria
	["MONK"] = 10,
--3.0 Wrath
	["DEATHKNIGHT"] = 6,
--1.0 Classic
	["DRUID"] = 11,
	["HUNTER"] = 3,
	["MAGE"] = 8,
	["PALADIN"] = 2,
	["PRIEST"] = 5,
	["ROGUE"] = 4,
	["SHAMAN"] = 7,
	["WARLOCK"] = 9,
	["WARRIOR"] = 1,
}

------------------------------
--		Class defaults		--
------------------------------
function Ns:GetClassDefaults(class)
	local defaults = {
--10.0 DF
		EVOKER = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			ManaRegen = true,
			SpellPower = true,
			Healing = true,
			Absorb = true,
			Speed = true,
			Durability = true,
		},
--7.0 Legion
		DEMONHUNTER  = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Leech = true,
			Strength = true,
			AP = true,
			DMG = true,
			Armor = true,
			Absorb = true,
			Dodge = true,
			Speed = true,
			Durability = true,
		},
--5.0 Panda
		MONK = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Stagger = true,
			AP = true,
			Agility = true,
			Armor = true,
			Absorb = true,
			Dodge = true,
			Speed = true,
			Durability = true,
		},
--3.0 Wrath
		DEATHKNIGHT = { -- setup will check the stat. exists for game version being played
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Leech = true,
			AP = true,
			Strength = true,
			Armor = true,
			Parry = true,
			Absorb = true,
			Speed = true,
			Durability = true,
		},
--1.0 Classic
		DRUID = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			AP = true,
			SpellPower = true,
			Intellect = true,
			ManaRegen = true,
			EnergyRegen = true,
			Absorb = true,
			Speed = true,
			Durability = true,
		},
		HUNTER = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Agility = true,
			Mastery = true,
			AP = true,
			Speed = true,
			Durability = true,
		},
		MAGE = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Intellect = true,
			SpellPower = true,
			ManaRegen = true,
			Absorb = true,
			Speed = true,
			Durability = true,
		},
		PALADIN = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Intellect = true,
			ManaRegen = true,
			Healing = true,
			Absorb = true,
			Speed = true,
			Durability = true,
		},
		PRIEST = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Intellect = true,
			ManaRegen = true,
			SpellPower = true,
			Healing = true,
			Absorb = true,
			Speed = true,
			Durability = true,
		},
		ROGUE = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Agility = true,
			AP = true,
			EnergyRegen = true,
			Dodge = true,
			Speed = true,
			Durability = true,
		},
		SHAMAN = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Intellect = true,
			ManaRegen = true,
			SpellPower = true,
			Healing = true,
			Absorb = true,
			Speed = true,
			Durability = true,
		},
		WARLOCK = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Intellect = true,
			SpellPower = true,
			Absorb = true,
			Speed = true,
			Durability = true,
		},
		WARRIOR = {
			Haste = true,
			Versatility = true,
			CritChance = true,
			Mastery = true,
			Strength = true,
			AP = true,
			Armor = true,
			Absorb = true,
			Block = true,
			Dodge = true,
			Speed = true,
			Durability = true,
		},
	}
	return class and defaults[strupper(class)] or defaults
end