- Changes to make the live version work with the BfA Beta.

This commit is contained in:
Tercio
2018-05-03 14:51:47 -03:00
parent febf9dd34f
commit 117913ab8d
24 changed files with 501 additions and 116 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="AceAddon-3.0.lua"/>
</Ui>
</Ui>
+7 -3
View File
@@ -9,7 +9,7 @@
-- make into AceComm.
-- @class file
-- @name AceComm-3.0
-- @release $Id: AceComm-3.0.lua 1161 2017-08-12 14:30:16Z funkydude $
-- @release $Id: AceComm-3.0.lua 1171 2018-04-20 07:33:22Z nevcairiel $
--[[ AceComm-3.0
@@ -20,7 +20,7 @@ TODO: Time out old data rotting around from dead senders? Not a HUGE deal since
local CallbackHandler = LibStub("CallbackHandler-1.0")
local CTL = assert(ChatThrottleLib, "AceComm-3.0 requires ChatThrottleLib")
local MAJOR, MINOR = "AceComm-3.0", 10
local MAJOR, MINOR = "AceComm-3.0", 11
local AceComm,oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceComm then return end
@@ -65,7 +65,11 @@ function AceComm:RegisterComm(prefix, method)
if #prefix > 16 then -- TODO: 15?
error("AceComm:RegisterComm(prefix,method): prefix length is limited to 16 characters")
end
RegisterAddonMessagePrefix(prefix)
if C_ChatInfo then
C_ChatInfo.RegisterAddonMessagePrefix(prefix)
else
RegisterAddonMessagePrefix(prefix)
end
return AceComm._RegisterComm(self, prefix, method) -- created by CallbackHandler
end
+1 -1
View File
@@ -2,4 +2,4 @@
..\FrameXML\UI.xsd">
<Script file="ChatThrottleLib.lua"/>
<Script file="AceComm-3.0.lua"/>
</Ui>
</Ui>
+17 -7
View File
@@ -23,7 +23,7 @@
-- LICENSE: ChatThrottleLib is released into the Public Domain
--
local CTL_VERSION = 23
local CTL_VERSION = 24
local _G = _G
@@ -213,9 +213,15 @@ function ChatThrottleLib:Init()
return ChatThrottleLib.Hook_SendChatMessage(...)
end)
--SendAddonMessage
hooksecurefunc("SendAddonMessage", function(...)
return ChatThrottleLib.Hook_SendAddonMessage(...)
end)
if _G.C_ChatInfo then
hooksecurefunc(_G.C_ChatInfo, "SendAddonMessage", function(...)
return ChatThrottleLib.Hook_SendAddonMessage(...)
end)
else
hooksecurefunc("SendAddonMessage", function(...)
return ChatThrottleLib.Hook_SendAddonMessage(...)
end)
end
end
self.nBypass = 0
end
@@ -461,7 +467,7 @@ function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype, target,
local nSize = text:len();
if RegisterAddonMessagePrefix then
if C_ChatInfo or RegisterAddonMessagePrefix then
if nSize>255 then
error("ChatThrottleLib:SendAddonMessage(): message length cannot exceed 255 bytes", 2)
end
@@ -478,7 +484,11 @@ function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype, target,
if not self.bQueueing and nSize < self:UpdateAvail() then
self.avail = self.avail - nSize
bMyTraffic = true
_G.SendAddonMessage(prefix, text, chattype, target)
if _G.C_ChatInfo then
_G.C_ChatInfo.SendAddonMessage(prefix, text, chattype, target)
else
_G.SendAddonMessage(prefix, text, chattype, target)
end
bMyTraffic = false
self.Prio[prio].nTotalSent = self.Prio[prio].nTotalSent + nSize
if callbackFn then
@@ -490,7 +500,7 @@ function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype, target,
-- Message needs to be queued
local msg = NewMsg()
msg.f = _G.SendAddonMessage
msg.f = _G.C_ChatInfo and _G.C_ChatInfo.SendAddonMessage or _G.SendAddonMessage
msg[1] = prefix
msg[2] = text
msg[3] = chattype
+1 -1
View File
@@ -1,4 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="AceLocale-3.0.lua"/>
</Ui>
</Ui>
+1 -1
View File
@@ -284,4 +284,4 @@ end
-- Update embeds
for target, v in pairs(AceSerializer.embeds) do
AceSerializer:Embed(target)
end
end
+1 -1
View File
@@ -1,4 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="AceSerializer-3.0.lua"/>
</Ui>
</Ui>
+17 -15
View File
@@ -15,7 +15,7 @@
-- make into AceTimer.
-- @class file
-- @name AceTimer-3.0
-- @release $Id: AceTimer-3.0.lua 1119 2014-10-14 17:23:29Z nevcairiel $
-- @release $Id: AceTimer-3.0.lua 1170 2018-03-29 17:38:58Z funkydude $
local MAJOR, MINOR = "AceTimer-3.0", 17 -- Bump minor on changes
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
@@ -34,13 +34,15 @@ local function new(self, loop, func, delay, ...)
delay = 0.01 -- Restrict to the lowest time that the C_Timer API allows us
end
local timer = {...}
timer.object = self
timer.func = func
timer.looping = loop
timer.argsCount = select("#", ...)
timer.delay = delay
timer.ends = GetTime() + delay
local timer = {
object = self,
func = func,
looping = loop,
argsCount = select("#", ...),
delay = delay,
ends = GetTime() + delay,
...
}
activeTimers[timer] = timer
@@ -156,7 +158,7 @@ end
--- Cancels all timers registered to the current addon object ('self')
function AceTimer:CancelAllTimers()
for k,v in pairs(activeTimers) do
for k,v in next, activeTimers do
if v.object == self then
AceTimer.CancelTimer(self, k)
end
@@ -187,8 +189,8 @@ if oldminor and oldminor < 10 then
AceTimer.frame:SetScript("OnEvent", nil)
AceTimer.frame:UnregisterAllEvents()
-- convert timers
for object,timers in pairs(AceTimer.selfs) do
for handle,timer in pairs(timers) do
for object,timers in next, AceTimer.selfs do
for handle,timer in next, timers do
if type(timer) == "table" and timer.callback then
local newTimer
if timer.delay then
@@ -214,7 +216,7 @@ elseif oldminor and oldminor < 17 then
-- Clear old timer table and update upvalue
AceTimer.activeTimers = {}
activeTimers = AceTimer.activeTimers
for handle, timer in pairs(oldTimers) do
for handle, timer in next, oldTimers do
local newTimer
-- Stop the old timer animation
local duration, elapsed = timer:GetDuration(), timer:GetElapsed()
@@ -232,7 +234,7 @@ elseif oldminor and oldminor < 17 then
-- Migrate transitional handles
if oldminor < 13 and AceTimer.hashCompatTable then
for handle, id in pairs(AceTimer.hashCompatTable) do
for handle, id in next, AceTimer.hashCompatTable do
local t = activeTimers[id]
if t then
activeTimers[id] = nil
@@ -257,7 +259,7 @@ local mixins = {
function AceTimer:Embed(target)
AceTimer.embeds[target] = true
for _,v in pairs(mixins) do
for _,v in next, mixins do
target[v] = AceTimer[v]
end
return target
@@ -271,6 +273,6 @@ function AceTimer:OnEmbedDisable(target)
target:CancelAllTimers()
end
for addon in pairs(AceTimer.embeds) do
for addon in next, AceTimer.embeds do
AceTimer:Embed(addon)
end
+1 -1
View File
@@ -1,4 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="AceTimer-3.0.lua"/>
</Ui>
</Ui>
@@ -62,7 +62,7 @@
-- Returns an array with the set of unit ids for the current group.
--]]
local MAJOR, MINOR = "LibGroupInSpecT-1.1", tonumber (("$Revision: 89 $"):match ("(%d+)") or 0)
local MAJOR, MINOR = "LibGroupInSpecT-1.1", 90
if not LibStub then error(MAJOR.." requires LibStub") end
local lib = LibStub:NewLibrary (MAJOR, MINOR)
@@ -86,14 +86,14 @@ local INSPECT_TIMEOUT = 10 -- If we get no notification within 10s, give up on u
local MAX_ATTEMPTS = 2
--@debug@
--[===[@debug@
lib.debug = false
local function debug (...)
if lib.debug then -- allow programmatic override of debug output by client addons
print (...)
end
end
--@end-debug@
--@end-debug@]===]
function lib.events:OnUsed(target, eventname)
if eventname == INSPECT_READY_EVENT then
@@ -172,6 +172,7 @@ local UnitIsConnected = _G.UnitIsConnected
local UnitIsPlayer = _G.UnitIsPlayer
local UnitIsUnit = _G.UnitIsUnit
local UnitName = _G.UnitName
local SendAddonMessage = C_ChatInfo and C_ChatInfo.SendAddonMessage or SendAddonMessage -- XXX 8.0 compat
local global_spec_id_roles_detailed = {
@@ -254,7 +255,11 @@ function lib:PLAYER_LOGIN ()
frame:RegisterEvent ("UNIT_NAME_UPDATE")
frame:RegisterEvent ("UNIT_AURA")
frame:RegisterEvent ("CHAT_MSG_ADDON")
RegisterAddonMessagePrefix (COMMS_PREFIX)
if C_ChatInfo then -- XXX 8.0 compat
C_ChatInfo.RegisterAddonMessagePrefix (COMMS_PREFIX)
else
RegisterAddonMessagePrefix (COMMS_PREFIX)
end
local guid = UnitGUID ("player")
local info = self:BuildInfo ("player")
@@ -312,8 +317,8 @@ function lib:GetCachedTalentInfo (class_id, tier, col, group, is_inspect, unit)
local talents = self.static_cache.talents
local talent_id, name, icon, sel, avail = GetTalentInfo (tier, col, group, is_inspect, unit)
if not talent_id or not class_id then
--@debug@
debug ("GetCachedTalentInfo("..tostring(class_id)..","..tier..","..col..","..group..","..tostring(is_inspect)..","..tostring(unit)..") returned nil") --@end-debug@
--[===[@debug@
debug ("GetCachedTalentInfo("..tostring(class_id)..","..tier..","..col..","..group..","..tostring(is_inspect)..","..tostring(unit)..") returned nil") --@end-debug@]===]
return {}
end
talents[class_id] = talents[class_id] or {}
@@ -393,8 +398,8 @@ end
function lib:Refresh (unit)
local guid = UnitGUID (unit)
if not guid then return end
--@debug@
debug ("Refreshing "..unit) --@end-debug@
--[===[@debug@
debug ("Refreshing "..unit) --@end-debug@]===]
if not self.state.mainq[guid] then
self.state.staleq[guid] = 1
self.frame:Show ()
@@ -413,8 +418,8 @@ function lib:ProcessQueues ()
local staleq = self.state.staleq
if not next (mainq) and next(staleq) then
--@debug@
debug ("Main queue empty, swapping main and stale queues") --@end-debug@
--[===[@debug@
debug ("Main queue empty, swapping main and stale queues") --@end-debug@]===]
self.state.mainq, self.state.staleq = self.state.staleq, self.state.mainq
mainq, staleq = staleq, mainq
end
@@ -423,17 +428,17 @@ function lib:ProcessQueues ()
-- If there was an inspect going, it's timed out, so either retry or move it to stale queue
local guid = self.state.current_guid
if guid then
--@debug@
debug ("Inspect timed out for "..guid) --@end-debug@
--[===[@debug@
debug ("Inspect timed out for "..guid) --@end-debug@]===]
local count = mainq and mainq[guid] or (MAX_ATTEMPTS + 1)
if not self:GuidToUnit (guid) then
--@debug@
debug ("No longer applicable, removing from queues") --@end-debug@
--[===[@debug@
debug ("No longer applicable, removing from queues") --@end-debug@]===]
mainq[guid], staleq[guid] = nil, nil
elseif count > MAX_ATTEMPTS then
--@debug@
debug ("Excessive retries, moving to stale queue") --@end-debug@
--[===[@debug@
debug ("Excessive retries, moving to stale queue") --@end-debug@]===]
mainq[guid], staleq[guid] = nil, 1
else
mainq[guid] = count + 1
@@ -447,16 +452,16 @@ function lib:ProcessQueues ()
for guid,count in pairs (mainq) do
local unit = self:GuidToUnit (guid)
if not unit then
--@debug@
debug ("No longer applicable, removing from queues") --@end-debug@
--[===[@debug@
debug ("No longer applicable, removing from queues") --@end-debug@]===]
mainq[guid], staleq[guid] = nil, nil
elseif not CanInspect (unit) or not UnitIsConnected (unit) then
--@debug@
debug ("Cannot inspect "..unit..", aka "..(UnitName(unit) or "nil")..", moving to stale queue") --@end-debug@
--[===[@debug@
debug ("Cannot inspect "..unit..", aka "..(UnitName(unit) or "nil")..", moving to stale queue") --@end-debug@]===]
mainq[guid], staleq[guid] = nil, 1
else
--@debug@
debug ("Inspecting "..unit..", aka "..(UnitName(unit) or "nil")) --@end-debug@
--[===[@debug@
debug ("Inspecting "..unit..", aka "..(UnitName(unit) or "nil")) --@end-debug@]===]
mainq[guid] = count + 1
self.state.current_guid = guid
NotifyInspect (unit)
@@ -553,8 +558,8 @@ function lib:INSPECT_READY (guid)
if guid == self.state.current_guid then
self.state.current_guid = nil -- Got what we asked for
finalize = true
--@debug@
debug ("Got inspection data for requested guid "..guid) --@end-debug@
--[===[@debug@
debug ("Got inspection data for requested guid "..guid) --@end-debug@]===]
end
local mainq, staleq = self.state.mainq, self.state.staleq
@@ -642,8 +647,8 @@ function lib:SendLatestSpecData ()
datastr = datastr..COMMS_DELIM..0
end
--@debug@
debug ("Sending LGIST update to "..scope) --@end-debug@
--[===[@debug@
debug ("Sending LGIST update to "..scope) --@end-debug@]===]
SendAddonMessage(COMMS_PREFIX, datastr, scope)
end
@@ -667,8 +672,8 @@ msg_idx.end_talents = msg_idx.talents + MAX_TALENT_TIERS - 1
function lib:CHAT_MSG_ADDON (prefix, datastr, scope, sender)
if prefix ~= COMMS_PREFIX or scope ~= self.commScope then return end
--@debug@
debug ("Incoming LGIST update from "..(scope or "nil").."/"..(sender or "nil")..": "..(datastr:gsub(COMMS_DELIM,";") or "nil")) --@end-debug@
--[===[@debug@
debug ("Incoming LGIST update from "..(scope or "nil").."/"..(sender or "nil")..": "..(datastr:gsub(COMMS_DELIM,";") or "nil")) --@end-debug@]===]
local data = { strsplit (COMMS_DELIM,datastr) }
local fmt = data[msg_idx.fmt]
@@ -735,8 +740,8 @@ function lib:CHAT_MSG_ADDON (prefix, datastr, scope, sender)
mainq[guid], staleq[guid] = need_inspect, want_inspect
if need_inspect or want_inspect then self.frame:Show () end
--@debug@
debug ("Firing LGIST update event for unit "..unit..", GUID "..guid) --@end-debug@
--[===[@debug@
debug ("Firing LGIST update event for unit "..unit..", GUID "..guid) --@end-debug@]===]
self.events:Fire (UPDATE_EVENT, guid, unit, info)
self.events:Fire (QUEUE_EVENT)
end
@@ -791,8 +796,8 @@ function lib:UNIT_AURA (unit)
if UnitIsVisible (unit) then
if info.not_visible then
info.not_visible = nil
--@debug@
debug (unit..", aka "..(UnitName(unit) or "nil")..", is now visible") --@end-debug@
--[===[@debug@
debug (unit..", aka "..(UnitName(unit) or "nil")..", is now visible") --@end-debug@]===]
if not self.state.mainq[guid] then
self.state.staleq[guid] = 1
self.frame:Show ()
@@ -800,11 +805,11 @@ function lib:UNIT_AURA (unit)
end
end
elseif UnitIsConnected (unit) then
--@debug@
--[===[@debug@
if not info.not_visible then
debug (unit..", aka "..(UnitName(unit) or "nil")..", is no longer visible")
end
--@end-debug@
--@end-debug@]===]
info.not_visible = true
end
end