-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from MysteryDragon/add-rg-and-ka-mechs
Adding Rockgrove and some Kyne's Aegis trial mechanic announcements
- Loading branch information
Showing
9 changed files
with
567 additions
and
140 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# IntelliJ IDEA project files | ||
/.idea | ||
|
||
*.psd | ||
*.png |
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
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,69 @@ | ||
local EventArgumentBag = ZO_Object:Subclass() | ||
|
||
function EventArgumentBag:New() | ||
local object = ZO_Object.New(self) | ||
|
||
object.allEventArgs = {} | ||
|
||
return object | ||
end | ||
|
||
function EventArgumentBag:Push(args) | ||
table.insert(self.allEventArgs, args) | ||
end | ||
|
||
function EventArgumentBag:ContainsArgumentWithValue(name, value) | ||
for _, arguments in ipairs(self.allEventArgs) do | ||
if arguments[name] == value then | ||
return true | ||
end | ||
end | ||
|
||
return false | ||
end | ||
|
||
function EventArgumentBag:GetEventCount() | ||
return #self.allEventArgs | ||
end | ||
|
||
function EventArgumentBag:GetValues() | ||
return self.allEventArgs | ||
end | ||
|
||
function EventArgumentBag:GetArgValues(name) | ||
local values = {} | ||
|
||
for _, arguments in ipairs(self.allEventArgs) do | ||
table.insert(values, arguments[name]) | ||
end | ||
|
||
return values | ||
end | ||
|
||
local Handler = {} | ||
|
||
local eventStorage = {} | ||
|
||
function Handler.Add(name, arguments, releaseFunction, delayInMs) | ||
if eventStorage[name] == nil then | ||
eventStorage[name] = { | ||
callId = nil, | ||
argsBag = EventArgumentBag:New(), | ||
} | ||
end | ||
|
||
eventStorage[name].argsBag:Push(arguments) | ||
|
||
if eventStorage[name].callId == nil then | ||
eventStorage[name].callId = zo_callLater( | ||
function() | ||
releaseFunction(eventStorage[name].argsBag) | ||
eventStorage[name] = nil | ||
end, | ||
delayInMs | ||
) | ||
end | ||
end | ||
|
||
RaidNotifier = RaidNotifier or {} | ||
RaidNotifier.DelayedEventHandler = Handler |
Oops, something went wrong.