Skip to content

Commit

Permalink
Merge branch 'RMT-Encounters'
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarkehs committed Sep 5, 2016
2 parents 4b29a82 + a9ad8b3 commit 17ba8ca
Show file tree
Hide file tree
Showing 14 changed files with 826 additions and 223 deletions.
11 changes: 8 additions & 3 deletions Encounters/BossPrototype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ end
function EncounterPrototype:RegisterDatachronEvent(sSearchMessage, sMatch, fHandler)
assert(type(sSearchMessage) == "string")
assert(type(fHandler) == "function")
assert(sMatch == "MATCH" or sMatch == "FIND")
assert(sMatch == "MATCH" or sMatch == "FIND" or sMatch == "EQUAL")
sSearchMessage = self.L[sSearchMessage]
self.tDatachronEvents[sSearchMessage] = self.tDatachronEvents[sSearchMessage] or {}
table.insert(self.tDatachronEvents[sSearchMessage], {fHandler = fHandler, bMatch = sMatch == "MATCH"})
table.insert(self.tDatachronEvents[sSearchMessage], {fHandler = fHandler, sMatch = sMatch })
end

-- Register events to a single unit
Expand Down Expand Up @@ -131,12 +131,13 @@ end
-- @param sEnglishText English text to search in language dictionnary.
-- @param nDuration Timer duration.
-- @param bEmphasize Timer count down requested (nil take the default one).
-- @param sColor Color for the timer bar (nil take the default one)..
-- @param fHandler function to call on timeout
-- @param tClass Class used by callback action on timeout
-- @param tData Data forwarded by callback action on timeout
--
-- Note: If the English translation is not found, the current string will be used like that.
function EncounterPrototype:AddTimerBar(sKey, sEnglishText, nDuration, bEmphasize, fHandler, tClass, tData)
function EncounterPrototype:AddTimerBar(sKey, sEnglishText, nDuration, bEmphasize, sColor, fHandler, tClass, tData)
local tOptions = nil
local sLocalText = self.L[sEnglishText]
if self.tDefaultTimerBarsOptions[sKey] then
Expand All @@ -147,6 +148,10 @@ function EncounterPrototype:AddTimerBar(sKey, sEnglishText, nDuration, bEmphasiz
if bEmphasize ~= nil then
tOptions["bEmphasize"] = bEmphasize and true
end
if sColor ~= nil then
assert(type(sColor) == "string")
tOptions["sColor"] = sColor
end
local tCallback = nil
if type(fHandler) == "function" then
tCallback = {
Expand Down
Loading

0 comments on commit 17ba8ca

Please sign in to comment.