View Single Post
02-19-13, 03:54 AM   #77
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Originally Posted by Phanx View Post
I'm actually considering also removing the endTime and caster info out of callbacks, and have them provide only the target unit like most real events (eg. UNIT_HEALTH).
Something like this, perhaps?
Lua Code:
  1. function MyAddon:LibResInfo_ResCastStarted(targetUnit, targetGUID)
  2.     local hasIncomingRes, endTime, casterUnit, casterGUID = LibResInfo:UnitHasIncomingRes(targetUnit/targetGUID)
  3.     local spellName, _, _, icon = UnitCastingInfo(casterUnit)
  4.     -- do stuff
  5. end
That would cut down a great deal of duplication indeed.
  Reply With Quote