Mercurial > wow > ouroloot
comparison LibFarmbuyer.lua @ 56:fcc0d0ff5832
- instance_tag() also returns max instance size as a plain number, adjust
call sites
- clean up .raiders table, add some new fields, use copies of this instead
of a single string
- make sure datarev field is properly updated when it's already present
- avoid multiple GetRaidRosterInfo loops scattered throughout the addon,
instead just traverse the .raiders list, regularly updated
- make the 'loot' and 'boss' broadcasts versioned. Handle receiving older.
- new format for plaintext attendance output
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Fri, 13 Apr 2012 04:28:46 +0000 |
parents | 7af58a7dce7d |
children | 81d5449621f8 |
comparison
equal
deleted
inserted
replaced
55:ac57a4342812 | 56:fcc0d0ff5832 |
---|---|
52 | 52 |
53 - new(...), del(t), copy(t), clear() | 53 - new(...), del(t), copy(t), clear() |
54 Ditto for table recycling. | 54 Ditto for table recycling. |
55 ]] | 55 ]] |
56 | 56 |
57 local MAJOR, MINOR = "LibFarmbuyer", 15 | 57 local MAJOR, MINOR = "LibFarmbuyer", 16 |
58 assert(LibStub,MAJOR.." requires LibStub") | 58 assert(LibStub,MAJOR.." requires LibStub") |
59 local lib = LibStub:NewLibrary(MAJOR, MINOR) | 59 local lib = LibStub:NewLibrary(MAJOR, MINOR) |
60 if not lib then return end | 60 if not lib then return end |
61 | 61 |
62 _G[MAJOR] = lib | 62 _G[MAJOR] = lib |
100 | 100 |
101 ---------------------------------------------------------------------- | 101 ---------------------------------------------------------------------- |
102 --[[ | 102 --[[ |
103 safeprint | 103 safeprint |
104 ]] | 104 ]] |
105 local tconcat = table.concat | 105 local tconcat, tostring, tonumber = table.concat, tostring, tonumber |
106 local function undocontrol(c) | 106 local function undocontrol(c) |
107 return ("\\%.3d"):format(c:byte()) | 107 return ("\\%.3d"):format(c:byte()) |
108 end | 108 end |
109 function lib.safeprint(...) | 109 function lib.safeprint(...) |
110 local args = { n=select('#',...), ... } | 110 local args = { n=select('#',...), ... } |
137 function lib.tableprint(t,f) | 137 function lib.tableprint(t,f) |
138 for i = 1, (tonumber(t.n) or #t) do | 138 for i = 1, (tonumber(t.n) or #t) do |
139 t[i] = tostring(t[i]):gsub('\124','\124\124') | 139 t[i] = tostring(t[i]):gsub('\124','\124\124') |
140 :gsub('(%c)', undocontrol) | 140 :gsub('(%c)', undocontrol) |
141 end | 141 end |
142 local msg = tconcat(t,' ', i, tonumber(t.n) or #t) | 142 local msg = tconcat(t,' ', 1, tonumber(t.n) or #t) |
143 if type(f) == 'function' then | 143 if type(f) == 'function' then |
144 return msg,f(msg) | 144 return msg,f(msg) |
145 else | 145 else |
146 print(msg) | 146 print(msg) |
147 return msg,t | 147 return msg,t |