Patch 3.9

This commit is contained in:
Athene
2015-05-29 23:33:04 +02:00
parent 73212ebe33
commit 8ea51a94d0
22 changed files with 6477 additions and 215 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,711 @@
--[[
Name: AceLibrary
Revision: $Rev: 11109 $
Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
Inspired By: Iriel (iriel@vigilance-committee.org)
Tekkub (tekkub@gmail.com)
Revision: $Rev: 11109 $
Website: http://www.wowace.com/
Documentation: http://www.wowace.com/index.php/AceLibrary
SVN: http://svn.wowace.com/root/trunk/Ace2/AceLibrary
Description: Versioning library to handle other library instances, upgrading,
and proper access.
It also provides a base for libraries to work off of, providing
proper error tools. It is handy because all the errors occur in the
file that called it, not in the library file itself.
Dependencies: None
]]
local ACELIBRARY_MAJOR = "AceLibrary"
local ACELIBRARY_MINOR = "$Revision: 11109 $"
-- CHANGE DEBUG TO ``false`` ON RELEASE -------------------
local DEBUG = true
-- CHANGE DEBUG TO ``false`` ON RELEASE -------------------
local _G = getfenv(0)
local previous = _G[ACELIBRARY_MAJOR]
if previous and not previous:IsNewVersion(ACELIBRARY_MAJOR, ACELIBRARY_MINOR) then return end
-- @table AceLibrary
-- @brief System to handle all versioning of libraries.
local AceLibrary = {}
local AceLibrary_mt = {}
setmetatable(AceLibrary, AceLibrary_mt)
local tmp
local function error(self, message, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
if type(self) ~= "table" then
_G.error(string.format("Bad argument #1 to `error' (table expected, got %s)", type(self)), 2)
end
if not tmp then
tmp = {}
else
for k in pairs(tmp) do tmp[k] = nil end
table.setn(tmp, 0)
end
tmp.n = 0
table.insert(tmp, a1)
table.insert(tmp, a2)
table.insert(tmp, a3)
table.insert(tmp, a4)
table.insert(tmp, a5)
table.insert(tmp, a6)
table.insert(tmp, a7)
table.insert(tmp, a8)
table.insert(tmp, a9)
table.insert(tmp, a10)
table.insert(tmp, a11)
table.insert(tmp, a12)
table.insert(tmp, a13)
table.insert(tmp, a14)
table.insert(tmp, a15)
table.insert(tmp, a16)
table.insert(tmp, a17)
table.insert(tmp, a18)
table.insert(tmp, a19)
table.insert(tmp, a20)
local stack = debugstack()
if not message then
local _,_,second = string.find(stack, "\n(.-)\n")
message = "error raised! " .. second
else
for i = 1,table.getn(tmp) do
tmp[i] = tostring(tmp[i])
end
for i = 1,10 do
table.insert(tmp, "nil")
end
message = string.format(message, unpack(tmp))
end
if getmetatable(self) and getmetatable(self).__tostring then
message = string.format("%s: %s", tostring(self), message)
elseif type(rawget(self, 'GetLibraryVersion')) == "function" and AceLibrary:HasInstance(self:GetLibraryVersion()) then
message = string.format("%s: %s", self:GetLibraryVersion(), message)
elseif type(rawget(self, 'class')) == "table" and type(rawget(self.class, 'GetLibraryVersion')) == "function" and AceLibrary:HasInstance(self.class:GetLibraryVersion()) then
message = string.format("%s: %s", self.class:GetLibraryVersion(), message)
end
local first = string.gsub(stack, "\n.*", "")
local file = string.gsub(first, ".*\\(.*).lua:%d+: .*", "%1")
file = string.gsub(file, "([%(%)%.%*%+%-%[%]%?%^%$%%])", "%%%1")
local i = 0
for s in string.gfind(stack, "\n([^\n]*)") do
i = i + 1
if not string.find(s, file .. "%.lua:%d+:") then
file = string.gsub(s, "^.*\\(.*).lua:%d+: .*", "%1")
file = string.gsub(file, "([%(%)%.%*%+%-%[%]%?%^%$%%])", "%%%1")
break
end
end
local j = 0
for s in string.gfind(stack, "\n([^\n]*)") do
j = j + 1
if j > i and not string.find(s, file .. "%.lua:%d+:") then
_G.error(message, j + 1)
return
end
end
_G.error(message, 2)
return
end
local function assert(self, condition, message, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
if not condition then
if not message then
local stack = debugstack()
local _,_,second = string.find(stack, "\n(.-)\n")
message = "assertion failed! " .. second
end
error(self, message, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
return
end
return condition
end
local function argCheck(self, arg, num, kind, kind2, kind3, kind4, kind5)
if type(num) ~= "number" then
error(self, "Bad argument #3 to `argCheck' (number expected, got %s)", type(num))
elseif type(kind) ~= "string" then
error(self, "Bad argument #4 to `argCheck' (string expected, got %s)", type(kind))
end
local errored = false
arg = type(arg)
if arg ~= kind and arg ~= kind2 and arg ~= kind3 and arg ~= kind4 and arg ~= kind5 then
local _,_,func = string.find(debugstack(), "`argCheck'.-([`<].-['>])")
if not func then
_,_,func = string.find(debugstack(), "([`<].-['>])")
end
if kind5 then
error(self, "Bad argument #%s to %s (%s, %s, %s, %s, or %s expected, got %s)", tonumber(num) or 0/0, func, kind, kind2, kind3, kind4, kind5, arg)
elseif kind4 then
error(self, "Bad argument #%s to %s (%s, %s, %s, or %s expected, got %s)", tonumber(num) or 0/0, func, kind, kind2, kind3, kind4, arg)
elseif kind3 then
error(self, "Bad argument #%s to %s (%s, %s, or %s expected, got %s)", tonumber(num) or 0/0, func, kind, kind2, kind3, arg)
elseif kind2 then
error(self, "Bad argument #%s to %s (%s or %s expected, got %s)", tonumber(num) or 0/0, func, kind, kind2, arg)
else
error(self, "Bad argument #%s to %s (%s expected, got %s)", tonumber(num) or 0/0, func, kind, arg)
end
end
end
local function pcall(self, func, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20 = _G.pcall(func, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
if not a1 then
error(self, string.gsub(a2, ".-%.lua:%d-: ", ""))
else
return a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20
end
end
local recurse = {}
local function addToPositions(t, major)
if not AceLibrary.positions[t] or AceLibrary.positions[t] == major then
rawset(t, recurse, true)
AceLibrary.positions[t] = major
for k,v in pairs(t) do
if type(v) == "table" and not rawget(v, recurse) then
addToPositions(v, major)
end
if type(k) == "table" and not rawget(k, recurse) then
addToPositions(k, major)
end
end
local mt = getmetatable(t)
if mt and not rawget(mt, recurse) then
addToPositions(mt, major)
end
rawset(t, recurse, nil)
end
end
local function svnRevisionToNumber(text)
if type(text) == "string" then
if string.find(text, "^%$Revision: (%d+) %$$") then
return tonumber((string.gsub(text, "^%$Revision: (%d+) %$$", "%1")))
elseif string.find(text, "^%$Rev: (%d+) %$$") then
return tonumber((string.gsub(text, "^%$Rev: (%d+) %$$", "%1")))
elseif string.find(text, "^%$LastChangedRevision: (%d+) %$$") then
return tonumber((string.gsub(text, "^%$LastChangedRevision: (%d+) %$$", "%1")))
end
elseif type(text) == "number" then
return text
end
return nil
end
local crawlReplace
do
local recurse = {}
local function func(t, to, from)
if recurse[t] then
return
end
recurse[t] = true
local mt = getmetatable(t)
setmetatable(t, nil)
rawset(t, to, rawget(t, from))
rawset(t, from, nil)
for k,v in pairs(t) do
if v == from then
t[k] = to
elseif type(v) == "table" then
if not recurse[v] then
func(v, to, from)
end
end
if type(k) == "table" then
if not recurse[k] then
func(k, to, from)
end
end
end
setmetatable(t, mt)
if mt then
if mt == from then
setmetatable(t, to)
elseif not recurse[mt] then
func(mt, to, from)
end
end
end
function crawlReplace(t, to, from)
func(t, to, from)
for k in pairs(recurse) do
recurse[k] = nil
end
end
end
-- @function destroyTable
-- @brief remove all the contents of a table
-- @param t table to destroy
local function destroyTable(t)
setmetatable(t, nil)
for k,v in pairs(t) do t[k] = nil end
table.setn(t, 0)
end
local function isFrame(frame)
return type(frame) == "table" and type(rawget(frame, 0)) == "userdata" and type(rawget(frame, 'IsFrameType')) == "function" and getmetatable(frame) and type(rawget(getmetatable(frame), '__index')) == "function"
end
local new, del
do
local tables = setmetatable({}, {__mode = "k"})
function new()
local t = next(tables)
if t then
tables[t] = nil
return t
else
return {}
end
end
function del(t, depth)
if depth and depth > 0 then
for k,v in pairs(t) do
if type(v) == "table" and not isFrame(v) then
del(v, depth - 1)
end
end
end
destroyTable(t)
tables[t] = true
end
end
-- @function copyTable
-- @brief Create a shallow copy of a table and return it.
-- @param from The table to copy from
-- @return A shallow copy of the table
local function copyTable(from)
local to = new()
for k,v in pairs(from) do to[k] = v end
table.setn(to, table.getn(from))
setmetatable(to, getmetatable(from))
return to
end
-- @function deepTransfer
-- @brief Fully transfer all data, keeping proper previous table
-- backreferences stable.
-- @param to The table with which data is to be injected into
-- @param from The table whose data will be injected into the first
-- @param saveFields If available, a shallow copy of the basic data is saved
-- in here.
-- @param list The account of table references
-- @param list2 The current status on which tables have been traversed.
local deepTransfer
do
-- @function examine
-- @brief Take account of all the table references to be shared
-- between the to and from tables.
-- @param to The table with which data is to be injected into
-- @param from The table whose data will be injected into the first
-- @param list An account of the table references
local function examine(to, from, list, major)
list[from] = to
for k,v in pairs(from) do
if rawget(to, k) and type(from[k]) == "table" and type(to[k]) == "table" and not list[from[k]] then
if from[k] == to[k] then
list[from[k]] = to[k]
elseif AceLibrary.positions[from[v]] ~= major and AceLibrary.positions[from[v]] then
list[from[k]] = from[k]
elseif not list[from[k]] then
examine(to[k], from[k], list, major)
end
end
end
return list
end
function deepTransfer(to, from, saveFields, major, list, list2)
setmetatable(to, nil)
local createdList
if not list then
createdList = true
list = new()
list2 = new()
examine(to, from, list, major)
end
list2[to] = to
for k,v in pairs(to) do
if type(rawget(from, k)) ~= "table" or type(v) ~= "table" or isFrame(v) then
if saveFields then
saveFields[k] = v
end
to[k] = nil
elseif v ~= _G then
if saveFields then
saveFields[k] = copyTable(v)
end
end
end
for k in pairs(from) do
if rawget(to, k) and to[k] ~= from[k] and AceLibrary.positions[to[k]] == major and from[k] ~= _G then
if not list2[to[k]] then
deepTransfer(to[k], from[k], nil, major, list, list2)
end
to[k] = list[to[k]] or list2[to[k]]
else
rawset(to, k, from[k])
end
end
table.setn(to, table.getn(from))
setmetatable(to, getmetatable(from))
local mt = getmetatable(to)
if mt then
if list[mt] then
setmetatable(to, list[mt])
elseif mt.__index and list[mt.__index] then
mt.__index = list[mt.__index]
end
end
destroyTable(from)
if createdList then
del(list)
del(list2)
end
end
end
-- @method IsNewVersion
-- @brief Obtain whether the supplied version would be an upgrade to the
-- current version. This allows for bypass code in library
-- declaration.
-- @param major A string representing the major version
-- @param minor An integer or an svn revision string representing the minor version
-- @return whether the supplied version would be newer than what is
-- currently available.
function AceLibrary:IsNewVersion(major, minor)
argCheck(self, major, 2, "string")
if type(minor) == "string" then
local m = svnRevisionToNumber(minor)
if m then
minor = m
else
_G.error(string.format("Bad argument #3 to `IsNewVersion'. Must be a number or SVN revision string. %q is not appropriate", minor), 2)
end
end
argCheck(self, minor, 3, "number")
local data = self.libs[major]
if not data then
return true
end
return data.minor < minor
end
-- @method HasInstance
-- @brief Returns whether an instance exists. This allows for optional support of a library.
-- @param major A string representing the major version.
-- @param minor (optional) An integer or an svn revision string representing the minor version.
-- @return Whether an instance exists.
function AceLibrary:HasInstance(major, minor)
argCheck(self, major, 2, "string")
if minor then
if type(minor) == "string" then
local m = svnRevisionToNumber(minor)
if m then
minor = m
else
_G.error(string.format("Bad argument #3 to `HasInstance'. Must be a number or SVN revision string. %q is not appropriate", minor), 2)
end
end
argCheck(self, minor, 3, "number")
if not self.libs[major] then
return
end
return self.libs[major].minor == minor
end
return self.libs[major] and true
end
-- @method GetInstance
-- @brief Returns the library with the given major/minor version.
-- @param major A string representing the major version.
-- @param minor (optional) An integer or an svn revision string representing the minor version.
-- @return The library with the given major/minor version.
function AceLibrary:GetInstance(major, minor)
argCheck(self, major, 2, "string")
local data = self.libs[major]
if not data then
_G.error(string.format("Cannot find a library instance of %s.", major), 2)
return
end
if minor then
if type(minor) == "string" then
local m = svnRevisionToNumber(minor)
if m then
minor = m
else
_G.error(string.format("Bad argument #3 to `GetInstance'. Must be a number or SVN revision string. %q is not appropriate", minor), 2)
end
end
argCheck(self, minor, 2, "number")
if data.minor ~= minor then
_G.error(string.format("Cannot find a library instance of %s, minor version %d.", major, minor), 2)
return
end
end
return data.instance
end
-- Syntax sugar. AceLibrary("FooBar-1.0")
AceLibrary_mt.__call = AceLibrary.GetInstance
local donothing
local AceEvent
-- @method Register
-- @brief Registers a new version of a given library.
-- @param newInstance the library to register
-- @param major the major version of the library
-- @param minor the minor version of the library
-- @param activateFunc (optional) A function to be called when the library is
-- fully activated. Takes the arguments
-- (newInstance [, oldInstance, oldDeactivateFunc]). If
-- oldInstance is given, you should probably call
-- oldDeactivateFunc(oldInstance).
-- @param deactivateFunc (optional) A function to be called by a newer library's
-- activateFunc.
-- @param externalFunc (optional) A function to be called whenever a new
-- library is registered.
function AceLibrary:Register(newInstance, major, minor, activateFunc, deactivateFunc, externalFunc)
argCheck(self, newInstance, 2, "table")
argCheck(self, major, 3, "string")
if type(minor) == "string" then
local m = svnRevisionToNumber(minor)
if m then
minor = m
else
_G.error(string.format("Bad argument #4 to `Register'. Must be a number or SVN revision string. %q is not appropriate", minor), 2)
end
end
argCheck(self, minor, 4, "number")
if math.floor(minor) ~= minor or minor < 0 then
error(self, "Bad argument #4 to `Register' (integer >= 0 expected, got %s)", minor)
end
argCheck(self, activateFunc, 5, "function", "nil")
argCheck(self, deactivateFunc, 6, "function", "nil")
argCheck(self, externalFunc, 7, "function", "nil")
if not deactivateFunc then
if not donothing then
donothing = function() end
end
deactivateFunc = donothing
end
local data = self.libs[major]
if not data then
-- This is new
local instance = copyTable(newInstance)
crawlReplace(instance, instance, newInstance)
destroyTable(newInstance)
if AceLibrary == newInstance then
self = instance
AceLibrary = instance
end
self.libs[major] = {
instance = instance,
minor = minor,
deactivateFunc = deactivateFunc,
externalFunc = externalFunc,
}
rawset(instance, 'GetLibraryVersion', function(self)
return major, minor
end)
if not rawget(instance, 'error') then
rawset(instance, 'error', error)
end
if not rawget(instance, 'assert') then
rawset(instance, 'assert', assert)
end
if not rawget(instance, 'argCheck') then
rawset(instance, 'argCheck', argCheck)
end
if not rawget(instance, 'pcall') then
rawset(instance, 'pcall', pcall)
end
addToPositions(instance, major)
if activateFunc then
activateFunc(instance, nil, nil) -- no old version, so explicit nil
end
if externalFunc then
for k,data in pairs(self.libs) do
if k ~= major then
externalFunc(instance, k, data.instance)
end
end
end
for k,data in pairs(self.libs) do
if k ~= major and data.externalFunc then
data.externalFunc(data.instance, major, instance)
end
end
if major == "AceEvent-2.0" then
AceEvent = instance
end
if AceEvent then
AceEvent.TriggerEvent(self, "AceLibrary_Register", major, instance)
end
return instance
end
local instance = data.instance
if minor <= data.minor then
if DEBUG then
-- This one is already obsolete, raise an error.
error(string.format("Obsolete library registered. %s is already registered at version %d. You are trying to register version %d. Hint: if not AceLibrary:IsNewVersion(%q, %d) then return end", major, data.minor, minor, major, minor), 2)
return
end
return instance
end
-- This is an update
local oldInstance = new()
addToPositions(newInstance, major)
local isAceLibrary = (AceLibrary == newInstance)
local old_error, old_assert, old_argCheck, old_pcall
if isAceLibrary then
self = instance
AceLibrary = instance
old_error = instance.error
old_assert = instance.assert
old_argCheck = instance.argCheck
old_pcall = instance.pcall
self.error = error
self.assert = assert
self.argCheck = argCheck
self.pcall = pcall
end
deepTransfer(instance, newInstance, oldInstance, major)
crawlReplace(instance, instance, newInstance)
local oldDeactivateFunc = data.deactivateFunc
data.minor = minor
data.deactivateFunc = deactivateFunc
data.externalFunc = externalFunc
rawset(instance, 'GetLibraryVersion', function(self)
return major, minor
end)
if not rawget(instance, 'error') then
rawset(instance, 'error', error)
end
if not rawget(instance, 'assert') then
rawset(instance, 'assert', assert)
end
if not rawget(instance, 'argCheck') then
rawset(instance, 'argCheck', argCheck)
end
if not rawget(instance, 'pcall') then
rawset(instance, 'pcall', pcall)
end
if isAceLibrary then
for _,v in pairs(self.libs) do
local i = type(v) == "table" and v.instance
if type(i) == "table" then
if not rawget(i, 'error') or i.error == old_error then
rawset(i, 'error', error)
end
if not rawget(i, 'assert') or i.assert == old_assert then
rawset(i, 'assert', assert)
end
if not rawget(i, 'argCheck') or i.argCheck == old_argCheck then
rawset(i, 'argCheck', argCheck)
end
if not rawget(i, 'pcall') or i.pcall == old_pcall then
rawset(i, 'pcall', pcall)
end
end
end
end
if activateFunc then
activateFunc(instance, oldInstance, oldDeactivateFunc)
else
oldDeactivateFunc(oldInstance)
end
del(oldInstance)
if externalFunc then
for k,data in pairs(self.libs) do
if k ~= major then
externalFunc(instance, k, data.instance)
end
end
end
return instance
end
local iter
function AceLibrary:IterateLibraries()
if not iter then
local function iter(t, k)
k = next(t, k)
if not k then
return nil
else
return k, t[k].instance
end
end
end
return iter, self.libs, nil
end
-- @function Activate
-- @brief The activateFunc for AceLibrary itself. Called when
-- AceLibrary properly registers.
-- @param self Reference to AceLibrary
-- @param oldLib (optional) Reference to an old version of AceLibrary
-- @param oldDeactivate (optional) Function to deactivate the old lib
local function activate(self, oldLib, oldDeactivate)
if not self.libs then
if oldLib then
self.libs = oldLib.libs
end
if not self.libs then
self.libs = {}
end
end
if not self.positions then
if oldLib then
self.positions = oldLib.positions
end
if not self.positions then
self.positions = setmetatable({}, { __mode = "k" })
end
end
-- Expose the library in the global environment
_G[ACELIBRARY_MAJOR] = self
if oldDeactivate then
oldDeactivate(oldLib)
end
end
if not previous then
previous = AceLibrary
end
if not previous.libs then
previous.libs = {}
end
AceLibrary.libs = previous.libs
if not previous.positions then
previous.positions = setmetatable({}, { __mode = "k" })
end
AceLibrary.positions = previous.positions
AceLibrary:Register(AceLibrary, ACELIBRARY_MAJOR, ACELIBRARY_MINOR, activate)
@@ -0,0 +1,537 @@
--[[
Name: AceLocale-2.2
Revision: $Rev: 15291 $
Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
Inspired By: Ace 1.x by Turan (turan@gryphon.com)
Website: http://www.wowace.com/
Documentation: http://www.wowace.com/index.php/AceLocale-2.2
SVN: http://svn.wowace.com/root/trunk/Ace2/AceLocale-2.2
Description: Localization library for addons to use to handle proper
localization and internationalization.
Dependencies: AceLibrary
]]
local MAJOR_VERSION = "AceLocale-2.2"
local MINOR_VERSION = "$Revision: 15291 $"
if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary.") end
if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
local AceLocale = {}
local DEFAULT_LOCALE = "enUS"
local _G = getfenv(0)
local BASE_TRANSLATIONS, DEBUGGING, TRANSLATIONS, BASE_LOCALE, TRANSLATION_TABLES, REVERSE_TRANSLATIONS, STRICTNESS, DYNAMIC_LOCALES, CURRENT_LOCALE, NAME
local rawget = rawget
local rawset = rawset
local type = type
local newRegistries = {}
local scheduleClear
local lastSelf
local __index = function(self, key)
lastSelf = self
local value = (rawget(self, TRANSLATIONS) or AceLocale.prototype)[key]
rawset(self, key, value)
return value
end
local __newindex = function(self, k, v)
if type(v) ~= "function" and type(k) ~= "table" then
AceLocale.error(self, "Cannot change the values of an AceLocale instance.")
end
rawset(self, k, v)
end
local __tostring = function(self)
if type(rawget(self, 'GetLibraryVersion')) == "function" then
return self:GetLibraryVersion()
else
return "AceLocale(" .. self[NAME] .. ")"
end
end
local function clearCache(self)
if not rawget(self, BASE_TRANSLATIONS) then
return
end
local cache = self[BASE_TRANSLATIONS]
rawset(self, REVERSE_TRANSLATIONS, nil)
for k in pairs(self) do
if rawget(cache, k) ~= nil then
self[k] = nil
end
end
rawset(self, 'tmp', true)
self.tmp = nil
end
local function refixInstance(instance)
if getmetatable(instance) then
setmetatable(instance, nil)
end
local translations = instance[TRANSLATIONS]
if translations then
if getmetatable(translations) then
setmetatable(translations, nil)
end
local baseTranslations = instance[BASE_TRANSLATIONS]
if getmetatable(baseTranslations) then
setmetatable(baseTranslations, nil)
end
if translations == baseTranslations or instance[STRICTNESS] then
setmetatable(instance, {
__index = __index,
__newindex = __newindex,
__tostring = __tostring
})
setmetatable(translations, {
__index = AceLocale.prototype
})
else
setmetatable(instance, {
__index = __index,
__newindex = __newindex,
__tostring = __tostring
})
setmetatable(translations, {
__index = baseTranslations,
})
setmetatable(baseTranslations, {
__index = AceLocale.prototype,
})
end
else
setmetatable(instance, {
__index = __index,
__newindex = __newindex,
__tostring = __tostring,
})
end
clearCache(instance)
newRegistries[instance] = true
scheduleClear()
return instance
end
function AceLocale:new(name)
self:argCheck(name, 2, "string")
if self.registry[name] and type(rawget(self.registry[name], 'GetLibraryVersion')) ~= "function" then
return self.registry[name]
end
AceLocale.registry[name] = refixInstance({
[STRICTNESS] = false,
[NAME] = name,
})
newRegistries[AceLocale.registry[name]] = true
return AceLocale.registry[name]
end
AceLocale.prototype = { class = AceLocale }
function AceLocale.prototype:EnableDebugging()
if rawget(self, BASE_TRANSLATIONS) then
AceLocale.error(self, "Cannot enable debugging after a translation has been registered.")
end
rawset(self, DEBUGGING, true)
end
function AceLocale.prototype:EnableDynamicLocales(override)
AceLocale.argCheck(self, override, 2, "boolean", "nil")
if not override and rawget(self, BASE_TRANSLATIONS) then
AceLocale.error(self, "Cannot enable dynamic locales after a translation has been registered.")
end
if not rawget(self, DYNAMIC_LOCALES) then
rawset(self, DYNAMIC_LOCALES, true)
if rawget(self, BASE_LOCALE) then
if not rawget(self, TRANSLATION_TABLES) then
rawset(self, TRANSLATION_TABLES, {})
end
self[TRANSLATION_TABLES][self[BASE_LOCALE]] = self[BASE_TRANSLATIONS]
self[TRANSLATION_TABLES][self[CURRENT_LOCALE]] = self[TRANSLATIONS]
end
end
end
function AceLocale.prototype:RegisterTranslations(locale, func)
AceLocale.argCheck(self, locale, 2, "string")
AceLocale.argCheck(self, func, 3, "function")
if locale == rawget(self, BASE_LOCALE) then
AceLocale.error(self, "Cannot provide the same locale more than once. %q provided twice.", locale)
end
if rawget(self, BASE_TRANSLATIONS) and GetLocale() ~= locale then
if rawget(self, DEBUGGING) or rawget(self, DYNAMIC_LOCALES) then
if not rawget(self, TRANSLATION_TABLES) then
rawset(self, TRANSLATION_TABLES, {})
end
if self[TRANSLATION_TABLES][locale] then
AceLocale.error(self, "Cannot provide the same locale more than once. %q provided twice.", locale)
end
local t = func()
func = nil
if type(t) ~= "table" then
AceLocale.error(self, "Bad argument #3 to `RegisterTranslations'. function did not return a table. (expected table, got %s)", type(t))
end
self[TRANSLATION_TABLES][locale] = t
t = nil
end
func = nil
return
end
local t = func()
func = nil
if type(t) ~= "table" then
AceLocale.error(self, "Bad argument #3 to `RegisterTranslations'. function did not return a table. (expected table, got %s)", type(t))
end
rawset(self, TRANSLATIONS, t)
if not rawget(self, BASE_TRANSLATIONS) then
rawset(self, BASE_TRANSLATIONS, t)
rawset(self, BASE_LOCALE, locale)
for key,value in pairs(t) do
if value == true then
t[key] = key
end
end
else
for key, value in pairs(self[TRANSLATIONS]) do
if not rawget(self[BASE_TRANSLATIONS], key) then
AceLocale.error(self, "Improper translation exists. %q is likely misspelled for locale %s.", key, locale)
end
if value == true then
AceLocale.error(self, "Can only accept true as a value on the base locale. %q is the base locale, %q is not.", rawget(self, BASE_LOCALE), locale)
end
end
end
rawset(self, CURRENT_LOCALE, locale)
refixInstance(self)
if rawget(self, DEBUGGING) or rawget(self, DYNAMIC_LOCALES) then
if not rawget(self, TRANSLATION_TABLES) then
rawset(self, TRANSLATION_TABLES, {})
end
self[TRANSLATION_TABLES][locale] = t
end
t = nil
end
function AceLocale.prototype:SetLocale(locale)
AceLocale.argCheck(self, locale, 2, "string", "boolean")
if not rawget(self, DYNAMIC_LOCALES) then
AceLocale.error(self, "Cannot call `SetLocale' without first calling `EnableDynamicLocales'.")
end
if not rawget(self, TRANSLATION_TABLES) then
AceLocale.error(self, "Cannot call `SetLocale' without first calling `RegisterTranslations'.")
end
if locale == true then
locale = GetLocale()
if not self[TRANSLATION_TABLES][locale] then
locale = self[BASE_LOCALE]
end
end
if self[CURRENT_LOCALE] == locale then
return
end
if not self[TRANSLATION_TABLES][locale] then
AceLocale.error(self, "Locale %q not registered.", locale)
end
self[TRANSLATIONS] = self[TRANSLATION_TABLES][locale]
self[CURRENT_LOCALE] = locale
refixInstance(self)
end
function AceLocale.prototype:GetLocale()
if not rawget(self, TRANSLATION_TABLES) then
AceLocale.error(self, "Cannot call `GetLocale' without first calling `RegisterTranslations'.")
end
return self[CURRENT_LOCALE]
end
local function iter(t, position)
return (next(t, position))
end
function AceLocale.prototype:IterateAvailableLocales()
if not rawget(self, DYNAMIC_LOCALES) then
AceLocale.error(self, "Cannot call `IterateAvailableLocales' without first calling `EnableDynamicLocales'.")
end
if not rawget(self, TRANSLATION_TABLES) then
AceLocale.error(self, "Cannot call `IterateAvailableLocales' without first calling `RegisterTranslations'.")
end
return iter, self[TRANSLATION_TABLES], nil
end
function AceLocale.prototype:HasLocale(locale)
if not rawget(self, DYNAMIC_LOCALES) then
AceLocale.error(self, "Cannot call `HasLocale' without first calling `EnableDynamicLocales'.")
end
AceLocale.argCheck(self, locale, 2, "string")
return rawget(self, TRANSLATION_TABLES) and self[TRANSLATION_TABLES][locale] ~= nil
end
function AceLocale.prototype:SetStrictness(strict)
AceLocale.argCheck(self, strict, 2, "boolean")
local mt = getmetatable(self)
if not mt then
AceLocale.error(self, "Cannot call `SetStrictness' without a metatable.")
end
if not rawget(self, TRANSLATIONS) then
AceLocale.error(self, "No translations registered.")
end
rawset(self, STRICTNESS, strict)
refixInstance(self)
end
local function initReverse(self)
rawset(self, REVERSE_TRANSLATIONS, {})
local alpha = self[TRANSLATIONS]
local bravo = self[REVERSE_TRANSLATIONS]
for base, localized in pairs(alpha) do
bravo[localized] = base
end
end
function AceLocale.prototype:GetTranslation(text)
AceLocale.argCheck(self, text, 1, "string", "number")
if not rawget(self, TRANSLATIONS) then
AceLocale.error(self, "No translations registered")
end
return self[text]
end
function AceLocale.prototype:GetStrictTranslation(text)
AceLocale.argCheck(self, text, 1, "string", "number")
local x = rawget(self, TRANSLATIONS)
if not x then
AceLocale.error(self, "No translations registered")
end
local value = rawget(x, text)
if value == nil then
AceLocale.error(self, "Translation %q does not exist for locale %s", text, self[CURRENT_LOCALE])
end
return value
end
function AceLocale.prototype:GetReverseTranslation(text)
local x = rawget(self, REVERSE_TRANSLATIONS)
if not x then
if not rawget(self, TRANSLATIONS) then
AceLocale.error(self, "No translations registered")
end
initReverse(self)
x = self[REVERSE_TRANSLATIONS]
end
local translation = x[text]
if not translation then
AceLocale.error(self, "Reverse translation for %q does not exist", text)
end
return translation
end
function AceLocale.prototype:GetIterator()
local x = rawget(self, TRANSLATIONS)
if not x then
AceLocale.error(self, "No translations registered")
end
return next, x, nil
end
function AceLocale.prototype:GetReverseIterator()
local x = rawget(self, REVERSE_TRANSLATIONS)
if not x then
if not rawget(self, TRANSLATIONS) then
AceLocale.error(self, "No translations registered")
end
initReverse(self)
x = self[REVERSE_TRANSLATIONS]
end
return next, x, nil
end
function AceLocale.prototype:HasTranslation(text)
AceLocale.argCheck(self, text, 1, "string", "number")
local x = rawget(self, TRANSLATIONS)
if not x then
AceLocale.error(self, "No translations registered")
end
return rawget(x, text) and true
end
function AceLocale.prototype:HasReverseTranslation(text)
local x = rawget(self, REVERSE_TRANSLATIONS)
if not x then
if not rawget(self, TRANSLATIONS) then
AceLocale.error(self, "No translations registered")
end
initReverse(self)
x = self[REVERSE_TRANSLATIONS]
end
return x[text] and true
end
function AceLocale.prototype:Debug()
if not rawget(self, DEBUGGING) then
return
end
local words = {}
local locales = {"enUS", "deDE", "frFR", "koKR", "zhCN", "zhTW", "esES"}
local localizations = {}
DEFAULT_CHAT_FRAME:AddMessage("--- AceLocale Debug ---")
for _,locale in ipairs(locales) do
if not self[TRANSLATION_TABLES][locale] then
DEFAULT_CHAT_FRAME:AddMessage(string.format("Locale %q not found", locale))
else
localizations[locale] = self[TRANSLATION_TABLES][locale]
end
end
local localeDebug = {}
for locale, localization in pairs(localizations) do
localeDebug[locale] = {}
for word in pairs(localization) do
if type(localization[word]) == "table" then
if type(words[word]) ~= "table" then
words[word] = {}
end
for bit in pairs(localization[word]) do
if type(localization[word][bit]) == "string" then
words[word][bit] = true
end
end
elseif type(localization[word]) == "string" then
words[word] = true
end
end
end
for word in pairs(words) do
if type(words[word]) == "table" then
for bit in pairs(words[word]) do
for locale, localization in pairs(localizations) do
if not rawget(localization, word) or not localization[word][bit] then
localeDebug[locale][word .. "::" .. bit] = true
end
end
end
else
for locale, localization in pairs(localizations) do
if not rawget(localization, word) then
localeDebug[locale][word] = true
end
end
end
end
for locale, t in pairs(localeDebug) do
if not next(t) then
DEFAULT_CHAT_FRAME:AddMessage(string.format("Locale %q complete", locale))
else
DEFAULT_CHAT_FRAME:AddMessage(string.format("Locale %q missing:", locale))
for word in pairs(t) do
DEFAULT_CHAT_FRAME:AddMessage(string.format(" %q", word))
end
end
end
DEFAULT_CHAT_FRAME:AddMessage("--- End AceLocale Debug ---")
end
setmetatable(AceLocale.prototype, {
__index = function(self, k)
if type(k) ~= "table" and k ~= 0 and k ~= "GetLibraryVersion" and k ~= "error" and k ~= "assert" and k ~= "argCheck" and k ~= "pcall" then -- HACK: remove "GetLibraryVersion" and such later.
AceLocale.error(lastSelf or self, "Translation %q does not exist.", k)
end
return nil
end
})
local function activate(self, oldLib, oldDeactivate)
AceLocale = self
self.frame = oldLib and oldLib.frame or CreateFrame("Frame")
self.registry = oldLib and oldLib.registry or {}
self.BASE_TRANSLATIONS = oldLib and oldLib.BASE_TRANSLATIONS or {}
self.DEBUGGING = oldLib and oldLib.DEBUGGING or {}
self.TRANSLATIONS = oldLib and oldLib.TRANSLATIONS or {}
self.BASE_LOCALE = oldLib and oldLib.BASE_LOCALE or {}
self.TRANSLATION_TABLES = oldLib and oldLib.TRANSLATION_TABLES or {}
self.REVERSE_TRANSLATIONS = oldLib and oldLib.REVERSE_TRANSLATIONS or {}
self.STRICTNESS = oldLib and oldLib.STRICTNESS or {}
self.NAME = oldLib and oldLib.NAME or {}
self.DYNAMIC_LOCALES = oldLib and oldLib.DYNAMIC_LOCALES or {}
self.CURRENT_LOCALE = oldLib and oldLib.CURRENT_LOCALE or {}
BASE_TRANSLATIONS = self.BASE_TRANSLATIONS
DEBUGGING = self.DEBUGGING
TRANSLATIONS = self.TRANSLATIONS
BASE_LOCALE = self.BASE_LOCALE
TRANSLATION_TABLES = self.TRANSLATION_TABLES
REVERSE_TRANSLATIONS = self.REVERSE_TRANSLATIONS
STRICTNESS = self.STRICTNESS
NAME = self.NAME
DYNAMIC_LOCALES = self.DYNAMIC_LOCALES
CURRENT_LOCALE = self.CURRENT_LOCALE
local GetTime = GetTime
local timeUntilClear = GetTime() + 5
scheduleClear = function()
if next(newRegistries) then
self.frame:Show()
timeUntilClear = GetTime() + 5
end
end
if not self.registry then
self.registry = {}
else
for name, instance in pairs(self.registry) do
local name = name
local mt = getmetatable(instance)
setmetatable(instance, nil)
instance[NAME] = name
local strict
if instance[STRICTNESS] ~= nil then
strict = instance[STRICTNESS]
elseif instance[TRANSLATIONS] ~= instance[BASE_TRANSLATIONS] then
if getmetatable(instance[TRANSLATIONS]).__index == oldLib.prototype then
strict = true
end
end
instance[STRICTNESS] = strict and true or false
refixInstance(instance)
end
end
self.frame:SetScript("OnEvent", scheduleClear)
self.frame:SetScript("OnUpdate", function() -- (this, elapsed)
if timeUntilClear - GetTime() <= 0 then
self.frame:Hide()
for k in pairs(newRegistries) do
clearCache(k)
newRegistries[k] = nil
k = nil
end
end
end)
self.frame:UnregisterAllEvents()
self.frame:RegisterEvent("ADDON_LOADED")
self.frame:RegisterEvent("PLAYER_ENTERING_WORLD")
self.frame:Show()
if oldDeactivate then
oldDeactivate(oldLib)
end
end
AceLibrary:Register(AceLocale, MAJOR_VERSION, MINOR_VERSION, activate)
File diff suppressed because it is too large Load Diff
+347 -24
View File
@@ -1,6 +1,7 @@
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-- Title: Mik's Combat Event Helper
-- Author: Mik
-- Maintainer: Athene
-------------------------------------------------------------------------------------
-- Create "namespace."
@@ -106,8 +107,6 @@ MikCEH.CombatEventData = {};
-- Hold trigger event data.
MikCEH.TriggerEventData = {};
-------------------------------------------------------------------------------------
-- Private constants.
-------------------------------------------------------------------------------------
@@ -199,6 +198,7 @@ function MikCEH.OnLoad()
table.insert(listenEvents, "CHAT_MSG_COMBAT_HOSTILEPLAYER_MISSES"); -- Incoming Melee Misses, Dodges, Parries, Blocks, Absorbs, Immunes
table.insert(listenEvents, "CHAT_MSG_COMBAT_PARTY_MISSES"); -- Incoming Melee Misses, Dodges, Parries, Blocks, Absorbs, Immunes
table.insert(listenEvents, "CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE"); -- Incoming Spell/Ability Damage, Misses, Dodges, Parries, Blocks, Absorbs, Resists, Immunes, Power Losses
table.insert(listenEvents, "CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE"); -- Incoming Spell/Ability Damage, Misses, Dodges, Parries, Blocks, Absorbs, Resists, Immunes, Power Losses -- athenne add
table.insert(listenEvents, "CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE"); -- Incoming Spell/Ability Damage, Misses, Dodges, Parries, Blocks, Absorbs, Resists, Immunes, Power Losses
table.insert(listenEvents, "CHAT_MSG_SPELL_PARTY_DAMAGE"); -- Incoming Spell/Ability Damage, Misses, Dodges, Parries, Blocks, Absorbs, Resists, Immunes, Power Losses
table.insert(listenEvents, "CHAT_MSG_SPELL_DAMAGESHIELDS_ON_OTHERS"); -- Incoming damage from shields
@@ -214,6 +214,7 @@ function MikCEH.OnLoad()
table.insert(listenEvents, "CHAT_MSG_SPELL_SELF_BUFF"); -- Outgoing Heals, Power Gains, Dispel/Purge Resists
table.insert(listenEvents, "CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_BUFFS"); -- Outgoing HoTs
table.insert(listenEvents, "CHAT_MSG_SPELL_PERIODIC_PARTY_BUFFS"); -- Outgoing HoTs
table.insert(listenEvents, "CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS");
table.insert(listenEvents, "CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE"); -- Outgoing DoTs
table.insert(listenEvents, "CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE"); -- Outgoing DoTs, Power Losses
table.insert(listenEvents, "CHAT_MSG_COMBAT_PET_HITS"); -- Outgoing Pet Melee Hits/Crits
@@ -388,7 +389,10 @@ function MikCEH.ParseCombatEvents(event, combatMessage)
MikCEH.ParseForIncomingSpellHeals(combatMessage);
-- Incoming Debuffs, DoTs, Power Gains
elseif (event == "CHAT_MSG_SPELL_PERIODIC_SELF_DAMAGE") then
elseif (event == "CHAT_MSG_SPELL_PERIODIC_SELF_DAMAGE" or
event == "CHAT_MSG_SPELL_PERIODIC_PARTY_BUFFS" or
event == "CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_BUFFS" or
event == "CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS") then
MikCEH.ParseForIncomingDebuffs(combatMessage);
MikCEH.ParseForPowerGains(combatMessage);
@@ -890,6 +894,123 @@ function MikCEH.ParseForIncomingDamageShieldDamage(combatMessage)
-- Return the parse was successful.
return true;
end
-- Look for a resist.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLRESISTOTHERSELF", {"%n", "%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_RESIST, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a miss.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLMISSOTHERSELF", {"%n", "%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_MISS, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a dodge.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLDODGEDOTHERSELF", {"%n", "%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_DODGE, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a parry.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLPARRIEDOTHERSELF", {"%n", "%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_PARRY, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a block.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLBLOCKEDOTHERSELF", {"%n", "%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_BLOCK, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for an absorb.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLLOGABSORBOTHERSELF", {"%n", "%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_ABSORB, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for an immune.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLIMMUNEOTHERSELF", {"%n", "%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_IMMUNE, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a reflect.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLREFLECTOTHERSELF", {"%n", "%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_REFLECT, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Return the parse was NOT successful.
return false;
@@ -907,6 +1028,11 @@ function MikCEH.ParseForIncomingSpellHeals(combatMessage)
if (capturedData ~= nil) then
local eventData = MikCEH.GetHealEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.HEALTYPE_CRIT, capturedData.Amount, capturedData.SpellName, capturedData.Name);
-- Get overheal info.
eventData.Name = playerName
MikCEH.PopulateOverhealData(eventData); --athenne add
eventData.Name = capturedData.Name
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -921,6 +1047,11 @@ function MikCEH.ParseForIncomingSpellHeals(combatMessage)
if (capturedData ~= nil) then
local eventData = MikCEH.GetHealEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.HEALTYPE_NORMAL, capturedData.Amount, capturedData.SpellName, capturedData.Name);
-- Get overheal info.
eventData.Name = playerName
MikCEH.PopulateOverhealData(eventData); --athenne add
eventData.Name = capturedData.Name
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -936,6 +1067,11 @@ function MikCEH.ParseForIncomingSpellHeals(combatMessage)
if (capturedData ~= nil) then
local eventData = MikCEH.GetHealEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.HEALTYPE_OVER_TIME, capturedData.Amount, capturedData.SpellName, capturedData.Name);
-- Get overheal info.
eventData.Name = playerName
MikCEH.PopulateOverhealData(eventData); -- athenne add
eventData.Name = capturedData.Name
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -950,6 +1086,9 @@ function MikCEH.ParseForIncomingSpellHeals(combatMessage)
if (capturedData ~= nil) then
local eventData = MikCEH.GetHealEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.HEALTYPE_OVER_TIME, capturedData.Amount, capturedData.SpellName, playerName);
-- Get overheal info.
MikCEH.PopulateOverhealData(eventData); --athenne add
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -969,7 +1108,7 @@ end
function MikCEH.ParseForIncomingDebuffs(combatMessage)
-- Look for a debuff.
local capturedData = MikCEH.GetCapturedData(combatMessage, "AURAADDEDSELFHARMFUL", {"%b"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_DEBUFF, capturedData.Amount, capturedData.BuffName);
@@ -981,13 +1120,23 @@ function MikCEH.ParseForIncomingDebuffs(combatMessage)
return true;
end
capturedData = nil
-- Look for damage from a debuff.
local capturedData = MikCEH.GetCapturedData(combatMessage, "PERIODICAURADAMAGEOTHERSELF", {"%a", "%t", "%n", "%s"});
if (GetLocale() == "frFR") then
capturedData = MikCEH.GetCapturedData(combatMessage, "PERIODICAURADAMAGEOTHERSELF", {"%t", "%a", "%s", "%n"});
else
capturedData = MikCEH.GetCapturedData(combatMessage, "PERIODICAURADAMAGEOTHERSELF", {"%a", "%t", "%n", "%s"});
end
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_HIT, MikCEH.HITTYPE_OVER_TIME, capturedData.DamageType, capturedData.Amount, capturedData.SpellName, capturedData.Name);
local eventData
if (GetLocale() == "frFR") then
eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_HIT, MikCEH.HITTYPE_OVER_TIME, capturedData.DamageType, capturedData.Amount, capturedData.SpellName, capturedData.Name);
else
eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_HIT, MikCEH.HITTYPE_OVER_TIME, capturedData.DamageType, capturedData.Amount, capturedData.Name, capturedData.SpellName);
end
-- Look for any partial actions and populate them into the event data.
MikCEH.ParseForPartialActions(combatMessage, eventData);
@@ -998,7 +1147,36 @@ function MikCEH.ParseForIncomingDebuffs(combatMessage)
-- Return the parse was successful.
return true;
end
-- Look for damage from a self debuff.
local capturedData = MikCEH.GetCapturedData(combatMessage, "PERIODICAURADAMAGESELFSELF", {"%a", "%t", "%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_HIT, MikCEH.HITTYPE_OVER_TIME, capturedData.DamageType, capturedData.Amount, capturedData.SpellName, nil);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for absorbed damage from a self debuff.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLLOGABSORBSELFSELF", {"%s"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_INCOMING, MikCEH.ACTIONTYPE_ABSORB, nil, nil, nil, capturedData.SpellName, nil);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for absorbed damage from a debuff.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLLOGABSORBOTHERSELF", {"%n", "%s"});
@@ -1023,14 +1201,16 @@ end
-- Parses for power gains.
-- **********************************************************************************
function MikCEH.ParseForPowerGains(combatMessage)
-- Look for self power gains.
local capturedData = MikCEH.GetCapturedData(combatMessage, "POWERGAINSELFSELF", {"%a", "%p", "%s"});
local capturedData = nil
-- Look for power gains from others.
local capturedData = MikCEH.GetCapturedData(combatMessage, "POWERGAINOTHERSELF", {"%p", "%a", "%s", "%n"});
-- If a match was found.
if (capturedData ~= nil) then
-- Make sure it's mana, rage, or energy.
if (capturedData.PowerType == MANA or capturedData.PowerType == RAGE or capturedData.PowerType == ENERGY) then
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_GAIN, capturedData.Amount, capturedData.PowerType);
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_GAIN, capturedData.Amount, capturedData.PowerType, capturedData.SpellName);
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -1039,15 +1219,19 @@ function MikCEH.ParseForPowerGains(combatMessage)
return true;
end
end
-- Look for power gains from others.
local capturedData = MikCEH.GetCapturedData(combatMessage, "POWERGAINOTHERSELF", {"%a", "%p", "%n", "%s"});
-- Look for self power gains.
if (GetLocale() == "frFR") then
capturedData = MikCEH.GetCapturedData(combatMessage, "POWERGAINSELFSELF", {"%p", "%s", "%a"});
else
capturedData = MikCEH.GetCapturedData(combatMessage, "POWERGAINSELFSELF", {"%a", "%p", "%s"});
end
-- If a match was found.
if (capturedData ~= nil) then
-- Make sure it's mana, rage, or energy.
if (capturedData.PowerType == MANA or capturedData.PowerType == RAGE or capturedData.PowerType == ENERGY) then
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_GAIN, capturedData.Amount, capturedData.PowerType);
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_GAIN, capturedData.Amount, capturedData.PowerType, capturedData.SpellName);
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -1064,7 +1248,7 @@ function MikCEH.ParseForPowerGains(combatMessage)
if (capturedData ~= nil) then
-- Make sure it's mana, rage, or energy.
if (capturedData.PowerType == MANA or capturedData.PowerType == RAGE or capturedData.PowerType == ENERGY) then
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_GAIN, capturedData.Amount, capturedData.PowerType);
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_GAIN, capturedData.Amount, capturedData.PowerType, capturedData.SpellName);
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -1088,7 +1272,7 @@ function MikCEH.ParseForPowerLosses(combatMessage)
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_LOSS, capturedData.Amount, capturedData.PowerType);
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_LOSS, capturedData.Amount, capturedData.PowerType, capturedData.SpellName);
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -1103,7 +1287,7 @@ function MikCEH.ParseForPowerLosses(combatMessage)
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_LOSS, capturedData.Amount, capturedData.PowerType);
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_LOSS, capturedData.Amount, capturedData.PowerType, capturedData.SpellName);
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -1140,6 +1324,20 @@ function MikCEH.ParseForIncomingBuffs(combatMessage)
-- Return the parse was successful.
return true;
end
-- Look for a self mana drain.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLPOWERDRAINSELFSELF", {"%s", "%a", "%p"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetNotificationEventData(MikCEH.NOTIFICATIONTYPE_POWER_LOSS, capturedData.Amount, capturedData.PowerType, capturedData.SpellName);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Return the parse was NOT successful.
return false;
@@ -1708,7 +1906,113 @@ function MikCEH.ParseForOutgoingDamageShieldDamage(combatMessage)
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_HIT, MikCEH.HITTYPE_NORMAL, capturedData.DamageType, capturedData.Amount, nil, capturedData.Name);
local eventData
if capturedData.DamageType == 2 and capturedData.Amount == "20" then
eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_HIT, MikCEH.HITTYPE_NORMAL, capturedData.DamageType, capturedData.Amount, "Aura de vindicte", capturedData.Name);
else
eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_HIT, MikCEH.HITTYPE_NORMAL, capturedData.DamageType, capturedData.Amount, nil, capturedData.Name);
end
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a resist.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLRESISTSELFOTHER", {"%s", "%n"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_RESIST, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for an immune.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLIMMUNESELFOTHER", {"%s", "%n"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_IMMUNE, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for an evade
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLEVADEDSELFOTHER", {"%s", "%n"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_EVADE, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a miss.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLMISSSELFOTHER", {"%s", "%n"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_MISS, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a dodge.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLDODGEDSELFOTHER", {"%s", "%n"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_DODGE, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a parry.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLPARRIEDSELFOTHER", {"%s", "%n"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_PARRY, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
-- Return the parse was successful.
return true;
end
-- Look for a block.
local capturedData = MikCEH.GetCapturedData(combatMessage, "SPELLBLOCKEDSELFOTHER", {"%s", "%n"});
-- If a match was found.
if (capturedData ~= nil) then
local eventData = MikCEH.GetDamageEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.ACTIONTYPE_BLOCK, nil, nil, nil, capturedData.SpellName, capturedData.Name);
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -1838,6 +2142,9 @@ function MikCEH.ParseForOutgoingHoTs(combatMessage)
if (capturedData ~= nil) then
local eventData = MikCEH.GetHealEventData(MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING, MikCEH.HEALTYPE_OVER_TIME, capturedData.Amount, capturedData.SpellName, capturedData.Name);
-- Get overheal info.
MikCEH.PopulateOverhealData(eventData); --athenne add
-- Send the event.
MikCEH.SendEvent(eventData);
@@ -2589,7 +2896,7 @@ function MikCEH.GetGlobalStringInfo(globalStringName)
formatCode = currentChar;
else
-- Check if the character is one of the magic characters and escape it.
if (string.find(currentChar, "[%^%$%(%)%.%[%]%*%+%-%?]")) then
if (string.find(currentChar, "[%^%$%(%)%.%[%]%*%-%+%?]")) then
searchString = searchString .. "%" .. currentChar;
-- Normal character so just add it to the formatted string.
else
@@ -2779,6 +3086,8 @@ function MikCEH.GetDamageTypeNumber(damageTypeString)
return MikCEH.DAMAGETYPE_SHADOW;
elseif (damageTypeString == SPELL_SCHOOL6_CAP) then
return MikCEH.DAMAGETYPE_ARCANE;
elseif (damageTypeString == "Arcane") then
return MikCEH.DAMAGETYPE_ARCANE;
end
-- Return the unknown damage type.
@@ -2865,7 +3174,7 @@ end
-- Populates the combat event data table for a notification event with the passed
-- info.
-- **********************************************************************************
function MikCEH.GetNotificationEventData(notificationType, amount, effectName)
function MikCEH.GetNotificationEventData(notificationType, amount, effectName, SpellName)
-- Get the global combat event data table.
local eventData = MikCEH.CombatEventData;
@@ -2876,7 +3185,12 @@ function MikCEH.GetNotificationEventData(notificationType, amount, effectName)
eventData.EventType = MikCEH.EVENTTYPE_NOTIFICATION;
eventData.NotificationType = notificationType;
eventData.Amount = amount;
eventData.EffectName = effectName;
if effectName == MANA or effectName == RAGE or effectName == ENERGY then
eventData.Amount = amount.." "..effectName;
eventData.EffectName = SpellName;
else
eventData.EffectName = effectName;
end
-- Return the event data.
return eventData;
@@ -2926,7 +3240,14 @@ end
-- **********************************************************************************
function MikCEH.PopulateOverhealData(eventData)
-- Get the appropriate unit id for the unit being checked for overheals.
local unitID = MikCEH.GetUnitIDFromName(eventData.Name);
if not unitID then
if UnitName("target") == eventData.Name then
unitID = "target";
end
end
-- Make sure it's a valid unit id.
if (unitID) then
@@ -3128,7 +3449,8 @@ function MikCEH.ParseSelfHealthTriggers()
if (healthPercentage < triggerSettings.Threshold/100 and lastSelfHealthPercentage >= triggerSettings.Threshold/100) then
-- Get trigger event data and call the trigger handler.
local eventData = MikCEH.GetThresholdTriggerEventData(triggerKey, healthAmount);
MikCEH.SendTriggerEvent(eventData)
MikCEH.SendTriggerEvent(eventData);
PlaySoundFile("Interface\\AddOns\\MikScrollingBattleText\\sounds\\LowHealth.mp3");
end
end
@@ -3152,7 +3474,8 @@ function MikCEH.ParseSelfManaTriggers()
if (manaPercentage < triggerSettings.Threshold/100 and lastSelfManaPercentage >= triggerSettings.Threshold/100) then
-- Get trigger event data and call the trigger handler.
local eventData = MikCEH.GetThresholdTriggerEventData(triggerKey, manaAmount);
MikCEH.SendTriggerEvent(eventData)
MikCEH.SendTriggerEvent(eventData);
PlaySoundFile("Interface\\AddOns\\MikScrollingBattleText\\sounds\\LowMana.mp3");
end
end
@@ -0,0 +1,25 @@
local L = AceLibrary("AceLocale-2.2"):new("MikScrollingBattleText")
L:RegisterTranslations("enUS", function()
return {
["Debug mode has been enabled."] = true,
["Debug mode has been disabled."] = true,
["Event search mode has been enabled. Searching for: "] = true,
["Event search mode has been disabled."] = true,
["The mod is now disabled."] = true,
["The mod is now enabled."] = true,
["Hits"] = true,
["Crit"] = true,
["Crits"] = true,
["Multiple"] = true,
[" (%d vulnerability)"] = true,
[" <\124cff00b37e\124h%d\124h\124r>"] = true,
["Profile Reset"] = true,
["Drowning"] = true,
["Falling"] = true,
["Fatigue"] = true,
["Fire"] = true,
["Lava"] = true,
["Slime"] = true,
}
end)
@@ -0,0 +1,25 @@
local L = AceLibrary("AceLocale-2.2"):new("MikScrollingBattleText")
L:RegisterTranslations("frFR", function()
return {
["Debug mode has been enabled."] = "Debug mode has been enabled.",
["Debug mode has been disabled."] = "Debug mode has been disabled.",
["Event search mode has been enabled. Searching for: "] = "Event search mode has been enabled. Searching for: ",
["Event search mode has been disabled."] = "Event search mode has been disabled.",
["The mod is now disabled."] = "The mod is now disabled.",
["The mod is now enabled."] = "The mod is now enabled.",
["Hits"] = "Coups",
["Crit"] = "Crit",
["Crits"] = "Crits",
["Multiple"] = "Multiple",
[" (%d vulnerability)"] = " (%d vulnérabilité)",
[" <\124cff00b37e\124h%d\124h\124r>"] = " <\124cff00b37e\124h%d\124h\124r>",
["Profile Reset"] = "Profile Reset",
["Drowning"] = "Noyade",
["Falling"] = "Chute",
["Fatigue"] = "Fatigue",
["Fire"] = "Feu",
["Lava"] = "Lave",
["Slime"] = "Gelée",
}
end)
+387 -19
View File
@@ -1,6 +1,7 @@
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-- Title: Mik's Scrolling Battle Text
-- Author: Mik
-- Maintainer: Athene
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
@@ -25,8 +26,96 @@ MikSBT.CurrentProfile = nil;
-- Private constants.
-------------------------------------------------------------------------------------
-- cache des icones trouvées par l'algo et des icones qu'il ne trouverait pas
if not ICON_CACHE then
ICON_CACHE = {}
end
ICON_CACHE["repousser au loin"] = "Interface\\Icons\\Inv_Gauntlets_05"
ICON_CACHE["rupture du sol"] = "Interface\\Icons\\Spell_Nature_Earthquake"
ICON_CACHE["rayon de l'oeil"] = "Interface\\Icons\\Spell_Nature_Callstorm"
ICON_CACHE["salve de traits de l'ombre"] = "Interface\\Icons\\Spell_Shadow_Shadowbolt"
ICON_CACHE["tempête d'ombre"] = "Interface\\Icons\\spell_shadow_shadowbolt"
ICON_CACHE["gaz"] = "Interface\\Icons\\Spell_Nature_Abolishmagic"
ICON_CACHE["décimer"] = "Interface\\Icons\\Inv_Shield_01"
ICON_CACHE["champ statique"] = "Interface\\Icons\\Spell_Nature_WispHeal"
ICON_CACHE["horion"] = "Interface\\Icons\\Spell_Nature_WispHeal"
ICON_CACHE["secousse"] = "Interface\\Icons\\spell_nature_earthquake"
ICON_CACHE["charge de bouclier"] = "Interface\\Icons\\ability_warrior_charge"
ICON_CACHE["eclair des arcanes"] = "Interface\\Icons\\spell_arcane_starfire"
ICON_CACHE["gémissement des âmes"] = "Interface\\Icons\\spell_nature_lightning"
ICON_CACHE["trait noir"] = "Interface\\Icons\\spell_shadow_shadowbolt"
ICON_CACHE["infusion de mana"] = "Interface\\Icons\\inv_trinket_naxxramas01"
ICON_CACHE["afflux"] = "Interface\\Icons\\Ability_Warrior_Charge"
ICON_CACHE["frappe"] = "Interface\\Icons\\Ability_Rogue_Ambush"
ICON_CACHE["souffle de lave"] = "Interface\\Icons\\Spell_Fire_WindsOfWoe"
ICON_CACHE["frappe des ailes"] = "Interface\\Icons\\Inv_Misc_Monsterscales_14"
ICON_CACHE["lance de flammes"] = "Interface\\Icons\\Ability_Throw"
ICON_CACHE["horion de l'ombre"] = "Interface\\Icons\\Spell_Shadow_Shadowbolt"
ICON_CACHE["explosion de lave"] = "Interface\\Icons\\Spell_Fire_Volcano"
ICON_CACHE["bouclier de lave"] = "Interface\\Icons\\Spell_Fire_Immolation"
ICON_CACHE["fleur de feu"] = "Interface\\Icons\\Spell_Fire_Fireball02"
ICON_CACHE["bombe"] = "Interface\\Icons\\Spell_Fire_Selfdestruct"
ICON_CACHE["explosion"] = "Interface\\Icons\\Spell_Fire_Selfdestruct"
ICON_CACHE["colère de ragnaros"] = "Interface\\Icons\\Spell_Fire_Soulburn"
ICON_CACHE["choc"] = "Interface\\Icons\\Ability_Smash"
ICON_CACHE["secousse violente"] = "Interface\\Icons\\Ability_Smash"
ICON_CACHE["nova de feu"] = "Interface\\Icons\\Spell_Fire_SealOfFire"
ICON_CACHE["marque de détonation"] = "Interface\\Icons\\spell_fire_selfdestruct"
ICON_CACHE["cône de feu"] = "Interface\\Icons\\Spell_Fire_WindsOfWoe"
ICON_CACHE["volée de boules de feu"] = "Interface\\Icons\\Spell_Fire_Flamebolt"
ICON_CACHE["vague de foudre"] = "Interface\\Icons\\Spell_Nature_Chainlightning"
ICON_CACHE["coup de queue"] = "Interface\\Icons\\Inv_Misc_MonsterScales_05"
ICON_CACHE["exploiter faiblesse"] = "Interface\\Icons\\ability_backstab"
ICON_CACHE["lancer feu liquide"] = "Interface\\Icons\\spell_fire_meteorstorm"
ICON_CACHE["poing de force"] = "Interface\\Icons\\inv_gauntlets_31"
ICON_CACHE["uppercut"] = "Interface\\Icons\\inv_gauntlets_31"
ICON_CACHE["sangsue"] = "Interface\\Icons\\ability_racial_cannibalize"
ICON_CACHE["choc de feu"] = "Interface\\Icons\\spell_fire_immolation"
ICON_CACHE["malédiction du sang"] = "Interface\\Icons\\spell_shadow_ritualofsacrifice"
ICON_CACHE["brasier"] = "Interface\\Icons\\spell_fire_incinerate"
ICON_CACHE["météore"] = "Interface\\Icons\\spell_fire_meteorstorm"
ICON_CACHE["jet de poison"] = "Interface\\Icons\\spell_nature_corrosivebreath"
ICON_CACHE["explosion d'ombre"] = "Interface\\Icons\\spell_shadow_antishadow"
ICON_CACHE["voile de l'ombre"] = "Interface\\Icons\\spell_shadow_gathershadows"
ICON_CACHE["nuée maléfique"] = "Interface\\Icons\\spell_nature_abolishmagic"
ICON_CACHE["crachat empoisonné"] = "Interface\\Icons\\spell_nature_corrosivebreath"
ICON_CACHE["piétiner"] = "Interface\\Icons\\spell_nature_natureswrath"
ICON_CACHE["spores mutées"] = "Interface\\Icons\\spell_nature_abolishmagic"
ICON_CACHE["heurtoir du vomisseur de bile"] = "Interface\\Icons\\ability_devour"
ICON_CACHE["eruption"] = "Interface\\Icons\\spell_fire_volcano"
ICON_CACHE["tempête de mana"] = "Interface\\Icons\\spell_frost_icestorm"
ICON_CACHE["frappe sacrée"] = "Interface\\Icons\\ability_thunderbolt"
ICON_CACHE["grondement du tonnerre"] = "Interface\\Icons\\spell_nature_thunderclap"
ICON_CACHE["déflagration des arcanes"] = "Interface\\Icons\\spell_shadow_deathpact"
ICON_CACHE["nuage pestilentiel"] = "Interface\\Icons\\spell_nature_abolishmagic"
ICON_CACHE["régénération de mana"] = "Interface\\Icons\\spell_nature_manaregentotem"
ICON_CACHE["potion de soins"] = "Interface\\Icons\\inv_potion_54"
ICON_CACHE["restauration du mana"] = "Interface\\Icons\\inv_potion_76"
ICON_CACHE["rune démoniaque"] = "Interface\\Icons\\inv_misc_rune_04"
ICON_CACHE["rune ténébreuse"] = "Interface\\Icons\\spell_shadow_sealofkings"
ICON_CACHE["absorption de magie"] = "Interface\\Icons\\spell_nature_astralrecalgroup"
ICON_CACHE["gel"] = "Interface\\Icons\\spell_frost_glacier"
ICON_CACHE["lésions cérébrales"] = "Interface\\Icons\\ability_gouge"
ICON_CACHE["décharge électrique"] = "Interface\\Icons\\spell_lightning_lightningbolt01"
ICON_CACHE["foudre"] = "Interface\\Icons\\spell_lightning_lightningbolt01"
ICON_CACHE["enchantement flamboyant"] = "Interface\\Icons\\spell_fire_selfdestruct"
ICON_CACHE["pierre de soins supérieure"] = "Interface\\Icons\\inv_stone_04"
ICON_CACHE["pierre de soins mineure"] = "Interface\\Icons\\inv_stone_04"
ICON_CACHE["pierre de soins inférieure"] = "Interface\\Icons\\inv_stone_04"
ICON_CACHE["pierre de soins majeure"] = "Interface\\Icons\\inv_stone_04"
ICON_CACHE["pierre de soins"] = "Interface\\Icons\\inv_stone_04"
ICON_CACHE["capturer un esprit"] = "Interface\\Icons\\Spell_Shadow_Haunting"
-- Cache des spells dont l'icone n'a pas été trouvée
NO_ICON_CACHE = {}
-- Babble-Spell pour les icones des spells de class
local BS = AceLibrary("Babble-Spell-2.2")
-- Number of font strings.
local NUM_FONT_STRINGS = 15;
local NUM_FONT_STRINGS = 20;
-- Animation values for incoming and outgoing events.
local MIN_VERTICAL_SPACING = 8;
@@ -40,7 +129,7 @@ local STICKY_DISPLAY_TIME = 2;
local STICKY_FADE_OUT_TIME = 0.5;
-- The animation speed.
local ANIMATION_SPEED = 0.015;
local ANIMATION_SPEED = 0.02;
-- Scroll directions
local SCROLL_DIRECTION_UP = 1;
@@ -83,9 +172,9 @@ local stillMerging = false;
local activeNonStickies = {};
local activeStickies = {};
-- Create a new table recycler object that holds up to 50 table references
-- Create a new table recycler object that holds up to 40 table references
-- in primary cache.
local eventsRecycler = MikTRO:NewRecyclerObject(50);
local eventsRecycler = MikTRO:NewRecyclerObject(40);
-------------------------------------------------------------------------------------
@@ -482,7 +571,11 @@ function MikSBT.CombatEventsHandler(combatEvent)
end
-- Copy the amount, effect name, and player/enemy name from the passed combat event data.
animationEvent.Amount = combatEvent.Amount;
-- if combatEvent.Amount then
-- animationEvent.Amount = combatEvent.Amount * 420;
-- else
animationEvent.Amount = combatEvent.Amount;
-- end
animationEvent.EffectName = combatEvent.EffectName;
animationEvent.Name = combatEvent.Name;
@@ -490,19 +583,19 @@ function MikSBT.CombatEventsHandler(combatEvent)
if (combatEvent.DamageType ~= nil) then
animationEvent.DamageType = MikCEH.GetDamageTypeString(combatEvent.DamageType);
end
-- If there are partial action types set the partial effect text appropriately.
if (combatEvent.PartialActionType == MikCEH.PARTIALACTIONTYPE_ABSORB) then
if (ABSORB_TRAILER) then
animationEvent.PartialEffectText = string.gsub(ABSORB_TRAILER, "%%d", combatEvent.PartialAmount);
animationEvent.PartialEffectText = "\124cffFAFA00\124h"..string.gsub(ABSORB_TRAILER, "%%d", combatEvent.PartialAmount).."\124h\124r";
end
elseif (combatEvent.PartialActionType == MikCEH.PARTIALACTIONTYPE_BLOCK) then
if (BLOCK_TRAILER) then
animationEvent.PartialEffectText = string.gsub(BLOCK_TRAILER, "%%d", combatEvent.PartialAmount);
animationEvent.PartialEffectText = "\124cff7F00FF\124h"..string.gsub(BLOCK_TRAILER, "%%d", combatEvent.PartialAmount).."\124h\124r";
end
elseif (combatEvent.PartialActionType == MikCEH.PARTIALACTIONTYPE_RESIST) then
if (RESIST_TRAILER) then
animationEvent.PartialEffectText = string.gsub(RESIST_TRAILER, "%%d", combatEvent.PartialAmount);
animationEvent.PartialEffectText = " \124cff81007F\124h"..string.gsub(RESIST_TRAILER, "%%d", combatEvent.PartialAmount).."\124h\124r";
end
elseif (combatEvent.PartialActionType == MikCEH.PARTIALACTIONTYPE_VULNERABLE) then
if (MikSBT.MSG_VULERNABLE_TRAILER) then
@@ -510,11 +603,11 @@ function MikSBT.CombatEventsHandler(combatEvent)
end
elseif (combatEvent.PartialActionType == MikCEH.PARTIALACTIONTYPE_CRUSHING) then
if (CRUSHING_TRAILER) then
animationEvent.PartialEffectText = CRUSHING_TRAILER;
animationEvent.PartialEffectText = "\124cff7D0000\124h"..CRUSHING_TRAILER.."\124h\124r";
end
elseif (combatEvent.PartialActionType == MikCEH.PARTIALACTIONTYPE_GLANCING) then
if (GLANCING_TRAILER) then
animationEvent.PartialEffectText = GLANCING_TRAILER;
animationEvent.PartialEffectText = "\124cffFA0000\124h"..GLANCING_TRAILER.."\124h\124r";
end
elseif (combatEvent.PartialActionType == MikCEH.PARTIALACTIONTYPE_OVERHEAL) then
animationEvent.OverhealAmount = combatEvent.PartialAmount;
@@ -553,6 +646,10 @@ function MikSBT.TriggerHandler(triggerEvent)
animationEvent.ScrollArea = scrollAreas.Notification;
animationEvent.EventSettings = MikSBT.CurrentProfile.Triggers[triggerEvent.TriggerKey].EventSettings;
MikSBT.FormatTriggerText(animationEvent, triggerEvent);
if (MikSBT.CurrentProfile.Triggers[triggerEvent.TriggerKey].Texture) then
animationEvent.Texture = MikSBT.CurrentProfile.Triggers[triggerEvent.TriggerKey].Texture
end
-- Dispatch the event to the animation system.
MikSBT.DispatchAnimationEvent(animationEvent);
@@ -637,7 +734,11 @@ function MikSBT.MergeEvents(mergeData, numEvents)
-- If the events have an amount then total them.
if (animationEvent.Amount ~= nil and mergeData.UnmergedEvents[x].Amount ~= nil) then
animationEvent.Amount = animationEvent.Amount + mergeData.UnmergedEvents[x].Amount;
animationEvent.Amount = tonumber (animationEvent.Amount, 10)
if animationEvent.Amount and mergeData.UnmergedEvents[x].Amount then
animationEvent.Amount = animationEvent.Amount + mergeData.UnmergedEvents[x].Amount;
end
-- animationEvent.Amount = animationEvent.Amount + mergeData.UnmergedEvents[x].Amount;
end
-- Check if there is an overheal amount and total it.
@@ -916,12 +1017,39 @@ end
-- **********************************************************************************
function MikSBT.FormatEventText(animationEvent)
local outputString = animationEvent.UnformattedText;
-- Print(animationEvent)
-- Check if there is no unformatted text and bail.
if (outputString == nil) then
return;
end
outputString = string.gsub(outputString, "-%%a", "\124cffff0000\124h-\124h\124r%%a");
if (animationEvent.DamageType ~= nil) then
if animationEvent.DamageType == SPELL_SCHOOL1_CAP then
outputString = string.gsub(outputString, "%%a", "\124cffF6F99E\124h%%a\124h\124r");
elseif animationEvent.DamageType == SPELL_SCHOOL2_CAP then
outputString = string.gsub(outputString, "%%a", "\124cffFF8080\124h%%a\124h\124r");
elseif animationEvent.DamageType == SPELL_SCHOOL3_CAP then
outputString = string.gsub(outputString, "%%a", "\124cff80FF80\124h%%a\124h\124r");
elseif animationEvent.DamageType == SPELL_SCHOOL4_CAP then
outputString = string.gsub(outputString, "%%a", "\124cff8080FF\124h%%a\124h\124r");
elseif animationEvent.DamageType == SPELL_SCHOOL5_CAP then
outputString = string.gsub(outputString, "%%a", "\124cffA000A0\124h%%a\124h\124r");
elseif animationEvent.DamageType == SPELL_SCHOOL6_CAP then
outputString = string.gsub(outputString, "%%a", "\124cffFFB9FF\124h%%a\124h\124r");
elseif animationEvent.DamageType == SPELL_SCHOOL0_CAP and animationEvent.EffectName and animationEvent.ScrollArea.AssociatedFrame == "MSBTFrameOutgoing" then
outputString = string.gsub(outputString, "%%a", "\124cffFFFF00\124h%%a\124h\124r");
elseif animationEvent.DamageType == SPELL_SCHOOL0_CAP then
outputString = string.gsub(outputString, "%%a", "\124cffFFFFFF\124h%%a\124h\124r");
elseif animationEvent.DamageType == "Inconnu" then
outputString = string.gsub(outputString, "%%a", "\124cffFFB9FF\124h%%a\124h\124r");
-- DEFAULT_CHAT_FRAME:AddMessage(animationEvent.DamageType)
end
end
-- Substitute amount.
if (animationEvent.Amount ~= nil) then
-- Check if there is overheal info
@@ -934,8 +1062,11 @@ function MikSBT.FormatEventText(animationEvent)
end
-- Substitute enemy/player names.
if (animationEvent.Name ~= nil) then
if (animationEvent.Name ~= nil) and (animationEvent.Name ~= UnitName("player")) then
outputString = string.gsub(outputString, "%%n", animationEvent.Name);
else
outputString = string.gsub(outputString, "%(%%n%)", "");
outputString = string.gsub(outputString, "%%n", "");
end
-- Substitute effect names.
@@ -1376,10 +1507,14 @@ function MikSBT.AddAnimation(animationEvent)
-- Loop through all of the suppression entries and look for a match.
for _, suppressionSettings in MikSBT.CurrentProfile.Suppressions do
-- Check if the suppression's search pattern is a match.
if (suppressionSettings.Enabled and string.find(animationEvent.Text, suppressionSettings.SearchPattern)) then
if (suppressionSettings.Enabled and (string.find(animationEvent.Text, suppressionSettings.SearchPattern))) then
-- Reclaim the animation event table to the events recycler and leave the function.
eventsRecycler:ReclaimTable(animationEvent);
return;
return;
elseif (suppressionSettings.Enabled and animationEvent.EffectName and string.find(animationEvent.EffectName, suppressionSettings.SearchPattern)) then
-- Reclaim the animation event table to the events recycler and leave the function.
eventsRecycler:ReclaimTable(animationEvent);
return;
end
end
@@ -1389,6 +1524,30 @@ function MikSBT.AddAnimation(animationEvent)
animationEvent.IsSticky = true;
end
-- Color UnitName by class
local UnitID = MikCEH.GetUnitIDFromName(animationEvent.Name)
if UnitID then
local Class = UnitClass(UnitID)
if Class and Class == "Paladin" then
animationEvent.Text = string.gsub(animationEvent.Text, animationEvent.Name, "|cffF58CBA|h"..animationEvent.Name.."|h|r")
elseif Class and Class == "Druide" then
animationEvent.Text = string.gsub(animationEvent.Text, animationEvent.Name, "|cffFF7D0A|h"..animationEvent.Name.."|h|r")
elseif Class and Class == "Chasseur" then
animationEvent.Text = string.gsub(animationEvent.Text, animationEvent.Name, "|cffABD473|h"..animationEvent.Name.."|h|r")
elseif Class and Class == "Mage" then
animationEvent.Text = string.gsub(animationEvent.Text, animationEvent.Name, "|cff69CCF0|h"..animationEvent.Name.."|h|r")
elseif Class and Class == "Prêtre" then
animationEvent.Text = string.gsub(animationEvent.Text, animationEvent.Name, "|cffFFFFFF|h"..animationEvent.Name.."|h|r")
elseif Class and Class == "Voleur" then
animationEvent.Text = string.gsub(animationEvent.Text, animationEvent.Name, "|cffFFF569|h"..animationEvent.Name.."|h|r")
elseif Class and Class == "Chaman" then
animationEvent.Text = string.gsub(animationEvent.Text, animationEvent.Name, "|cff0070DE|h"..animationEvent.Name.."|h|r")
elseif Class and Class == "Démoniste" then
animationEvent.Text = string.gsub(animationEvent.Text, animationEvent.Name, "|cff9482C9|h"..animationEvent.Name.."|h|r")
elseif Class and Class == "Guerrier" then
animationEvent.Text = string.gsub(animationEvent.Text, animationEvent.Name, "|cffC79C6E|h"..animationEvent.Name.."|h|r")
end
end
-- Get the next available animation display info object for the scroll area.
local animDisplayInfo = MikSBT.GetNextAnimationDisplayInfo(animationEvent);
@@ -1447,7 +1606,62 @@ function MikSBT.AddAnimation(animationEvent)
animDisplayInfo.FontObject:SetText(animationEvent.Text);
animDisplayInfo.FontObject:SetAlpha(animDisplayInfo.Alpha);
animDisplayInfo.FontObject:SetPoint(animDisplayInfo.AnchorPoint, animDisplayInfo.PositionX, animDisplayInfo.PositionY);
-- Athene Edit - Spell Icon
local texture
if animationEvent.Texture then texture = animationEvent.Texture end
if animationEvent.EffectName then
local name = string.gsub(animationEvent.EffectName, " %(%d+%)", "")
-- DEFAULT_CHAT_FRAME:AddMessage(animationEvent.EffectName)
-- DEFAULT_CHAT_FRAME:AddMessage(name)
-- texture = BS:GetSpellIcon(name)
if ICON_CACHE[strlower(name)] then
texture = ICON_CACHE[strlower(name)]
elseif not texture and MikSBT.FindBuff(name) then
local bufftype,index,_ = MikSBT.FindBuff(name)
local icon
if bufftype == "buff" then
icon = UnitBuff("player", index)
ICON_CACHE[strlower(name)] = icon
texture = icon
elseif bufftype == "debuff" then
icon = UnitDebuff("player", index)
ICON_CACHE[strlower(name)] = icon
texture = icon
else
texture = nil
NO_ICON_CACHE[strlower(name)] = 1
end
elseif not texture and BS:GetSpellIcon(name) then
texture = BS:GetSpellIcon(name)
elseif not texture and MikSBT.FindItemIcon(name) then
texture = MikSBT.FindItemIcon(name)
ICON_CACHE[strlower(name)] = MikSBT.FindItemIcon(name)
elseif not texture then
texture = nil
NO_ICON_CACHE[strlower(name)] = 1
end
end
if texture then
-- local frame
if not animDisplayInfo.Texture then
-- on creer une nouvelle texture
animDisplayInfo.Texture = getglobal(animationEvent.ScrollArea.AssociatedFrame):CreateTexture(nil, "ARTWORK")
end
-- on réutilise une texture existante
animDisplayInfo.Texture:ClearAllPoints();
animDisplayInfo.Texture:SetTexture(nil);
animDisplayInfo.Texture:SetTexture(texture);
animDisplayInfo.Texture:SetWidth(animDisplayInfo.FontSize);
animDisplayInfo.Texture:SetHeight(animDisplayInfo.FontSize);
animDisplayInfo.Texture:SetTexCoord(0.125, 0.875, 0.125, 0.875)
animDisplayInfo.Texture:SetPoint("RIGHT", animDisplayInfo.FontObject, "LEFT", -4, 0);
animDisplayInfo.Texture:SetDrawLayer(animDisplayInfo.IsSticky and "OVERLAY" or animDisplayInfo.IsCrit and "OVERLAY" or "ARTWORK");
elseif animDisplayInfo.Texture then
animDisplayInfo.Texture:SetTexture(nil);
end
-- Set the last update to the current time.
animDisplayInfo.LastUpdated = GetTime();
@@ -1475,6 +1689,116 @@ function MikSBT.AddAnimation(animationEvent)
eventsRecycler:ReclaimTable(animationEvent);
end
-- **********************************************************************************
-- This function return the buff texture based on
-- it's name.
-- **********************************************************************************
function ItemLinkToName(link)
return gsub(link,"^.*%[(.*)%].*$","%1");
end
function MikSBT.FindItemIcon(item)
if ( not item ) then return; end
item = string.lower(item);
local link;
for i = 1,23 do
link = GetInventoryItemLink("player",i);
if ( link ) then
if ( item == string.lower(ItemLinkToName(link)) )then
return i, nil, GetInventoryItemTexture('player', i), GetInventoryItemCount('player', i);
end
end
end
local count, bag, slot, texture;
for i = 0,NUM_BAG_FRAMES do
for j = 1,MAX_CONTAINER_ITEMS do
link = GetContainerItemLink(i,j);
if ( link ) then
if ( item == string.lower(ItemLinkToName(link))) then
bag, slot = i, j;
texture, count = GetContainerItemInfo(i,j);
end
end
end
end
return texture;
end
-- **********************************************************************************
-- This function return the buff texture based on
-- it's name.
-- **********************************************************************************
function MikSBT.FindBuff( obuff, unit, item)
local buff=strlower(obuff);
local tooltip=MSBT_Tooltip;
local textleft1=getglobal(tooltip:GetName().."TextLeft1");
if ( not unit ) then
unit ='player';
end
local my, me, mc, oy, oe, oc = GetWeaponEnchantInfo();
if ( my ) then
tooltip:SetOwner(UIParent, "ANCHOR_NONE");
tooltip:SetInventoryItem( unit, 16);
for i=1, 23 do
local text = getglobal("MSBT_TooltipTextLeft"..i):GetText();
if ( not text ) then
break;
elseif (text and strlower(text) == buff) then
tooltip:Hide();
return "main",me, mc;
end
end
tooltip:Hide();
elseif ( oy ) then
tooltip:SetOwner(UIParent, "ANCHOR_NONE");
tooltip:SetInventoryItem( unit, 17);
for i=1, 23 do
local text = getglobal("MSBT_TooltipTextLeft"..i):GetText();
if ( not text ) then
break;
elseif (text and strlower(text) == buff) then
tooltip:Hide();
return "off", oe, oc;
end
end
tooltip:Hide();
end
if ( item ) then return end
tooltip:SetOwner(UIParent, "ANCHOR_NONE");
tooltip:SetTrackingSpell();
local b = textleft1:GetText();
if ( b and strlower(b) == buff ) then
tooltip:Hide();
return "track",b;
end
local c=nil;
for i=1, 32 do
tooltip:SetOwner(UIParent, "ANCHOR_NONE");
tooltip:SetUnitBuff(unit, i);
b = textleft1:GetText();
tooltip:Hide();
if ( b and strlower(b) == buff ) then
return "buff", i, b;
elseif ( c==b ) then
break;
end
--c = b;
end
c=nil;
for i=1, 16 do
tooltip:SetOwner(UIParent, "ANCHOR_NONE");
tooltip:SetUnitDebuff(unit, i);
b = textleft1:GetText();
tooltip:Hide();
if ( b and strlower(b) == buff ) then
return "debuff", i, b;
elseif ( c==b) then
break;
end
--c = b;
end
tooltip:Hide();
end
-- **********************************************************************************
-- This function gets the next animation display info object for the correct
@@ -1769,18 +2093,55 @@ function MikSBT.DoAnimation(animDisplayInfo, scrollArea)
local textDelta = animDisplayInfo.FontSize * (1 - (elapsedTime / STICKY_FADE_IN_TIME));
animDisplayInfo.FontObject:SetTextHeight(animDisplayInfo.FontSize + textDelta);
animDisplayInfo.FontObject:SetAlpha(1);
if animDisplayInfo.Texture then
animDisplayInfo.Texture:SetAlpha(1);
animDisplayInfo.Texture:SetWidth(animDisplayInfo.FontSize + textDelta);
animDisplayInfo.Texture:SetHeight(animDisplayInfo.FontSize + textDelta);
end
return;
elseif (elapsedTime <= (STICKY_DISPLAY_TIME + STICKY_FADE_IN_TIME)) then
animDisplayInfo.FontObject:SetTextHeight(animDisplayInfo.FontSize);
if animDisplayInfo.Texture then
animDisplayInfo.Texture:SetWidth(animDisplayInfo.FontSize);
animDisplayInfo.Texture:SetHeight(animDisplayInfo.FontSize);
end
if animDisplayInfo.IsCrit then
if not animDisplayInfo.timeLastJiggled then
animDisplayInfo.originalPositionX = animDisplayInfo.PositionX
animDisplayInfo.originalPositionY = animDisplayInfo.PositionY
animDisplayInfo.DecalageX = 0
animDisplayInfo.DecalageY = 0
animDisplayInfo.timeLastJiggled = 0
end
if animDisplayInfo.PositionY ~= (animDisplayInfo.originalPositionY + animDisplayInfo.DecalageY) then
animDisplayInfo.originalPositionX = animDisplayInfo.PositionX
animDisplayInfo.originalPositionY = animDisplayInfo.PositionY
end
if (elapsedTime - animDisplayInfo.timeLastJiggled > 0.05) then
animDisplayInfo.DecalageX = math.ceil(math.random(-1, 1));
animDisplayInfo.DecalageY = math.ceil(math.random(-1, 1));
animDisplayInfo.PositionX = animDisplayInfo.originalPositionX + animDisplayInfo.DecalageX;
animDisplayInfo.PositionY = animDisplayInfo.originalPositionY + animDisplayInfo.DecalageY;
animDisplayInfo.timeLastJiggled = elapsedTime;
animDisplayInfo.FontObject:SetPoint(animDisplayInfo.AnchorPoint, animDisplayInfo.PositionX, animDisplayInfo.PositionY);
end
end
return;
elseif (elapsedTime <= (STICKY_DISPLAY_TIME + STICKY_FADE_IN_TIME + STICKY_FADE_OUT_TIME)) then
local alpha = 1 - ((elapsedTime - STICKY_DISPLAY_TIME - STICKY_FADE_IN_TIME) / STICKY_FADE_OUT_TIME);
animDisplayInfo.timeLastJiggled = nil
animDisplayInfo.FontObject:SetAlpha(alpha);
if animDisplayInfo.Texture then
animDisplayInfo.Texture:SetAlpha(alpha);
end
return;
end
-- Deactivate the animation.
animDisplayInfo.FontObject:SetAlpha(0);
if animDisplayInfo.Texture then
animDisplayInfo.Texture:SetAlpha(0);
end
animDisplayInfo.IsActive = false;
return;
@@ -1797,6 +2158,9 @@ function MikSBT.DoAnimation(animDisplayInfo, scrollArea)
if (animationComplete) then
-- Set the font object's alpha.
animDisplayInfo.FontObject:SetAlpha(0);
if animDisplayInfo.Texture then
animDisplayInfo.Texture:SetAlpha(0);
end
-- Deactive the animation.
animDisplayInfo.IsActive = false;
@@ -1804,6 +2168,9 @@ function MikSBT.DoAnimation(animDisplayInfo, scrollArea)
-- Move the font object and set its alpha.
animDisplayInfo.FontObject:SetPoint(animDisplayInfo.AnchorPoint, animDisplayInfo.PositionX, animDisplayInfo.PositionY);
animDisplayInfo.FontObject:SetAlpha(animDisplayInfo.Alpha);
if animDisplayInfo.Texture then
animDisplayInfo.Texture:SetAlpha(animDisplayInfo.Alpha);
end
end
-- Set the last update to the current time.
@@ -2151,7 +2518,7 @@ end
-- Displays the passed message in the passed scroll area with the passed parameters.
-- This function is for easy displaying of messages from external sources.
-- **********************************************************************************
function MikSBT.DisplayMessage(message, displayType, isSticky, colorR, colorG, colorB, fontSize, fontIndex, outlineIndex)
function MikSBT.DisplayMessage(message, displayType, isSticky, colorR, colorG, colorB, fontSize, fontIndex, outlineIndex, Texture)
-- Check if no message was passed and do nothing.
if (message == nil) then
return;
@@ -2235,6 +2602,7 @@ function MikSBT.DisplayMessage(message, displayType, isSticky, colorR, colorG, c
animationEvent.ColorR = colorR;
animationEvent.ColorG = colorG;
animationEvent.ColorB = colorB;
animationEvent.Texture = Texture;
-- Add the event to the animation system.
@@ -1,8 +1,17 @@
## Interface: 11200
## Version: 3.01
## Version: 3.9
## Title: Mik's Scrolling Battle Text
## Notes: Scrolls battle information around the character model.
## OptionalDeps: SW_FixLogStrings
## SavedVariables: MikSBT_Save
Libs\AceLibrary\AceLibrary.lua
Libs\AceLocale-2.2\AceLocale-2.2.lua
Libs\BabbleSpell-2.2\Babble-Spell-2.2.lua
MikScrollingBattleText-enUS.lua
MikScrollingBattleText-frFR.lua
localization.lua
MikTableRecyclerObject.lua
MikCombatEventHelper.lua
@@ -11,6 +11,15 @@
</Scripts>
</Frame>
<!-- Tooltip -->
<GameTooltip name="MSBT_Tooltip" frameStrata="TOOLTIP" hidden="true" parent="UIParent" inherits="GameTooltipTemplate">
<Scripts>
<OnLoad>
this:SetOwner(WorldFrame, "ANCHOR_NONE");
</OnLoad>
</Scripts>
</GameTooltip>
<!-- Incoming Scroll Area -->
<Frame name="MSBTFrameIncoming" toplevel="true" enableMouse="false" parent="UIParent" frameStrata="HIGH" hidden="true">
<Size>
@@ -29,91 +38,101 @@
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText2" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText3" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText4" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText5" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText6" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText7" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText8" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText9" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText10" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText11" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText12" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText13" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText14" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText15" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText16" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
</FontString>
<FontString name="$parentText17" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
</FontString>
<FontString name="$parentText18" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
</FontString>
<FontString name="$parentText19" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
</FontString>
<FontString name="$parentText20" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMRIGHT" />
</Anchors>
</FontString>
</Layer>
</Layers>
@@ -140,91 +159,101 @@
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText2" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText3" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText4" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText5" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText6" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText7" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText8" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText9" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText10" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText11" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText12" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText13" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText14" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText15" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText16" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
</FontString>
<FontString name="$parentText17" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
</FontString>
<FontString name="$parentText18" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
</FontString>
<FontString name="$parentText19" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
</FontString>
<FontString name="$parentText20" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
</FontString>
</Layer>
</Layers>
@@ -251,91 +280,101 @@
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText2" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText3" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText4" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText5" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText6" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText7" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText8" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText9" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText10" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText11" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOM" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText12" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText13" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText14" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText15" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
<Shadow />
</FontString>
<FontString name="$parentText16" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
</FontString>
<FontString name="$parentText17" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
</FontString>
<FontString name="$parentText18" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
</FontString>
<FontString name="$parentText19" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
</FontString>
<FontString name="$parentText20" inherits="MasterFont">
<Anchors>
<Anchor point="BOTTOMLEFT" />
</Anchors>
</FontString>
</Layer>
</Layers>
@@ -1,6 +1,7 @@
-------------------------------------------------------------------------------------
-- Title: Mik's Table Recyler Object
-- Author: Mik
-- Maintainer: Athene
-- Credits:
-- Thanks to tekkub, the author of compostLib. I adapted much of his code for
-- this object.
+172 -120
View File
@@ -1,6 +1,7 @@
-------------------------------------------------------------------------------------
-- Title: Mik's Scrolling Battle Text
-- Author: Mik
-- Maintainer: Athene
-------------------------------------------------------------------------------------
-- Create "namespace."
@@ -11,12 +12,14 @@ MikSBT = {};
-------------------------------------------------------------------------------
MikSBT.MOD_NAME = "MikScrollingBattleText"
MikSBT.VERSION_NUMBER = 3.01;
MikSBT.VERSION_STRING = "v3.01";
MikSBT.WINDOW_TITLE = "Mik's Scrolling Battle Text " .. MikSBT.VERSION_STRING;
MikSBT.VERSION_NUMBER = 3.9;
MikSBT.VERSION_STRING = "v3.9";
MikSBT.WINDOW_TITLE = "Mik's Scrolling Battle Text " .. MikSBT.VERSION_STRING .. " - \124cffF58CBA\124hAthene Edit\124h\124r";
MikSBT.COMMAND = "/msbt";
local BS = AceLibrary("Babble-Spell-2.2")
local L = AceLibrary("AceLocale-2.2"):new(MikSBT.MOD_NAME)
-------------------------------------------------------------------------------
-- English (Default)
@@ -53,25 +56,25 @@ MikSBT.COMMAND_USAGE = {
-- Output messages
------------------------------
MikSBT.MSG_DEBUG_ENABLE = "Debug mode has been enabled.";
MikSBT.MSG_DEBUG_DISABLE = "Debug mode has been disabled.";
MikSBT.MSG_SEARCH_ENABLE = "Event search mode has been enabled. Searching for: ";
MikSBT.MSG_SEARCH_DISABLE = "Event search mode has been disabled.";
MikSBT.MSG_DISABLE = "The mod is now disabled.";
MikSBT.MSG_ENABLE = "The mod is now enabled.";
MikSBT.MSG_HITS = "Hits";
MikSBT.MSG_CRIT = "Crit";
MikSBT.MSG_CRITS = "Crits";
MikSBT.MSG_MULTIPLE_TARGETS = "Multiple";
MikSBT.MSG_VULERNABLE_TRAILER = " (%d vulnerability)";
MikSBT.MSG_OVERHEAL_TRAILER = " <%d>";
MikSBT.MSG_PROFILE_RESET = "Profile Reset";
MikSBT.MSG_ENVIRONMENTAL_DROWNING = "Drowning";
MikSBT.MSG_ENVIRONMENTAL_FALLING = "Falling";
MikSBT.MSG_ENVIRONMENTAL_FATIGUE = "Fatigue";
MikSBT.MSG_ENVIRONMENTAL_FIRE = "Fire";
MikSBT.MSG_ENVIRONMENTAL_LAVA = "Lava";
MikSBT.MSG_ENVIRONMENTAL_SLIME = "Slime";
MikSBT.MSG_DEBUG_ENABLE = L["Debug mode has been enabled."];
MikSBT.MSG_DEBUG_DISABLE = L["Debug mode has been disabled."];
MikSBT.MSG_SEARCH_ENABLE = L["Event search mode has been enabled. Searching for: "];
MikSBT.MSG_SEARCH_DISABLE = L["Event search mode has been disabled."];
MikSBT.MSG_DISABLE = L["The mod is now disabled."];
MikSBT.MSG_ENABLE = L["The mod is now enabled."];
MikSBT.MSG_HITS = L["Hits"];
MikSBT.MSG_CRIT = L["Crit"];
MikSBT.MSG_CRITS = L["Crits"];
MikSBT.MSG_MULTIPLE_TARGETS = L["Multiple"];
MikSBT.MSG_VULERNABLE_TRAILER = L[" (%d vulnerability)"];
MikSBT.MSG_OVERHEAL_TRAILER = L[" <\124cff00b37e\124h%d\124h\124r>"];
MikSBT.MSG_PROFILE_RESET = L["Profile Reset"];
MikSBT.MSG_ENVIRONMENTAL_DROWNING = L["Drowning"];
MikSBT.MSG_ENVIRONMENTAL_FALLING = L["Falling"];
MikSBT.MSG_ENVIRONMENTAL_FATIGUE = L["Fatigue"];
MikSBT.MSG_ENVIRONMENTAL_FIRE = L["Fire"];
MikSBT.MSG_ENVIRONMENTAL_LAVA = L["Lava"];
MikSBT.MSG_ENVIRONMENTAL_SLIME = L["Slime"];
@@ -89,6 +92,11 @@ MikSBT.AVAILABLE_FONTS = {
[6] = {Name="Friz", Path="Fonts\\FRIZQT__.TTF"},
[7] = {Name="Porky", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\porky.ttf"},
[8] = {Name="Signature", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\signature.ttf"},
[9] = {Name="Black Castle", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\BlackCastleMF.ttf"},
[10] = {Name="Exocet", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\exocet.ttf"},
[11] = {Name="FuturaBold", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\FuturaBold.ttf"},
[12] = {Name="Mail Ray Stuff", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\mailrays.ttf"},
[13] = {Name="Pepsi", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\pepsi.ttf"},
};
-- Holds the available font outlines.
@@ -151,20 +159,20 @@ MikSBT.DEFAULT_CONFIG = {
CreationVersion = MikSBT.VERSION_NUMBER,
ShowPartialEffects = true,
ShowOverheals = true,
ShowGameDamage = false,
ShowGameDamage = true,
UseStickyCrits = true,
AnimationStep = 2,
AnimationStep = 1.5,
MasterFontSettings = {
Normal = {FontIndex=1, OutlineIndex=3, FontSize=18},
Crit = {FontIndex=1, OutlineIndex=3, FontSize=26},
Normal = {FontIndex=7, OutlineIndex=2, FontSize=18},
Crit = {FontIndex=7, OutlineIndex=2, FontSize=26},
},
DisplaySettings = {
Incoming = {
Show = true,
FrameOffsets = {x=-60, y=-160},
AnimationStyle = 2,
ScrollDirection = 2,
ScrollHeight = 260,
FrameOffsets = {x=-450, y=-170},
AnimationStyle = 1,
ScrollDirection = 1,
ScrollHeight = 450,
FontSettings = {
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
Crit = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -173,10 +181,10 @@ MikSBT.DEFAULT_CONFIG = {
},
Outgoing = {
Show = true,
FrameOffsets = {x=60, y=-160},
AnimationStyle = 3,
ScrollDirection = 2,
ScrollHeight = 260,
FrameOffsets = {x=450, y=-170},
AnimationStyle = 1,
ScrollDirection = 1,
ScrollHeight = 450,
FontSettings = {
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
Crit = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -185,8 +193,8 @@ MikSBT.DEFAULT_CONFIG = {
},
Notification = {
Show = true,
FrameOffsets = {x=0, y=100},
AnimationStyle = 1,
FrameOffsets = {x=-300, y=-322},
AnimationStyle = 1,
ScrollDirection = 1,
ScrollHeight = 150,
FontSettings = {
@@ -199,16 +207,16 @@ MikSBT.DEFAULT_CONFIG = {
EventSettings = {
MSBT_EVENTTYPE_INCOMING_DAMAGE = {
Show = true,
Message = "(%n) -%a",
Message = "-%a",
FontSettings = {
Color = {r=1, g=0, b=0},
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
Crit = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_INCOMING_MISS = {
Show = true,
Message = "Miss!",
Message = MISS.."!",
FontSettings = {
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -216,7 +224,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_DODGE = {
Show = true,
Message = "Dodge!",
Message = DODGE.."!",
FontSettings = {
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -224,7 +232,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_PARRY = {
Show = true,
Message = "Parry!",
Message = PARRY.."!",
FontSettings = {
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -232,7 +240,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_BLOCK = {
Show = true,
Message = "Block!",
Message = BLOCK.."!",
FontSettings = {
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -240,7 +248,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_ABSORB = {
Show = true,
Message = "Absorb!",
Message = ABSORB.."!",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -248,7 +256,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_IMMUNE = {
Show = true,
Message = "Immune!",
Message = IMMUNE.."!",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -256,24 +264,24 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_SPELL_DAMAGE = {
Show = true,
Message = "(%s) -%a",
Message = "-%a",
FontSettings = {
Color = {r=0.502, g=0, b=0.502},
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
Crit = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_INCOMING_SPELL_DOT = {
Show = true,
Message = "(%s) -%a",
Message = "-%a",
FontSettings = {
Color = {r=0.502, g=0, b=0.502},
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_INCOMING_SPELL_MISS = {
Show = true,
Message = "(%s) Miss!",
Message = MISS.."!",
FontSettings = {
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -281,7 +289,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_SPELL_DODGE = {
Show = true,
Message = "(%s) Dodge!",
Message = DODGE.."!",
FontSettings = {
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -289,7 +297,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_SPELL_PARRY = {
Show = true,
Message = "(%s) Parry!",
Message = PARRY.."!",
FontSettings = {
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -297,7 +305,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_SPELL_BLOCK = {
Show = true,
Message = "(%s) Block!",
Message = BLOCK.."!",
FontSettings = {
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -305,7 +313,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_SPELL_RESIST = {
Show = true,
Message = "(%s) Resist!",
Message = "(%s) "..RESIST.."!",
FontSettings = {
Color = {r=0.502, g=0, b=0.502},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -313,7 +321,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_SPELL_ABSORB = {
Show = true,
Message = "(%s) Absorb!",
Message = "(%s) "..ABSORB.."!",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -321,7 +329,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_SPELL_IMMUNE = {
Show = true,
Message = "(%s) Immune!",
Message = "(%s) "..IMMUNE.."!",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -329,7 +337,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_SPELL_REFLECT = {
Show = true,
Message = "(%s) Reflect!",
Message = "(%s) "..REFLECT.."!",
FontSettings = {
Color = {r=0.502, g=0, b=0.502},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -338,7 +346,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_HEAL = {
Show = true,
Message = "(%s - %n) +%a",
Message = "+%a (%n)",
FontSettings = {
Color = {r=0, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -347,7 +355,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_INCOMING_HOT = {
Show = true,
Message = "(%s - %n) +%a",
Message = "+%a (%n)",
FontSettings = {
Color = {r=0, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -367,46 +375,46 @@ MikSBT.DEFAULT_CONFIG = {
Show = true,
Message = "%a",
FontSettings = {
Color = {r=1, g=1, b=1},
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
Crit = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_OUTGOING_MISS = {
Show = true,
Message = "Miss!",
Message = MISS.."!",
FontSettings = {
Color = {r=1, g=1, b=1},
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_OUTGOING_DODGE = {
Show = true,
Message = "Dodge!",
Message = DODGE.."!",
FontSettings = {
Color = {r=1, g=1, b=1},
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_OUTGOING_PARRY = {
Show = true,
Message = "Parry!",
Message = PARRY.."!",
FontSettings = {
Color = {r=1, g=1, b=1},
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_OUTGOING_BLOCK = {
Show = true,
Message = "Block!",
Message = BLOCK.."!",
FontSettings = {
Color = {r=1, g=1, b=1},
Color = {r=0, g=0, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_OUTGOING_ABSORB = {
Show = true,
Message = "Absorb!",
Message = ABSORB.."!",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -414,7 +422,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_IMMUNE = {
Show = true,
Message = "Immune!",
Message = IMMUNE.."!",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -422,7 +430,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_EVADE = {
Show = true,
Message = "Evade!",
Message = EVADE.."!",
FontSettings = {
Color = {r=1, g=0.502, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=22},
@@ -430,7 +438,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_SPELL_DAMAGE = {
Show = true,
Message = "%a (%s)",
Message = "%a",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -439,7 +447,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_SPELL_DOT = {
Show = true,
Message = "%a (%s)",
Message = "%a",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -447,39 +455,39 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_SPELL_MISS = {
Show = true,
Message = "Miss! (%s)",
Message = MISS.."!",
FontSettings = {
Color = {r=1, g=1, b=1},
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_OUTGOING_SPELL_DODGE = {
Show = true,
Message = "Dodge! (%s)",
Message = DODGE.."!",
FontSettings = {
Color = {r=1, g=1, b=1},
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_OUTGOING_SPELL_PARRY = {
Show = true,
Message = "Parry! (%s)",
Message = PARRY.."!",
FontSettings = {
Color = {r=1, g=1, b=1},
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_OUTGOING_SPELL_BLOCK = {
Show = true,
Message = "Block! (%s)",
Message = BLOCK.."!",
FontSettings = {
Color = {r=1, g=1, b=1},
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_OUTGOING_SPELL_RESIST = {
Show = true,
Message = "Resist! (%s)",
Message = RESIST.."!",
FontSettings = {
Color = {r=0.502, g=0.502, b=0.698},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -487,7 +495,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_SPELL_ABSORB = {
Show = true,
Message = "Absorb! (%s)",
Message = "(%s) "..ABSORB.."!",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -495,7 +503,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_SPELL_IMMUNE = {
Show = true,
Message = "Immune! (%s)",
Message = "(%s) "..IMMUNE.."!",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -503,7 +511,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_SPELL_REFLECT = {
Show = true,
Message = "Reflect! (%s)",
Message = "(%s) "..REFLECT.."!",
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -512,7 +520,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_SPELL_EVADE = {
Show = true,
Message = "Evade! (%s)",
Message = "(%s) "..EVADE.."!",
FontSettings = {
Color = {r=1, g=0.502, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=22},
@@ -520,7 +528,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_HEAL = {
Show = true,
Message = "+%a (%s - %n)",
Message = "+%a",
FontSettings = {
Color = {r=0, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -529,7 +537,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_HOT = {
Show = true,
Message = "+%a (%s - %n)",
Message = "+%a",
FontSettings = {
Color = {r=0, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -549,7 +557,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_MISS = {
Show = true,
Message = "Pet Miss!",
Message = "Pet "..MISS.."!",
FontSettings = {
Color = {r=1, g=0.502, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -557,7 +565,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_DODGE = {
Show = true,
Message = "Pet Dodge!",
Message = "Pet "..DODGE.."!",
FontSettings = {
Color = {r=1, g=0.502, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -565,7 +573,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_PARRY = {
Show = true,
Message = "Pet Parry!",
Message = "Pet "..PARRY.."!",
FontSettings = {
Color = {r=1, g=0.502, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -573,7 +581,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_BLOCK = {
Show = true,
Message = "Pet Block!",
Message = "Pet "..BLOCK.."!",
FontSettings = {
Color = {r=1, g=0.502, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -581,7 +589,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_ABSORB = {
Show = true,
Message = "Pet Absorb!",
Message = "Pet "..ABSORB.."!",
FontSettings = {
Color = {r=0.502, g=0.502, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -589,7 +597,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_IMMUNE = {
Show = true,
Message = "Pet Immune!",
Message = "Pet "..IMMUNE.."!",
FontSettings = {
Color = {r=0.502, g=0.502, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -597,7 +605,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_EVADE = {
Show = true,
Message = "Pet Evade!",
Message = "Pet "..EVADE.."!",
FontSettings = {
Color = {r=1, g=0.502, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -614,7 +622,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_SPELL_MISS = {
Show = true,
Message = "Pet Miss! (%s)",
Message = "Pet "..MISS.."! (%s)",
FontSettings = {
Color = {r=0.33, g=0.33, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -622,7 +630,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_SPELL_DODGE = {
Show = true,
Message = "Pet Dodge! (%s)",
Message = "Pet "..DODGE.."! (%s)",
FontSettings = {
Color = {r=0.33, g=0.33, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -630,7 +638,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_SPELL_PARRY = {
Show = true,
Message = "Pet Parry! (%s)",
Message = "Pet "..PARRY.."! (%s)",
FontSettings = {
Color = {r=0.33, g=0.33, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -638,7 +646,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_SPELL_BLOCK = {
Show = true,
Message = "Pet Block! (%s)",
Message = "Pet "..BLOCK.."! (%s)",
FontSettings = {
Color = {r=0.33, g=0.33, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -646,7 +654,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_SPELL_RESIST = {
Show = true,
Message = "Pet Resist! (%s)",
Message = "Pet "..RESIST.."! (%s)",
FontSettings = {
Color = {r=0.502, g=0.502, b=0.698},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -654,7 +662,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_SPELL_ABSORB = {
Show = true,
Message = "Pet Absorb! (%s)",
Message = "Pet "..ABSORB.."! (%s)",
FontSettings = {
Color = {r=0.502, g=0.502, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -662,7 +670,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_SPELL_IMMUNE = {
Show = true,
Message = "Pet Immune! (%s)",
Message = "Pet "..IMMUNE.."! (%s)",
FontSettings = {
Color = {r=0.502, g=0.502, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
@@ -670,7 +678,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_OUTGOING_PET_SPELL_EVADE = {
Show = true,
Message = "Pet Evade! (%s)",
Message = "Pet "..EVADE.."! (%s)",
FontSettings = {
Color = {r=1, g=0.502, b=1},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=22},
@@ -735,19 +743,19 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_NOTIFICATION_POWER_GAIN = {
Show = true,
Message = "+%a %s",
Message = "+%a",
IsSticky = false,
FontSettings = {
Color = {r=1, g=1, b=0},
Color = {r=0.3098039215686275, g=0.3098039215686275, b=0.8784313725490196},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
MSBT_EVENTTYPE_NOTIFICATION_POWER_LOSS = {
Show = true,
Message = "-%a %s",
Message = "-%a",
IsSticky = false,
FontSettings = {
Color = {r=1, g=1, b=0},
Color = {r=0.7568627450980392, g=0.2705882352941176, b=0.8235294117647058},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=0},
},
},
@@ -771,7 +779,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_NOTIFICATION_HONOR_GAIN = {
Show = true,
Message = "+%a Honor",
Message = "+%a "..HONOR,
IsSticky = false,
FontSettings = {
Color = {r=0.502, g=0.502, b=0.698},
@@ -780,7 +788,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_NOTIFICATION_REP_GAIN = {
Show = true,
Message = "+%a Reputation (%s)",
Message = "+%a "..TUTORIAL_TITLE16.." (%s)",
IsSticky = false,
FontSettings = {
Color = {r=0.502, g=0.502, b=0.698},
@@ -789,7 +797,7 @@ MikSBT.DEFAULT_CONFIG = {
},
MSBT_EVENTTYPE_NOTIFICATION_REP_LOSS = {
Show = true,
Message = "-%a Reputation (%s)",
Message = "-%a "..TUTORIAL_TITLE16.." (%s)",
IsSticky = false,
FontSettings = {
Color = {r=0.502, g=0.502, b=0.698},
@@ -849,6 +857,7 @@ MikSBT.DEFAULT_CONFIG = {
TriggerType = 1,
Threshold = 40,
},
Texture = "Interface\\Icons\\spell_holy_sealofsacrifice"
},
MSBT_TRIGGER_LOW_MANA = {
EventSettings = {
@@ -881,11 +890,12 @@ MikSBT.DEFAULT_CONFIG = {
TriggerType = 3,
Threshold = 40,
},
Texture = "Interface\\Icons\\spell_holy_sealofsacrifice"
},
MSBT_TRIGGER_EXECUTE = {
EventSettings = {
Show = true,
Message = "Execute!",
Message = BS["Execute"].."!",
IsSticky = true,
FontSettings = {
Color = {r=1, g=1, b=0},
@@ -893,15 +903,33 @@ MikSBT.DEFAULT_CONFIG = {
},
},
TriggerSettings = {
Classes = {PALADIN=true,WARRIOR=true},
Classes = {WARRIOR=true},
TriggerType = 4,
Threshold = 20,
},
Texture = "Interface\\Icons\\inv_sword_48"
},
MSBT_TRIGGER_HAMMER_OF_WRATH = {
EventSettings = {
Show = true,
Message = BS["Hammer of Wrath"].."!",
IsSticky = true,
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=26},
},
},
TriggerSettings = {
Classes = {PALADIN=true},
TriggerType = 4,
Threshold = 20,
},
Texture = "Interface\\Icons\\ability_thunderclap"
},
MSBT_TRIGGER_COUNTER_ATTACK = {
EventSettings = {
Show = true,
Message = "Counterattack!",
Message = BS["Counterattack"].."!",
IsSticky = true,
FontSettings = {
Color = {r=1, g=1, b=0},
@@ -915,11 +943,12 @@ MikSBT.DEFAULT_CONFIG = {
"CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE", "CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE", "CHAT_MSG_SPELL_PARTY_DAMAGE"},
SearchPatterns = {"VSPARRYOTHERSELF", "SPELLPARRIEDOTHERSELF"},
},
Texture = "Interface\\Icons\\ability_warrior_challange"
},
MSBT_TRIGGER_MONGOOSE_BITE = {
EventSettings = {
Show = true,
Message = "Mongoose Bite!",
Message = BS["Mongoose Bite"].."!",
IsSticky = true,
FontSettings = {
Color = {r=1, g=1, b=0},
@@ -933,11 +962,12 @@ MikSBT.DEFAULT_CONFIG = {
"CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE", "CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE", "CHAT_MSG_SPELL_PARTY_DAMAGE"},
SearchPatterns = {"VSDODGEOTHERSELF", "SPELLDODGEDOTHERSELF"},
},
Texture = "Interface\\Icons\\ability_hunter_swiftstrike"
},
MSBT_TRIGGER_CLEARCAST = {
EventSettings = {
Show = true,
Message = "Clearcast!",
Message = BS["Clearcasting"].."!",
IsSticky = true,
FontSettings = {
Color = {r=1, g=1, b=0},
@@ -948,13 +978,14 @@ MikSBT.DEFAULT_CONFIG = {
Classes = {MAGE=true,SHAMAN=true},
TriggerType = 6,
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
SearchPatterns = {"You gain Clearcast"},
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, BS["Clearcasting"])},
},
Texture = "Interface\\Icons\\spell_shadow_manaburn"
},
MSBT_TRIGGER_RIPOSTE = {
EventSettings = {
Show = true,
Message = "Riposte!",
Message = BS["Riposte"].."!",
IsSticky = true,
FontSettings = {
Color = {r=1, g=1, b=0},
@@ -968,6 +999,7 @@ MikSBT.DEFAULT_CONFIG = {
"CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE", "CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE", "CHAT_MSG_SPELL_PARTY_DAMAGE"},
SearchPatterns = {"VSPARRYOTHERSELF", "SPELLPARRIEDOTHERSELF"},
},
Texture = "Interface\\Icons\\ability_warrior_challange"
},
MSBT_TRIGGER_WINDFURY = {
EventSettings = {
@@ -982,13 +1014,31 @@ MikSBT.DEFAULT_CONFIG = {
TriggerSettings = {
TriggerType = 6,
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
SearchPatterns = {"You gain %d extra attacks through Windfury"},
SearchPatterns = {string.format(SPELLEXTRAATTACKSSELF, 1, BS["Windfury Weapon"])}, --"Vous gagnez %d attaques supplémentaires grâce à Arme Furie-des-vents"
},
Texture = "Interface\\Icons\\spell_nature_cyclone"
},
MSBT_TRIGGER_HAND_OF_JUSTICE = {
EventSettings = {
Show = true,
Message = BS["Hand of Justice"].."!",
IsSticky = true,
FontSettings = {
Color = {r=1, g=1, b=0},
Normal = {FontIndex=0, OutlineIndex=0, FontSize=26},
},
},
TriggerSettings = {
TriggerType = 6,
TriggerEvents = {"CHAT_MSG_SPELL_SELF_BUFF"},
SearchPatterns = {string.format(SPELLEXTRAATTACKSSELF, 1, BS["Hand of Justice"])}, --"Vous gagnez %d attaques supplémentaires grâce à Main de justice"
},
Texture = "Interface\\Icons\\inv_jewelry_talisman_01"
},
MSBT_TRIGGER_NIGHTFALL = {
EventSettings = {
Show = true,
Message = "Nightfall!",
Message = BS["Nightfall"].."!",
IsSticky = true,
FontSettings = {
Color = {r=0.709, g=0, b=0.709},
@@ -999,13 +1049,14 @@ MikSBT.DEFAULT_CONFIG = {
Classes = {WARLOCK=true},
TriggerType = 6,
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
SearchPatterns = {"You gain Shadow Trance"},
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, BS["Shadow Trance"])},
},
Texture = "Interface\\Icons\\spell_shadow_twilight"
},
MSBT_TRIGGER_OVERPOWER = {
EventSettings = {
Show = true,
Message = "Overpower!",
Message = BS["Overpower"].."!",
IsSticky = true,
FontSettings = {
Color = {r=1, g=1, b=0},
@@ -1018,6 +1069,7 @@ MikSBT.DEFAULT_CONFIG = {
TriggerEvents = {"CHAT_MSG_COMBAT_SELF_MISSES", "CHAT_MSG_SPELL_SELF_DAMAGE"},
SearchPatterns = {"VSDODGESELFOTHER", "SPELLDODGEDSELFOTHER"},
},
Texture = "Interface\\Icons\\ability_meleedamage"
},
},
Binary file not shown.
Binary file not shown.
+26 -4
View File
@@ -1,6 +1,7 @@
-------------------------------------------------------------------------------------
-- Title: Mik's Scrolling Battle Text Options
-- Author: Mik
-- Maintainer: Athene
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
@@ -34,7 +35,7 @@ local MAX_ANIMATION_STEP = 5;
-- The min and max scroll heights.
local MIN_SCROLL_HEIGHT = 100;
local MAX_SCROLL_HEIGHT = 300;
local MAX_SCROLL_HEIGHT = 600;
-- The size of an event settings line and number of event items per page.
local EVENT_ITEM_HEIGHT = 25;
@@ -821,7 +822,7 @@ end
function MikSBTOpt.InitSliders()
-- Initialize the Animation Step slider.
local key = "Tab1FrameAnimationStepSlider";
MikSBTOpt.SetupSlider(OPTIONS_FRAME_NAME .. key, MikSBTOpt.SLIDERS[key].Label, MikSBTOpt.SLIDERS[key].Tooltip, MIN_ANIMATION_STEP, MAX_ANIMATION_STEP, 1, "AnimationStep");
MikSBTOpt.SetupSlider(OPTIONS_FRAME_NAME .. key, MikSBTOpt.SLIDERS[key].Label, MikSBTOpt.SLIDERS[key].Tooltip, MIN_ANIMATION_STEP, MAX_ANIMATION_STEP, 0.5, "AnimationStep");
-- Initialize the scroll height slider.
key = "ScrollHeightSlider";
@@ -1332,6 +1333,8 @@ function MikSBTOpt.InitEditboxes()
key = "XOffsetEditbox"; MikSBTOpt.SetupEditbox(SCROLL_AREA_MOVER_CONTROL_FRAME_NAME .. key, MikSBTOpt.EDITBOXES[key].Label, MikSBTOpt.EDITBOXES[key].Tooltip, nil);
key = "YOffsetEditbox"; MikSBTOpt.SetupEditbox(SCROLL_AREA_MOVER_CONTROL_FRAME_NAME .. key, MikSBTOpt.EDITBOXES[key].Label, MikSBTOpt.EDITBOXES[key].Tooltip, nil);
key = "IconNameEditbox"; MikSBTOpt.SetupEditbox(TRIGGER_CONFIGURATION_FRAME_NAME .. key, MikSBTOpt.EDITBOXES[key].Label, MikSBTOpt.EDITBOXES[key].Tooltip, nil);
key = "SearchPattern1Editbox"; MikSBTOpt.SetupEditbox(TRIGGER_CONFIGURATION_FRAME_NAME .. key, MikSBTOpt.EDITBOXES[key].Label, MikSBTOpt.EDITBOXES[key].Tooltip, nil);
key = "SearchPattern2Editbox"; MikSBTOpt.SetupEditbox(TRIGGER_CONFIGURATION_FRAME_NAME .. key, MikSBTOpt.EDITBOXES[key].Label, MikSBTOpt.EDITBOXES[key].Tooltip, nil);
end
@@ -3107,7 +3110,7 @@ function MikSBTOpt.SetupAvailableTriggerEvents()
table.insert(availableTriggerEvents, "CHAT_MSG_COMBAT_CREATURE_VS_SELF_MISSES");
table.insert(availableTriggerEvents, "CHAT_MSG_COMBAT_HOSTILEPLAYER_MISSES");
table.insert(availableTriggerEvents, "CHAT_MSG_COMBAT_PARTY_MISSES");
table.insert(availableTriggerEvents, "CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE");
table.insert(availableTriggerEvents, "CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE"); -- athenne add
table.insert(availableTriggerEvents, "CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE");
table.insert(availableTriggerEvents, "CHAT_MSG_SPELL_PARTY_DAMAGE");
table.insert(availableTriggerEvents, "CHAT_MSG_SPELL_DAMAGESHIELDS_ON_OTHERS");
@@ -3134,6 +3137,7 @@ function MikSBTOpt.SetupAvailableTriggerEvents()
table.insert(availableTriggerEvents, "CHAT_MSG_SKILL");
table.insert(availableTriggerEvents, "CHAT_MSG_COMBAT_XP_GAIN");
table.insert(availableTriggerEvents, "CHAT_MSG_COMBAT_HOSTILE_DEATH");
table.insert(availableTriggerEvents, "CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE");
end
@@ -3235,6 +3239,15 @@ function MikSBTOpt.ShowTriggerConfig(triggerKey)
-- Populate the trigger type.
MikSBTOpt.PopulateDropdown(TRIGGER_CONFIGURATION_FRAME_NAME .. "TriggerTypeDropdown", triggerData.TriggerSettings.TriggerType);
-- Holds the Icon Texture.
local texture = "";
-- Check if there is a texture defined.
if (triggerData.Texture) then
texture = triggerData.Texture or "";
end
MikSBTOpt.PopulateEditbox(TRIGGER_CONFIGURATION_FRAME_NAME .. "IconNameEditbox", texture);
-- Setup the trigger controls appropriately depending on the trigger type.
MikSBTOpt.SetupVariableTriggerControls(triggerKey, triggerData.TriggerSettings.TriggerType == MikCEH.TRIGGERTYPE_SEARCH_PATTERN);
@@ -3272,6 +3285,8 @@ function MikSBTOpt.SetupVariableTriggerControls(triggerKey, showSearch)
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "SearchPattern1Editbox"):Show();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "SearchPattern2Editbox"):Show();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "TextureHorizontalBarBottom"):Show();
-- Clear the selected trigger events.
if (not triggerFrame.SelectedTriggerEvents) then
@@ -3318,6 +3333,8 @@ function MikSBTOpt.SetupVariableTriggerControls(triggerKey, showSearch)
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "TriggerEvent4Checkbox"):Hide();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "SearchPattern1Editbox"):Hide();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "SearchPattern2Editbox"):Hide();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "TextureHorizontalBarBottom"):Hide();
-- Populate the threshold slider.
MikSBTOpt.PopulateSlider(TRIGGER_CONFIGURATION_FRAME_NAME .. "ThresholdSlider", triggerData.TriggerSettings.Threshold or 1);
@@ -3396,7 +3413,12 @@ function MikSBTOpt.SaveTriggerConfig()
-- Save the trigger type.
triggerData.TriggerSettings.TriggerType = UIDropDownMenu_GetSelectedValue(getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "TriggerTypeDropdown"));
-- Save the Icon Name
local texture = getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "IconNameEditbox"):GetText();
if (texture) and (texture ~= "") then
triggerData.Texture = texture;
end
-- Check if the trigger type is search pattern.
if (triggerData.TriggerSettings.TriggerType == MikCEH.TRIGGERTYPE_SEARCH_PATTERN) then
-- Clear the threshold field.
+15 -1
View File
@@ -2013,6 +2013,20 @@
</Anchor>
</Anchors>
</Frame>
<!-- Icon Name Editbox -->
<EditBox name="$parentIconNameEditbox" inherits="MSBTEditboxTemplate">
<Size>
<AbsDimension x="180" y="22" />
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentPriestCheckbox" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="190" y="-30" />
</Offset>
</Anchor>
</Anchors>
</EditBox>
<!-- Threshold Slider -->
<Slider name="$parentThresholdSlider" inherits="MSBTSliderTemplate">
@@ -2226,7 +2240,7 @@
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="8" y="1" />
<AbsDimension x="8" y="-3" />
</Offset>
</Anchor>
</Anchors>
@@ -1,5 +1,5 @@
## Interface: 11200
## Version: 3.0
## Version: 3.9
## Title: Mik's Scrolling Battle Text Options
## Notes: Load on demand options for Mik's Scrolling Battle Text
## Dependencies: MikScrollingBattleText
@@ -1,6 +1,7 @@
-------------------------------------------------------------------------------------
-- Title: Mik's Scrolling Battle Text Options
-- Author: Mik
-- Maintainer: Athene
-------------------------------------------------------------------------------------
-- Create Options "namespace."
@@ -126,6 +127,7 @@ MikSBTOpt.EDITBOXES = {
["Tab1FrameNewProfileNameEditbox"] = { Label="New Profile Name", Tooltip="Allows you to enter the name of a new profile."},
["XOffsetEditbox"] = { Label="X Offset", Tooltip="Allows you to enter the X offset of the selected scroll frame."},
["YOffsetEditbox"] = { Label="Y Offset", Tooltip="Allows you to enter the Y offset of the selected scroll frame."},
["IconNameEditbox"] = { Label="Icon Path", Tooltip="Allows you to enter the path of the file to display as icon."},
["SearchPattern1Editbox"] = { Label="Search Pattern 1", Tooltip="Allows you to enter a search pattern that will cause the trigger to fire."},
["SearchPattern2Editbox"] = { Label="Search Pattern 2", Tooltip="Allows you to enter a search pattern that will cause the trigger to fire."},
};