comparison Comments.lua @ 271:fbd94a0be29c

Fix for units.
author James D. Callahan III <jcallahan@curse.com>
date Thu, 21 Mar 2013 15:23:41 -0500
parents e1566483082c
children e9670d6c6bf1
comparison
equal deleted inserted replaced
270:e1566483082c 271:fbd94a0be29c
195 display = display:Release() 195 display = display:Release()
196 end 196 end
197 end) 197 end)
198 198
199 local function CreateComment(cell, func) 199 local function CreateComment(cell, func)
200 func() 200 if _G.type(func) == "table" then
201 func[1](func[2])
202 else
203 func()
204 end
201 display = display:Release() 205 display = display:Release()
202 end 206 end
203 207
204 local CURSOR_NAME_FUNCS = { 208 local CURSOR_NAME_FUNCS = {
205 item = function(id_num) 209 item = function(id_num)
247 if _G.UnitExists(unit_id) then 251 if _G.UnitExists(unit_id) then
248 local unit_type, unit_idnum = ParseGUID(_G.UnitGUID(unit_id)) 252 local unit_type, unit_idnum = ParseGUID(_G.UnitGUID(unit_id))
249 253
250 if unit_idnum then 254 if unit_idnum then
251 line = display:AddLine(("%s: %s"):format(unit_id:gsub("^%l", _G.string.upper), _G.UnitName(unit_id))) 255 line = display:AddLine(("%s: %s"):format(unit_id:gsub("^%l", _G.string.upper), _G.UnitName(unit_id)))
252 display:SetLineScript(line, "OnMouseUp", CreateComment, CreateUnitComment) 256 display:SetLineScript(line, "OnMouseUp", CreateComment, { CreateUnitComment, unit_id })
253 end 257 end
254 end 258 end
255 end 259 end
256 260
257 if _G.AchievementFrame and _G.AchievementFrame:IsShown() and _G.AchievementFrameAchievements.selection then 261 if _G.AchievementFrame and _G.AchievementFrame:IsShown() and _G.AchievementFrameAchievements.selection then