Mercurial > wow > ouroloot
diff text_tabs.lua @ 97:ba5ff82dcf19
(First breaking change for MoP/3.0, incomplete transition.) Move generic user options to acedb. Remove older savedvar-upgrade code for a clean break. Add a profiles tab since it will be expected; changing profiles not yet implemented.
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Fri, 27 Jul 2012 10:23:12 +0000 |
parents | 8442272a8418 |
children | fe04f5c4114a |
line wrap: on
line diff
--- a/text_tabs.lua Thu Jul 26 20:46:00 2012 +0000 +++ b/text_tabs.lua Fri Jul 27 10:23:12 2012 +0000 @@ -53,7 +53,7 @@ end local function forum (_, loot, last_printed, generated, cache) - local fmt = OuroLootSV_opts.forum[OuroLootSV_opts.forum_current] or "" + local fmt = addon.db.profile.forum[addon.db.profile.forum_current] or "" -- if it's capable of handling heroic items, consider them warned already forum_warned_heroic = forum_warned_heroic or fmt:find'%$I' @@ -103,10 +103,11 @@ end local function forum_specials (_,_, container, mkbutton) + local opts = addon.db.profile local map,current = {} - for label,format in pairs(OuroLootSV_opts.forum) do + for label,format in pairs(opts.forum) do table.insert(map,label) - if label == OuroLootSV_opts.forum_current then + if label == opts.forum_current then current = #map end end @@ -119,21 +120,21 @@ dd:SetList(map) dd:SetValue(current) dd:SetCallback("OnValueChanged", function(_dd,event,choice) - OuroLootSV_opts.forum_current = map[choice] + opts.forum_current = map[choice] forum_warned_heroic = nil editbox:SetDisabled(map[choice] ~= "Custom...") end) container:AddChild(dd) - editbox = mkbutton("EditBox", nil, OuroLootSV_opts.forum["Custom..."], + editbox = mkbutton("EditBox", nil, opts.forum["Custom..."], [[Format described in Help tab (Generated Text -> Forum Markup).]]) editbox:SetFullWidth(true) editbox:SetLabel("Custom:") editbox:SetCallback("OnEnterPressed", function(_e,event,value) - OuroLootSV_opts.forum["Custom..."] = value + opts.forum["Custom..."] = value _e.editbox:ClearFocus() end) - editbox:SetDisabled(OuroLootSV_opts.forum_current ~= "Custom...") + editbox:SetDisabled(opts.forum_current ~= "Custom...") container:AddChild(editbox) end