-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First bit of rewrite for wrath, only handles priest fort currently
- Loading branch information
Showing
62 changed files
with
572 additions
and
22,936 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--[[ $Id: AceEvent-3.0.lua 60131 2008-02-03 13:03:56Z nevcairiel $ ]] | ||
local MAJOR, MINOR = "AceEvent-3.0", 3 | ||
local AceEvent = LibStub:NewLibrary(MAJOR, MINOR) | ||
|
||
if not AceEvent then return end | ||
|
||
local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") | ||
|
||
|
||
AceEvent.frame = AceEvent.frame or CreateFrame("Frame", "AceEvent30Frame") -- our event frame | ||
AceEvent.embeds = AceEvent.embeds or {} -- what objects embed this lib | ||
|
||
|
||
-- APIs and registry for blizzard events, using CallbackHandler lib | ||
if not AceEvent.events then | ||
AceEvent.events = CallbackHandler:New(AceEvent, | ||
"RegisterEvent", "UnregisterEvent", "UnregisterAllEvents") | ||
end | ||
|
||
function AceEvent.events:OnUsed(target, eventname) | ||
AceEvent.frame:RegisterEvent(eventname) | ||
end | ||
|
||
function AceEvent.events:OnUnused(target, eventname) | ||
AceEvent.frame:UnregisterEvent(eventname) | ||
end | ||
|
||
|
||
-- APIs and registry for IPC messages, using CallbackHandler lib | ||
if not AceEvent.messages then | ||
AceEvent.messages = CallbackHandler:New(AceEvent, | ||
"RegisterMessage", "UnregisterMessage", "UnregisterAllMessages" | ||
) | ||
AceEvent.SendMessage = AceEvent.messages.Fire | ||
end | ||
|
||
--- embedding and embed handling | ||
local mixins = { | ||
"RegisterEvent", "UnregisterEvent", | ||
"RegisterMessage", "UnregisterMessage", | ||
"SendMessage", | ||
"UnregisterAllEvents", "UnregisterAllMessages", | ||
} | ||
|
||
-- AceEvent:Embed( target ) | ||
-- target (object) - target object to embed AceEvent in | ||
-- | ||
-- Embeds AceEvent into the target object making the functions from the mixins list available on target:.. | ||
function AceEvent:Embed(target) | ||
for k, v in pairs(mixins) do | ||
target[v] = self[v] | ||
end | ||
self.embeds[target] = true | ||
return target | ||
end | ||
|
||
-- AceEvent:OnEmbedDisable( target ) | ||
-- target (object) - target object that is being disabled | ||
-- | ||
-- Unregister all events messages etc when the target disables. | ||
-- this method should be called by the target manually or by an addon framework | ||
function AceEvent:OnEmbedDisable(target) | ||
target:UnregisterAllEvents() | ||
target:UnregisterAllMessages() | ||
end | ||
|
||
-- Script to fire blizzard events into the event listeners | ||
local events = AceEvent.events | ||
AceEvent.frame:SetScript("OnEvent", function(this, event, ...) | ||
events:Fire(event, ...) | ||
end) | ||
|
||
--- Finally: upgrade our old embeds | ||
for target, v in pairs(AceEvent.embeds) do | ||
AceEvent:Embed(target) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ | ||
..\FrameXML\UI.xsd"> | ||
<Script file="AceEvent-3.0.lua"/> | ||
</Ui> |
Oops, something went wrong.