LibResInfo-1.0

API / Functions

UnitHasIncomingRes

Returns information about the resurrection available to the specified unit, or the resurrection spell that is currently being cast on the specified unit.

status, endTime, casterUnit, casterGUID = lib:UnitHasIncomingRes(unit)

Arguments

  • unit - string: unitID or unitGUID of the unit to query

Returns

  • status - string: the type of resurrection the unit has incoming, one of:
    • "SELFRES" if the unit has a soulstone available,
    • "PENDING" if the unit has a resurrection waiting to be accepted,
    • "CASTING" if the first resurrection that will land on the unit is a single-target resurrection spell, or
    • "MASSRES" if the first resurrection that will land on the unit is from Mass Resurrection.
  • endTime - number: the time when the unit's available resurrection will expire, or when the first casting resurrection spell targeting the unit will finish, comparable to GetTime()
  • casterUnit - string: the unitID of the unit casting the resurrection spell that will finish before any other resurrection spells targeting the same unit
  • casterGUID - string: the GUID of the unit casting the resurrection spell that will finish before any other resurrection spells targeting the same unit

All returns are nil if the unit does not have a resurrection available and is not the target of any casting resurrection spells.

UnitIsCastingRes

Returns information about the resurrection spell being cast by the specified unit.

endTime, targetUnit, targetGUID, isFirst = lib:UnitIsCastingRes(unit)

Arguments

  • unit - string: unitID or unitGUID of the unit to query

Returns

  • endTime - number: the time when the resurrection spell being cast by the unit will finish casting, comparable to GetTime()
  • targetUnit - string/nil: the unitID of the target of spell being cast by the unit, or nil if the unit is casting Mass Resurrection
  • targetGUID - string/nil: the GUID of the target of spell being cast by the unit, or nil if the unit is casting Mass Resurrection
  • isFirst - boolean: true if the unit's single-target spell will finish casting before any other resurrection spells targeting the same unit, or if the unit's Mass Resurrection will finish casting before any other Mass Resurrections

All returns are nil if the unit is not casting a resurrection spell.

RegisterCallback

Registers a function to handle the specified callback.

lib.RegisterCallback(handler, callback, method, arg)

Arguments

  • handler - table/string: your addon object or another table containing a function at handler[method], or a string identifying your addon
  • callback - string: the name of the callback you wish to register for; see the callbacks API documentation for a full list
  • method - string/function/nil: a key name containing the desired handler function in the method table, or a function to be called, or nil if handler is a table and a function exists at handler[callback]
  • arg - a value to be passed to the specified handler as its first argument

Notes

  • Note that this function must be called with a dot, not a colon.
  • If handler is a table, method is a string, and handler[method] is a function, then that function will be called with handler as its first argument, followed by the callback name and the callback-specific arguments.
  • If handler is a table, method is nil, and handler[callback] is a function, then that function will be called with handler as its first argument, followed by the callback name and the callback-specific arguments.
  • If handler is a string and method is a function, then that function will be called with the callback name as its first argument, followed by the callback-specific arguments.
  • If arg is non-nil, then it will be passed to the specified function. If handler is a table, then arg will be passed as the second argument, pushing the callback name to the third position. Otherwise, arg will be passed as the first argument.
  • Other cases will probably raise an error; see CallbackHandler-1.0 for more details.

RegisterAllCallbacks

Registers all callbacks at once, either with a single handler function for all, or individual handlers for each.

lib.RegisterAllCallbacks(handler, method, includeMassRes)

Arguments:

  • handler - table/string: your addon object or another table containing a function at handler[method], or a string identifying your addon
  • method - string/function/nil: a key name containing the desired handler function in the method table, or a function to be called, or nil if handler is a table and a function exists at handler[callback] for every callback
  • includeMassRes - boolean: true to register Mass Resurrection callbacks

Notes

  • Note that this function must be called with a dot, not a colon.
  • The handler and method parameters are identical to those passed to the ordinary RegisterCallback method.
  • Mass Resurrection callbacks are excluded by default for backwards compatibility with previous revisions, since they pass different arguments than ordinary resurrection callbacks.

UnregisterAllCallbacks

Unregisters all callbacks for the specified handler.

lib.UnregisterAllCallbacks(handler)

Arguments

  • handler - table/string: your addon object or another table containing your callback functions, or a string identifying your addon

Notes

  • Note that this function must be called with a dot, not a colon.
  • The handler value passed to this function should be the same table or string you passed when registering callbacks.

Facts

Date created
Aug 23, 2012
Last updated
Dec 21, 2013

Author