# HG changeset patch # User Zerotorescue # Date 1293109068 -3600 # Node ID 710f03653aaf2f833f28d4a11cf8542c82666bf5 # Parent 67181b118bedefdb24c0fedad33b70a13ca2bbff When the track at option of a group is overridden, the default is no longer passed by reference but copied whenever it is a table. diff -r 67181b118bed -r 710f03653aaf Config.lua --- a/Config.lua Thu Dec 23 13:38:27 2010 +0100 +++ b/Config.lua Thu Dec 23 13:57:48 2010 +0100 @@ -22,7 +22,9 @@ elseif value and info.arg then -- If this override is now enabled, we need to copy the default into this field (unless it is not nil (which is supposed to be impossible), in which case we'll use the already selected value) - addon.db.profile.groups[groupName][info.arg] = addon:GetOptionByKey(groupName, info.arg); + local inheritedValue = addon:GetOptionByKey(groupName, info.arg); + + addon.db.profile.groups[groupName][info.arg] = (type(inheritedValue) ~= "table" and inheritedValue) or CopyTable(inheritedValue); -- copying defaults by reference would let one (unintendedly) change the defaults end end @@ -55,13 +57,9 @@ local groupName = groupIdToName[info[2]]; local optionName = info[#info]; - if addon.db.profile.groups[groupName][optionName] ~= nil then - return addon.db.profile.groups[groupName][optionName][value]; - elseif addon.db.profile.defaults[optionName] then - return addon.db.profile.defaults[optionName][value]; - else - return nil; - end + local multiSelectValue = addon:GetOptionByKey(groupName, optionName); + + return multiSelectValue and multiSelectValue[value]; end local function GetDisabled(info) @@ -1462,8 +1460,12 @@ return temp; end, - get = function(i, v) return addon.db.profile.defaults.trackAtCharacters[v]; end, - set = function(i, v, e) addon.db.profile.defaults.trackAtCharacters[v] = e or nil; end, + get = function(i, v) + return addon.db.profile.defaults.trackAtCharacters[v]; + end, + set = function(i, v, e) + addon.db.profile.defaults.trackAtCharacters[v] = e or nil; + end, dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. }, },