Quantcast
Channel: Addons from WowAce.com
Viewing all articles
Browse latest Browse all 2479

LibFail-MoP

$
0
0

Next version of LibFail updated for Mists of Pandaria. It is still a library that detects failures at certain raid tasks.

In LibFail-MoP fail detection is very similar to how it was in LibFail-2.0. API calls are mostly the same as well with few improovements.

You can find a list of supported fails: here

This is an open repository. Feel free to add to it, and make fixes yourself.

API: http://www.wowace.com/projects/libfail-mop/pages/api/lib-fail-mop/

Make sure that LibFail-MoP dependencies are loaded before loading LibFail-MoP

Sample Code

local fail = LibStub("LibFail-MoP")
local failEvents = fail:GetSupportedEvents()
local LF = LibStub("AceLocale-3.0"):GetLocale("LibFail-MoP")

-- ... extra arguments such as spell used to trigger a barrier on Omnotron
local function onFail(failName, playerName, failType, ...)
	-- Get a localized string to be used as a name for the fail event
	local eventName = fail:GetEventName(failName) or ""

	-- Use either your own or one of the commonly used strings to print out the fail
	local failmsg = LF["%s fails at %s (%s)"]

	print( failmsg:format(playerName, failType, eventName) )
end

for _, event in ipairs(failEvents) do
	fail.RegisterCallback("SampleAddon", event, onFail)
end

Viewing all articles
Browse latest Browse all 2479

Trending Articles