comparison gui.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 780b7e0eeeeb
children b5a55c69ef67
comparison
equal deleted inserted replaced
96:780b7e0eeeeb 97:ba5ff82dcf19
115 -- wonder if it would be worth memoizing this also 115 -- wonder if it would be worth memoizing this also
116 return t:gsub("[%+<>]",replacement_colors) 116 return t:gsub("[%+<>]",replacement_colors)
117 :gsub("([^\n])\n([^\n])", "%1 %2") 117 :gsub("([^\n])\n([^\n])", "%1 %2")
118 :gsub("|r\n\n", "|r\n") 118 :gsub("|r\n\n", "|r\n")
119 end 119 end
120 gui.markup = markup -- too useful to keep local
120 end 121 end
121 122
122 -- Working around this bug: 123 -- Working around this bug:
123 -- http://forums.wowace.com/showpost.php?p=295202&postcount=31 124 -- http://forums.wowace.com/showpost.php?p=295202&postcount=31
124 do 125 do
353 self.loot_clean = nil 354 self.loot_clean = nil
354 pprint('_f_o_e_d', "index",i,"somehow still in loop past",#g_loot,"bailing") 355 pprint('_f_o_e_d', "index",i,"somehow still in loop past",#g_loot,"bailing")
355 return 356 return
356 end 357 end
357 358
358 local display_bcast_from = OuroLootSV_opts.display_bcast_from 359 local display_bcast_from = self.db.profile.display_bcast_from
359 -- XXX FIXME a major weakness here is that we're constantly replacing 360 -- XXX FIXME a major weakness here is that we're constantly replacing
360 -- what's already been created. Lots of garbage. Trying to detect what 361 -- what's already been created. Lots of garbage. Trying to detect what
361 -- actually needs to be replaced is even worse. We'll live with 362 -- actually needs to be replaced is even worse. We'll live with
362 -- garbage for now. 363 -- garbage for now.
363 if e.kind == 'loot' then 364 if e.kind == 'loot' then
1412 st:OuroLoot_Refresh() 1413 st:OuroLoot_Refresh()
1413 st_widget:WrapST(st) 1414 st_widget:WrapST(st)
1414 st_widget.head_offset = 15 1415 st_widget.head_offset = 15
1415 st_widget.tail_offset = 0 1416 st_widget.tail_offset = 0
1416 1417
1417 if OuroLootSV_opts.scroll_to_bottom then 1418 if gui.opts.scroll_to_bottom then
1418 local scrollbar = _G[st.scrollframe:GetName().."ScrollBar"] 1419 local scrollbar = _G[st.scrollframe:GetName().."ScrollBar"]
1419 if scrollbar then 1420 if scrollbar then
1420 local _,max = scrollbar:GetMinMaxValues() 1421 local _,max = scrollbar:GetMinMaxValues()
1421 scrollbar:SetValue(max) -- also calls hooked Refresh 1422 scrollbar:SetValue(max) -- also calls hooked Refresh
1422 end 1423 end
1922 end 1923 end
1923 local status,err = pcall (tabs_OnGroupSelected[group], tabs, spec, group) 1924 local status,err = pcall (tabs_OnGroupSelected[group], tabs, spec, group)
1924 if not status then 1925 if not status then
1925 addon:horrible_horrible_error(err) 1926 addon:horrible_horrible_error(err)
1926 end 1927 end
1927 if OuroLootSV_opts.gui_noob then 1928 if gui.opts.gui_noob then
1928 local tip = noob_tips[group] 1929 local tip = noob_tips[group]
1929 if type(tip) == 'function' then 1930 if type(tip) == 'function' then
1930 tip = tip() 1931 tip = tip()
1931 end 1932 end
1932 if type(tip) == 'string' and tip ~= "" then 1933 if type(tip) == 'string' and tip ~= "" then
1999 if dirty_tabs then 2000 if dirty_tabs then
2000 -- pointers known to be good by now, pass them back in 2001 -- pointers known to be good by now, pass them back in
2001 self:gui_init (g_loot, g_uniques) 2002 self:gui_init (g_loot, g_uniques)
2002 self:zero_printed_fenceposts() 2003 self:zero_printed_fenceposts()
2003 end 2004 end
2005 gui.opts = self.db.profile
2004 2006
2005 local display = AceGUI:Create("Frame") 2007 local display = AceGUI:Create("Frame")
2006 _d = display 2008 _d = display
2007 self.display = display 2009 self.display = display
2008 display:SetTitle(window_title) 2010 display:SetTitle(window_title)
2391 if data.all_done then 2393 if data.all_done then
2392 -- It'll probably be the final entry in the table, but there might have 2394 -- It'll probably be the final entry in the table, but there might have
2393 -- been real loot happening while the user was clicking and typing. 2395 -- been real loot happening while the user was clicking and typing.
2394 local boss_index = addon._addBossEntry{ 2396 local boss_index = addon._addBossEntry{
2395 kind = 'boss', 2397 kind = 'boss',
2396 bossname = (OuroLootSV_opts.snarky_boss and addon.boss_abbrev[data.name] or data.name) or data.name, 2398 bossname = (gui.opts.snarky_boss and addon.boss_abbrev[data.name] or data.name) or data.name,
2397 reason = 'kill', 2399 reason = 'kill',
2398 instance = data.instance, 2400 instance = data.instance,
2399 duration = 0, 2401 duration = 0,
2400 maxsize = data.max_raid_size, 2402 maxsize = data.max_raid_size,
2401 raidersnap = data.yes_snap or {}, 2403 raidersnap = data.yes_snap or {},