comparison core.lua @ 142:375059a11c1d 2.21.0

Updates for WoD. - Basic WoD changes (TOC bump, LE_* constants, etc) - The instance_abbrev table is now indexed by InstanceMapID values; the old method is still supported for transition. - Some initial placeholder values for WoD until we actually start seeing them.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Thu, 13 Nov 2014 22:12:33 -0500
parents c176359e7265
children 543fcf15add7
comparison
equal deleted inserted replaced
141:13d81d7faa0a 142:375059a11c1d
55 otherwise 55 otherwise
56 - itemname not including square brackets 56 - itemname not including square brackets
57 - id itemID as number 57 - id itemID as number
58 - itemlink full clickable link 58 - itemlink full clickable link
59 - itexture icon path (e.g., Interface\Icons\INV_Misc_Rune_01) 59 - itexture icon path (e.g., Interface\Icons\INV_Misc_Rune_01)
60 - quality ITEM_QUALITY_* number 60 - quality [LE_]ITEM_QUALITY_* number
61 - unique an almost-certainly-unique string, content meaningless 61 - unique an almost-certainly-unique string, content meaningless
62 - disposition offspec/gvault/shard; missing otherwise; can be set from 62 - disposition offspec/gvault/shard; missing otherwise; can be set from
63 the extratext field 63 the extratext field
64 - count e.g., "x3"; missing otherwise; can be set/removed from 64 - count e.g., "x3"; missing otherwise; can be set/removed from
65 extratext; triggers only for a stack of items, not "the boss 65 extratext; triggers only for a stack of items, not "the boss
292 292
293 -- don't use NUM_ITEM_QUALITIES as the upper loop bound unless we expect 293 -- don't use NUM_ITEM_QUALITIES as the upper loop bound unless we expect
294 -- heirlooms to show up 294 -- heirlooms to show up
295 thresholds = {} 295 thresholds = {}
296 for i = 0,6 do 296 for i = 0,6 do
297 thresholds[i] = _G.ITEM_QUALITY_COLORS[i].hex .. _G["ITEM_QUALITY"..i.."_DESC"] .. "|r" 297 thresholds[i] = _G.ITEM_QUALITY_COLORS[i].hex .. _G['ITEM_QUALITY'..i..'_DESC'] .. '|r'
298 end 298 end
299 299
300 _G.setfenv (1, _G) 300 _G.setfenv (1, _G)
301 end 301 end
302 302
438 print("Collecting hyperlink object <",tostring(ud),">") 438 print("Collecting hyperlink object <",tostring(ud),">")
439 end 439 end
440 --@end-debug@ 440 --@end-debug@
441 441
442 -- TEXT will automatically be surrounded by brackets 442 -- TEXT will automatically be surrounded by brackets
443 -- COLOR can be ITEM_QUALITY_* or a formatting string ("|cff...") 443 -- COLOR can be LE_ITEM_QUALITY_* or a formatting string ("|cff...")
444 -- FUNC can be "MethodName", "tab_title", or a function 444 -- FUNC can be "MethodName", "tab_title", or a function
445 -- 445 --
446 -- Returns an opaque token and a matching number. Calling tostring() on 446 -- Returns an opaque token and a matching number. Calling tostring() on
447 -- the token will yield a formatted clickable string that can be displayed 447 -- the token will yield a formatted clickable string that can be displayed
448 -- in local chat. Clicking a tab_title hyperlink opens the GUI to that 448 -- in local chat. Clicking a tab_title hyperlink opens the GUI to that
528 [9] = "40", 528 [9] = "40",
529 } 529 }
530 function instance_tag() 530 function instance_tag()
531 -- Return values of GetInstanceInfo changed considerably, now much 531 -- Return values of GetInstanceInfo changed considerably, now much
532 -- more useful and consistent. 532 -- more useful and consistent.
533 local name, typeof, diffcode, _, raidsize = GetInstanceInfo() 533 local name, typeof, diffcode, _, raidsize, _, _, mapid, currsize = GetInstanceInfo()
534 local t 534 local t
535 name = addon.instance_abbrev[name] or name 535 name = addon.instance_abbrev[mapid] or addon.instance_abbrev[name] or name
536 if typeof == nil or typeof == "none" or diffcode == 0 or diffcode == nil then 536 if typeof == nil or typeof == "none" or diffcode == 0 or diffcode == nil then
537 -- either outdoors or in a scenario (revisit those maybe) 537 -- either outdoors or in a scenario (revisit those maybe)
538 return name, MAX_RAID_MEMBERS 538 return name, MAX_RAID_MEMBERS
539 end 539 end
540 t = codemap[diffcode] or ("?"..diffcode.."?") 540 t = codemap[diffcode] or ("?"..diffcode.."?")
649 -- 2 bar 649 -- 2 bar
650 end 650 end
651 end 651 end
652 ]] 652 ]]
653 do 653 do
654 local AnimTimerFrame = CreateFrame('Frame',nil,nil) -- FIXME transition hack
654 local caches = {} 655 local caches = {}
655 local cleanup_group = AnimTimerFrame:CreateAnimationGroup() 656 local cleanup_group = AnimTimerFrame:CreateAnimationGroup()
656 local time, next = time, next 657 local time, next = time, next
657 local new, del = flib.new, flib.del 658 local new, del = flib.new, flib.del
658 cleanup_group:SetLooping("REPEAT") 659 cleanup_group:SetLooping("REPEAT")
758 self.callbacks = LibStub("CallbackHandler-1.0"):New(self) 759 self.callbacks = LibStub("CallbackHandler-1.0"):New(self)
759 --function self.callbacks:OnUsed (target_aka_self, eventname) end 760 --function self.callbacks:OnUsed (target_aka_self, eventname) end
760 --function self.callbacks:OnUnused (target_aka_self, eventname) end 761 --function self.callbacks:OnUnused (target_aka_self, eventname) end
761 762
762 if _G.OuroLootOptsDB == nil then 763 if _G.OuroLootOptsDB == nil then
763 local vclick = self.format_hypertext ([[click here]], ITEM_QUALITY_UNCOMMON, 'help') 764 local vclick = self.format_hypertext ([[click here]], LE_ITEM_QUALITY_UNCOMMON, 'help')
764 self:ScheduleTimer(function(s) 765 self:ScheduleTimer(function(s)
765 for id in pairs(self.default_itemfilter) do 766 for id in pairs(self.default_itemfilter) do
766 opts.itemfilter[id] = true 767 opts.itemfilter[id] = true
767 end 768 end
768 for id in pairs(self.default_itemvault) do 769 for id in pairs(self.default_itemvault) do
877 -- 878 --
878 -- Everything dealing with a prefix hyperlink is my fault. 879 -- Everything dealing with a prefix hyperlink is my fault.
879 -- 880 --
880 -- CFPrint added instead of the usual Print testing of the first arg for 881 -- CFPrint added instead of the usual Print testing of the first arg for
881 -- frame-ness, which would slow down all printing and only rarely be useful. 882 -- frame-ness, which would slow down all printing and only rarely be useful.
882 --
883 -- There is no ITEM_QUALITY_LEGENDARY constant. Sigh.
884 do 883 do
885 local AC = LibStub("AceConsole-3.0") 884 local AC = LibStub("AceConsole-3.0")
886 function addon.chatprefix (code, arg) 885 function addon.chatprefix (code, arg)
887 local f = '' -- empty -> BuildMainDisplay(empty) -> main tab 886 local f = '' -- empty -> BuildMainDisplay(empty) -> main tab
888 if code == "GoToLootLine" then 887 if code == "GoToLootLine" then
889 f = code 888 f = code
890 --elseif ..... 889 --elseif .....
891 end 890 end
892 local ret, num = self.format_hypertext ("Ouro Loot", --[[legendary]]5, f) 891 local ret, num = self.format_hypertext ("Ouro Loot",
892 LE_ITEM_QUALITY_LEGENDARY, f)
893 if code == "GoToLootLine" then 893 if code == "GoToLootLine" then
894 self.lootjumps[num] = arg 894 self.lootjumps[num] = arg
895 end 895 end
896 return ret, num 896 return ret, num
897 end 897 end
931 end 931 end
932 932
933 while opts.keybinding do 933 while opts.keybinding do
934 if InCombatLockdown() then 934 if InCombatLockdown() then
935 local reload = self.format_hypertext ([[the options tab]], 935 local reload = self.format_hypertext ([[the options tab]],
936 ITEM_QUALITY_UNCOMMON, 'opt') 936 LE_ITEM_QUALITY_UNCOMMON, 'opt')
937 self:Print("Cannot create '%s' as a keybinding while in combat!", 937 self:Print("Cannot create '%s' as a keybinding while in combat!",
938 opts.keybinding_text) 938 opts.keybinding_text)
939 self:Print("The rest of the addon will continue to work, but you will need to reload out of combat to get the keybinding. Either type /reload or use the button on %s in the lower right.", 939 self:Print("The rest of the addon will continue to work, but you will need to reload out of combat to get the keybinding. Either type /reload or use the button on %s in the lower right.",
940 tostring(reload)) 940 tostring(reload))
941 break 941 break
1195 tag string stored as 'unique' in loot entries and used as keys in history. 1195 tag string stored as 'unique' in loot entries and used as keys in history.
1196 Item IDs are always of numeric type. 1196 Item IDs are always of numeric type.
1197 1197
1198 'Activate', enabled_p, rebroadcast_p, threshold 1198 'Activate', enabled_p, rebroadcast_p, threshold
1199 The two boolean predicates are self-explanatory. The threshold is an 1199 The two boolean predicates are self-explanatory. The threshold is an
1200 ITEM_QUALITY_* constant integer. 1200 LE_ITEM_QUALITY_* constant integer.
1201 1201
1202 'Deactivate', raiderdata 1202 'Deactivate', raiderdata
1203 After all system events have been unregistered. Argument is a holder of 1203 After all system events have been unregistered. Argument is a holder of
1204 the current g_loot.raiders table (in 'raidersnap'). 1204 the current g_loot.raiders table (in 'raidersnap').
1205 1205
1623 local iname, ilink, iquality = GetItemInfo(itemid) 1623 local iname, ilink, iquality = GetItemInfo(itemid)
1624 local cache_miss 1624 local cache_miss
1625 if (not iname) or (not itexture) then 1625 if (not iname) or (not itexture) then
1626 cache_miss = true 1626 cache_miss = true
1627 iname, ilink, iquality, itexture = 1627 iname, ilink, iquality, itexture =
1628 UNKNOWN..': '..itemid, 'item:6948', ITEM_QUALITY_COMMON, [[Interface\ICONS\INV_Misc_QuestionMark]] 1628 UNKNOWN..': '..itemid, 'item:6948', LE_ITEM_QUALITY_COMMON, [[Interface\ICONS\INV_Misc_QuestionMark]]
1629 end 1629 end
1630 self.dprint('loot',">>"..prefix, "R:", recipient, "U:", unique, "I:", 1630 self.dprint('loot',">>"..prefix, "R:", recipient, "U:", unique, "I:",
1631 itemid, "C:", count, "frm:", from, "ex:", extratext, "q:", iquality) 1631 itemid, "C:", count, "frm:", from, "ex:", extratext, "q:", iquality)
1632 1632
1633 itemid = tonumber(ilink:match("item:(%d+)") or 0) 1633 itemid = tonumber(ilink:match("item:(%d+)") or 0)
1832 -- that would result in a pile of teensy functions, most of which would 1832 -- that would result in a pile of teensy functions, most of which would
1833 -- never be called. Too much overhead. (2.0: Most of these removed now 1833 -- never be called. Too much overhead. (2.0: Most of these removed now
1834 -- that GUI is in place.) 1834 -- that GUI is in place.)
1835 do 1835 do
1836 local green_help_link = addon.format_hypertext ([[Click here]], 1836 local green_help_link = addon.format_hypertext ([[Click here]],
1837 ITEM_QUALITY_UNCOMMON, 'help') 1837 LE_ITEM_QUALITY_UNCOMMON, 'help')
1838 function addon:OnSlash (txt) --, editbox) 1838 function addon:OnSlash (txt) --, editbox)
1839 txt = strtrim(txt:lower()) 1839 txt = strtrim(txt:lower())
1840 local cmd, arg = "" 1840 local cmd, arg = ""
1841 do 1841 do
1842 local s,e = txt:find("^%a+") 1842 local s,e = txt:find("^%a+")
2195 self:broadcast('revcheck',version_large) 2195 self:broadcast('revcheck',version_large)
2196 2196
2197 else 2197 else
2198 self.dprint('comm', "ours is older, (possibly) yammering") 2198 self.dprint('comm', "ours is older, (possibly) yammering")
2199 if newer_warning then 2199 if newer_warning then
2200 local pop = addon.format_hypertext ([[click here]], ITEM_QUALITY_UNCOMMON, 2200 local pop = addon.format_hypertext ([[click here]], LE_ITEM_QUALITY_UNCOMMON,
2201 function() 2201 function()
2202 -- Sadly, this is not generated by the packager, so hardcode it 2202 -- Sadly, this is not generated by the packager, so hardcode it
2203 -- for now. The 'data' field is handled differently for onshow 2203 -- for now. The 'data' field is handled differently for onshow
2204 -- than for other callbacks. 2204 -- than for other callbacks.
2205 StaticPopup_Show("OUROL_URL", 2205 StaticPopup_Show("OUROL_URL",
2206 --[[text_arg1=]]nil, --[[text_arg2=]]nil, 2206 --[[text_arg1=]]nil, --[[text_arg2=]]nil,
2207 --[[data=]][[http://www.curse.com/addons/wow/ouroloot]]) 2207 --[[data=]][[http://www.curse.com/addons/wow/ouroloot]])
2208 end) 2208 end)
2209 local ping = addon.format_hypertext ([[click here]], ITEM_QUALITY_UNCOMMON, 'DoPing') 2209 local ping = addon.format_hypertext ([[click here]], LE_ITEM_QUALITY_UNCOMMON, 'DoPing')
2210 self:Print(newer_warning, tostring(pop), tostring(ping)) 2210 self:Print(newer_warning, tostring(pop), tostring(ping))
2211 newer_warning = nil 2211 newer_warning = nil
2212 end 2212 end
2213 end 2213 end
2214 end 2214 end