Commit 4b9420ec authored by Azilroka's avatar Azilroka

Merge branch 'development'

parents cf28cf39 90d5e087
......@@ -149,67 +149,33 @@ function E:GetCPUImpact()
end
local BLIZZARD_ADDONS = {
"Blizzard_AchievementUI",
"Blizzard_AdventureMap",
"Blizzard_ArchaeologyUI",
"Blizzard_ArenaUI",
"Blizzard_ArtifactUI",
"Blizzard_AuctionUI",
"Blizzard_AuthChallengeUI",
"Blizzard_BarbershopUI",
"Blizzard_BattlefieldMinimap",
"Blizzard_BindingUI",
"Blizzard_BlackMarketUI",
"Blizzard_BoostTutorial",
"Blizzard_Calendar",
"Blizzard_ChallengesUI",
"Blizzard_ClassTrial",
"Blizzard_ClientSavedVariables",
"Blizzard_Collections",
"Blizzard_CombatLog",
"Blizzard_CombatText",
"Blizzard_CompactRaidFrames",
"Blizzard_CUFProfiles",
"Blizzard_DeathRecap",
"Blizzard_DebugTools",
"Blizzard_EncounterJournal",
"Blizzard_FlightMap",
"Blizzard_GarrisonTemplates",
"Blizzard_GarrisonUI",
"Blizzard_GlyphUI",
"Blizzard_GMChatUI",
"Blizzard_GMSurveyUI",
"Blizzard_GuildBankUI",
"Blizzard_GuildControlUI",
"Blizzard_GuildUI",
"Blizzard_InspectUI",
"Blizzard_ItemSocketingUI",
"Blizzard_ItemUpgradeUI",
"Blizzard_LookingForGuildUI",
"Blizzard_MacroUI",
"Blizzard_MapCanvas",
"Blizzard_MovePad",
"Blizzard_NamePlates",
"Blizzard_ObjectiveTracker",
"Blizzard_ObliterumUI",
"Blizzard_OrderHallUI",
"Blizzard_PetBattleUI",
"Blizzard_PVPUI",
"Blizzard_QuestChoice",
"Blizzard_RaidUI",
"Blizzard_SecureTransferUI",
"Blizzard_SharedMapDataProviders",
"Blizzard_SocialUI",
"Blizzard_StoreUI",
"Blizzard_TalentUI",
"Blizzard_TalkingHeadUI",
"Blizzard_TimeManager",
"Blizzard_TokenUI",
"Blizzard_TradeSkillUI",
"Blizzard_TrainerUI",
"Blizzard_Tutorial",
"Blizzard_TutorialTemplates",
"Blizzard_VoidStorageUI",
"Blizzard_WowTokenUI"
}
function E:EnableBlizzardAddOns()
......
......@@ -254,7 +254,6 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
E.db.bags.bagWidth = 474
E.db.bags.bankSize = 42
E.db.bags.bankWidth = 474
E.db.bags.itemLevelCustomColorEnable = true
E.db.bags.scrapIcon = true
--Chat
E.db.chat.fontSize = 10
......@@ -310,7 +309,6 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
E.db.movers.PetExperienceBarMover = "BOTTOM,ElvUIParent,BOTTOM,0,53"
E.db.movers.LevelUpBossBannerMover = "TOP,ElvUIParent,TOP,-1,-120"
E.db.movers.LootFrameMover = "TOPLEFT,ElvUIParent,TOPLEFT,418,-186"
E.db.movers.LossControlMover = "BOTTOM,ElvUIParent,BOTTOM,-1,507"
E.db.movers.MirrorTimer1Mover = "TOP,ElvUIParent,TOP,-1,-96"
E.db.movers.ObjectiveFrameMover = "TOPRIGHT,ElvUIParent,TOPRIGHT,-163,-325"
E.db.movers.ReputationBarMover = "TOPRIGHT,ElvUIParent,TOPRIGHT,-3,-246"
......@@ -407,7 +405,6 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
E.db.unitframe.units.raid.roleIcon.position = "BOTTOMRIGHT"
E.db.unitframe.units.raid.roleIcon.size = 12
E.db.unitframe.units.raid.roleIcon.xOffset = 0
E.db.unitframe.units.raid.visibility = "[@raid6,noexists] hide;show"
E.db.unitframe.units.raid.width = 92
--Raid40
E.db.unitframe.units.raid40.enable = false
......@@ -430,7 +427,6 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
E.db.movers.VOICECHAT = "TOPLEFT,ElvUIParent,TOPLEFT,250,-82"
E.db.unitframe.units.party.enable = false
E.db.unitframe.units.party.health.frequentUpdates = true
E.db.unitframe.units.raid.visibility = "[nogroup] hide;show"
E.db.unitframe.units.raid40.health.frequentUpdates = true
end
end
......
......@@ -45,7 +45,8 @@ local UnitPowerType = UnitPowerType
local UnitReaction = UnitReaction
local UnitPlayerControlled = UnitPlayerControlled
local DEFAULT_AFK_MESSAGE = DEFAULT_AFK_MESSAGE
local CHAT_FLAG_AFK = CHAT_FLAG_AFK:gsub('<(.-)>', '|r<|cffFF0000%1|r>')
local CHAT_FLAG_DND = CHAT_FLAG_DND:gsub('<(.-)>', '|r<|cffFFFF00%1|r>')
local PVP = PVP
local UNITNAME_SUMMON_TITLE17 = UNITNAME_SUMMON_TITLE17
local UNKNOWN = UNKNOWN
......@@ -110,14 +111,26 @@ local function abbrev(name)
return name
end
ElvUF.Tags.Events['afk'] = 'PLAYER_FLAGS_CHANGED'
ElvUF.Tags.Methods['afk'] = function(unit)
local isAFK = UnitIsAFK(unit)
if isAFK then
return format('|cffFFFFFF[|r|cffFF0000%s|r|cFFFFFFFF]|r', DEFAULT_AFK_MESSAGE)
else
return nil
ElvUF.Tags.Events['status:text'] = 'PLAYER_FLAGS_CHANGED'
ElvUF.Tags.Methods['status:text'] = function(unit)
if UnitIsAFK(unit) then
return CHAT_FLAG_AFK
elseif UnitIsDND(unit) then
return CHAT_FLAG_DND
end
return nil
end
ElvUF.Tags.Events['status:icon'] = 'PLAYER_FLAGS_CHANGED'
ElvUF.Tags.Methods['status:icon'] = function(unit)
if UnitIsAFK(unit) then
return CreateTextureMarkup("Interface\\FriendsFrame\\StatusIcon-Away", 16, 16, 16, 16, 0, 1, 0, 1, 0, 0)
elseif UnitIsDND(unit) then
return CreateTextureMarkup("Interface\\FriendsFrame\\StatusIcon-DnD", 16, 16, 16, 16, 0, 1, 0, 1, 0, 0)
end
return nil
end
ElvUF.Tags.Events['healthcolor'] = 'UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED'
......@@ -154,41 +167,55 @@ for textFormat in pairs(E.GetFormattedTextStyles) do
ElvUF.Tags.Events[format('power:%s', tagTextFormat)] = 'UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER'
ElvUF.Tags.Methods[format('power:%s', tagTextFormat)] = function(unit)
local pType = UnitPowerType(unit)
return E:GetFormattedText(textFormat, UnitPower(unit, pType), UnitPowerMax(unit, pType))
local min = UnitPower(unit, pType)
if min == 0 and tagTextFormat ~= 'deficit' then
return ''
else
return E:GetFormattedText(textFormat, UnitPower(unit, pType), UnitPowerMax(unit, pType))
end
end
ElvUF.Tags.Events[format('mana:%s', tagTextFormat)] = 'UNIT_POWER_FREQUENT UNIT_MAXPOWER'
ElvUF.Tags.Methods[format('mana:%s', tagTextFormat)] = function(unit)
return E:GetFormattedText(textFormat, UnitPower(unit, SPELL_POWER_MANA), UnitPowerMax(unit, SPELL_POWER_MANA))
end
local min = UnitPower(unit, SPELL_POWER_MANA)
ElvUF.Tags.Events[format('health:%s:shortvalue', tagTextFormat)] = 'UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED'
ElvUF.Tags.Methods[format('health:%s:shortvalue', tagTextFormat)] = function(unit)
local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
if (status) then
return status
if min == 0 and tagTextFormat ~= 'deficit' then
return ''
else
local min, max = E:UnitHealthValues(unit)
return E:GetFormattedText(textFormat, min, max, nil, true)
return E:GetFormattedText(textFormat, UnitPower(unit, SPELL_POWER_MANA), UnitPowerMax(unit, SPELL_POWER_MANA))
end
end
ElvUF.Tags.Events[format('health:%s-nostatus:shortvalue', tagTextFormat)] = 'UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH'
ElvUF.Tags.Methods[format('health:%s-nostatus:shortvalue', tagTextFormat)] = function(unit)
local min, max = E:UnitHealthValues(unit)
return E:GetFormattedText(textFormat, min, max, nil, true)
end
if tagTextFormat ~= 'percent' then
ElvUF.Tags.Events[format('health:%s:shortvalue', tagTextFormat)] = 'UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED'
ElvUF.Tags.Methods[format('health:%s:shortvalue', tagTextFormat)] = function(unit)
local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
if (status) then
return status
else
local min, max = E:UnitHealthValues(unit)
return E:GetFormattedText(textFormat, min, max, nil, true)
end
end
ElvUF.Tags.Events[format('health:%s-nostatus:shortvalue', tagTextFormat)] = 'UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH'
ElvUF.Tags.Methods[format('health:%s-nostatus:shortvalue', tagTextFormat)] = function(unit)
local min, max = E:UnitHealthValues(unit)
return E:GetFormattedText(textFormat, min, max, nil, true)
end
ElvUF.Tags.Events[format('power:%s:shortvalue', tagTextFormat)] = 'UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER'
ElvUF.Tags.Methods[format('power:%s:shortvalue', tagTextFormat)] = function(unit)
local pType = UnitPowerType(unit)
return E:GetFormattedText(textFormat, UnitPower(unit, pType), UnitPowerMax(unit, pType), nil, true)
end
ElvUF.Tags.Events[format('power:%s:shortvalue', tagTextFormat)] = 'UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER'
ElvUF.Tags.Methods[format('power:%s:shortvalue', tagTextFormat)] = function(unit)
local pType = UnitPowerType(unit)
return E:GetFormattedText(textFormat, UnitPower(unit, pType), UnitPowerMax(unit, pType), nil, true)
end
ElvUF.Tags.Events[format('mana:%s:shortvalue', tagTextFormat)] = 'UNIT_POWER_FREQUENT UNIT_MAXPOWER'
ElvUF.Tags.Methods[format('mana:%s:shortvalue', tagTextFormat)] = function(unit)
return E:GetFormattedText(textFormat, UnitPower(unit, SPELL_POWER_MANA), UnitPowerMax(unit, SPELL_POWER_MANA), nil, true)
ElvUF.Tags.Events[format('mana:%s:shortvalue', tagTextFormat)] = 'UNIT_POWER_FREQUENT UNIT_MAXPOWER'
ElvUF.Tags.Methods[format('mana:%s:shortvalue', tagTextFormat)] = function(unit)
return E:GetFormattedText(textFormat, UnitPower(unit, SPELL_POWER_MANA), UnitPowerMax(unit, SPELL_POWER_MANA), nil, true)
end
end
end
......
## Interface: 11302
## Author: Elv
## Version: 1.12
## Version: 1.13
## Title: |cfffe7b2cElvUI|r |cff1784d1Classic|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......
--- A bucket to catch events in. **AceBucket-3.0** provides throttling of events that fire in bursts and
-- your addon only needs to know about the full burst.
--
-- This Bucket implementation works as follows:\\
-- Initially, no schedule is running, and its waiting for the first event to happen.\\
-- The first event will start the bucket, and get the scheduler running, which will collect all
-- events in the given interval. When that interval is reached, the bucket is pushed to the
-- callback and a new schedule is started. When a bucket is empty after its interval, the scheduler is
-- stopped, and the bucket is only listening for the next event to happen, basically back in its initial state.
--
-- In addition, the buckets collect information about the "arg1" argument of the events that fire, and pass those as a
-- table to your callback. This functionality was mostly designed for the UNIT_* events.\\
-- The table will have the different values of "arg1" as keys, and the number of occurances as their value, e.g.\\
-- { ["player"] = 2, ["target"] = 1, ["party1"] = 1 }
--
-- **AceBucket-3.0** can be embeded into your addon, either explicitly by calling AceBucket:Embed(MyAddon) or by
-- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
-- and can be accessed directly, without having to explicitly call AceBucket itself.\\
-- It is recommended to embed AceBucket, otherwise you'll have to specify a custom `self` on all calls you
-- make into AceBucket.
-- @usage
-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("BucketExample", "AceBucket-3.0")
--
-- function MyAddon:OnEnable()
-- -- Register a bucket that listens to all the HP related events,
-- -- and fires once per second
-- self:RegisterBucketEvent({"UNIT_HEALTH", "UNIT_MAXHEALTH"}, 1, "UpdateHealth")
-- end
--
-- function MyAddon:UpdateHealth(units)
-- if units.player then
-- print("Your HP changed!")
-- end
-- end
-- @class file
-- @name AceBucket-3.0.lua
-- @release $Id$
local MAJOR, MINOR = "AceBucket-3.0", 4
local AceBucket, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceBucket then return end -- No Upgrade needed
AceBucket.buckets = AceBucket.buckets or {}
AceBucket.embeds = AceBucket.embeds or {}
-- the libraries will be lazyly bound later, to avoid errors due to loading order issues
local AceEvent, AceTimer
-- Lua APIs
local tconcat = table.concat
local type, next, pairs, select = type, next, pairs, select
local tonumber, tostring, rawset = tonumber, tostring, rawset
local assert, loadstring, error = assert, loadstring, error
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub, geterrorhandler
local bucketCache = setmetatable({}, {__mode='k'})
--[[
xpcall safecall implementation
]]
local xpcall = xpcall
local function errorhandler(err)
return geterrorhandler()(err)
end
local function safecall(func, ...)
if func then
return xpcall(func, errorhandler, ...)
end
end
-- FireBucket ( bucket )
--
-- send the bucket to the callback function and schedule the next FireBucket in interval seconds
local function FireBucket(bucket)
local received = bucket.received
-- we dont want to fire empty buckets
if next(received) ~= nil then
local callback = bucket.callback
if type(callback) == "string" then
safecall(bucket.object[callback], bucket.object, received)
else
safecall(callback, received)
end
for k in pairs(received) do
received[k] = nil
end
-- if the bucket was not empty, schedule another FireBucket in interval seconds
bucket.timer = AceTimer.ScheduleTimer(bucket, FireBucket, bucket.interval, bucket)
else -- if it was empty, clear the timer and wait for the next event
bucket.timer = nil
end
end
-- BucketHandler ( event, arg1 )
--
-- callback func for AceEvent
-- stores arg1 in the received table, and schedules the bucket if necessary
local function BucketHandler(self, event, arg1)
if arg1 == nil then
arg1 = "nil"
end
self.received[arg1] = (self.received[arg1] or 0) + 1
-- if we are not scheduled yet, start a timer on the interval for our bucket to be cleared
if not self.timer then
self.timer = AceTimer.ScheduleTimer(self, FireBucket, self.interval, self)
end
end
-- RegisterBucket( event, interval, callback, isMessage )
--
-- event(string or table) - the event, or a table with the events, that this bucket listens to
-- interval(int) - time between bucket fireings
-- callback(func or string) - function pointer, or method name of the object, that gets called when the bucket is cleared
-- isMessage(boolean) - register AceEvent Messages instead of game events
local function RegisterBucket(self, event, interval, callback, isMessage)
-- try to fetch the librarys
if not AceEvent or not AceTimer then
AceEvent = LibStub:GetLibrary("AceEvent-3.0", true)
AceTimer = LibStub:GetLibrary("AceTimer-3.0", true)
if not AceEvent or not AceTimer then
error(MAJOR .. " requires AceEvent-3.0 and AceTimer-3.0", 3)
end
end
if type(event) ~= "string" and type(event) ~= "table" then error("Usage: RegisterBucket(event, interval, callback): 'event' - string or table expected.", 3) end
if not callback then
if type(event) == "string" then
callback = event
else
error("Usage: RegisterBucket(event, interval, callback): cannot omit callback when event is not a string.", 3)
end
end
if not tonumber(interval) then error("Usage: RegisterBucket(event, interval, callback): 'interval' - number expected.", 3) end
if type(callback) ~= "string" and type(callback) ~= "function" then error("Usage: RegisterBucket(event, interval, callback): 'callback' - string or function or nil expected.", 3) end
if type(callback) == "string" and type(self[callback]) ~= "function" then error("Usage: RegisterBucket(event, interval, callback): 'callback' - method not found on target object.", 3) end
local bucket = next(bucketCache)
if bucket then
bucketCache[bucket] = nil
else
bucket = { handler = BucketHandler, received = {} }
end
bucket.object, bucket.callback, bucket.interval = self, callback, tonumber(interval)
local regFunc = isMessage and AceEvent.RegisterMessage or AceEvent.RegisterEvent
if type(event) == "table" then
for _,e in pairs(event) do
regFunc(bucket, e, "handler")
end
else
regFunc(bucket, event, "handler")
end
local handle = tostring(bucket)
AceBucket.buckets[handle] = bucket
return handle
end
--- Register a Bucket for an event (or a set of events)
-- @param event The event to listen for, or a table of events.
-- @param interval The Bucket interval (burst interval)
-- @param callback The callback function, either as a function reference, or a string pointing to a method of the addon object.
-- @return The handle of the bucket (for unregistering)
-- @usage
-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceBucket-3.0")
-- MyAddon:RegisterBucketEvent("BAG_UPDATE", 0.2, "UpdateBags")
--
-- function MyAddon:UpdateBags()
-- -- do stuff
-- end
function AceBucket:RegisterBucketEvent(event, interval, callback)
return RegisterBucket(self, event, interval, callback, false)
end
--- Register a Bucket for an AceEvent-3.0 addon message (or a set of messages)
-- @param message The message to listen for, or a table of messages.
-- @param interval The Bucket interval (burst interval)
-- @param callback The callback function, either as a function reference, or a string pointing to a method of the addon object.
-- @return The handle of the bucket (for unregistering)
-- @usage
-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceBucket-3.0")
-- MyAddon:RegisterBucketEvent("SomeAddon_InformationMessage", 0.2, "ProcessData")
--
-- function MyAddon:ProcessData()
-- -- do stuff
-- end
function AceBucket:RegisterBucketMessage(message, interval, callback)
return RegisterBucket(self, message, interval, callback, true)
end
--- Unregister any events and messages from the bucket and clear any remaining data.
-- @param handle The handle of the bucket as returned by RegisterBucket*
function AceBucket:UnregisterBucket(handle)
local bucket = AceBucket.buckets[handle]
if bucket then
AceEvent.UnregisterAllEvents(bucket)
AceEvent.UnregisterAllMessages(bucket)
-- clear any remaining data in the bucket
for k in pairs(bucket.received) do
bucket.received[k] = nil
end
if bucket.timer then
AceTimer.CancelTimer(bucket, bucket.timer)
bucket.timer = nil
end
AceBucket.buckets[handle] = nil
-- store our bucket in the cache
bucketCache[bucket] = true
end
end
--- Unregister all buckets of the current addon object (or custom "self").
function AceBucket:UnregisterAllBuckets()
-- hmm can we do this more efficient? (it is not done often so shouldn't matter much)
for handle, bucket in pairs(AceBucket.buckets) do
if bucket.object == self then
AceBucket.UnregisterBucket(self, handle)
end
end
end
-- embedding and embed handling
local mixins = {
"RegisterBucketEvent",
"RegisterBucketMessage",
"UnregisterBucket",
"UnregisterAllBuckets",
}
-- Embeds AceBucket into the target object making the functions from the mixins list available on target:..
-- @param target target object to embed AceBucket in
function AceBucket:Embed( target )
for _, v in pairs( mixins ) do
target[v] = self[v]
end
self.embeds[target] = true
return target
end
function AceBucket:OnEmbedDisable( target )
target:UnregisterAllBuckets()
end
for addon in pairs(AceBucket.embeds) do
AceBucket:Embed(addon)
end
<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="AceBucket-3.0.lua"/>
</Ui>
\ No newline at end of file
......@@ -4,7 +4,7 @@ Author: d87
--]================]
if WOW_PROJECT_ID ~= WOW_PROJECT_CLASSIC then return end
local MAJOR, MINOR = "LibClassicCasterino", 17
local MAJOR, MINOR = "LibClassicCasterino", 19
local lib = LibStub:NewLibrary(MAJOR, MINOR)
if not lib then return end
......@@ -25,6 +25,8 @@ local MOVECHECK_TIMEOUT = 4
local UnitGUID = UnitGUID
local bit_band = bit.band
local GetSpellInfo = GetSpellInfo
local GetTime = GetTime
local CastingInfo = CastingInfo
local ChannelInfo = ChannelInfo
......@@ -52,6 +54,10 @@ local NPCSpells
local castTimeCache = {}
local castTimeCacheStartTimes = setmetatable({}, { __mode = "v" })
local AIMED_SHOT = GetSpellInfo(19434)
local castingAimedShot = false
local playerGUID = UnitGUID("player")
--[[
function DUMPCASTS()
local castedSpells = {}
......@@ -111,6 +117,11 @@ local function CastStart(srcGUID, castType, spellName, spellID, overrideCastTime
end
if castType == "CAST" then
if srcGUID == playerGUID and spellName == AIMED_SHOT then
castingAimedShot = true
movecheckGUIDs[srcGUID] = MOVECHECK_TIMEOUT
callbacks:Fire("UNIT_SPELLCAST_START", "player")
end
FireToUnits("UNIT_SPELLCAST_START", srcGUID)
else
FireToUnits("UNIT_SPELLCAST_CHANNEL_START", srcGUID)
......@@ -127,6 +138,10 @@ local function CastStop(srcGUID, castType, suffix )
if castType == "CAST" then
local event = "UNIT_SPELLCAST_"..suffix
if srcGUID == playerGUID and castingAimedShot then
castingAimedShot = false
callbacks:Fire(event, "player")
end
FireToUnits(event, srcGUID)
else
FireToUnits("UNIT_SPELLCAST_CHANNEL_STOP", srcGUID)
......@@ -249,7 +264,11 @@ local function IsSlowedDown(unit)
end
function lib:UnitCastingInfo(unit)
if UnitIsUnit(unit,"player") then return CastingInfo() end
if UnitIsUnit(unit,"player") then
if not castingAimedShot then
return CastingInfo()
end
end
local guid = UnitGUID(unit)
local cast = casters[guid]
if cast then
......@@ -280,7 +299,7 @@ end
local Passthrough = function(self, event, unit, ...)
if unit == "player" then
if unit == "player" or UnitIsUnit(unit, "player") then
callbacks:Fire(event, unit, ...)
end
end
......
This diff is collapsed.
......@@ -7,18 +7,18 @@ Dependencies: LibStub, ChatThrottleLib
]]
local major = "LibClassicHealComm-1.0"
local minor = 19
local minor = 20
assert(LibStub, string.format("%s requires LibStub.", major))
local HealComm = LibStub:NewLibrary(major, minor)
if( not HealComm ) then return end
-- API CONSTANTS
--local ALL_DATA = 0x0f
local ALL_DATA = 0x0f
local DIRECT_HEALS = 0x01
local CHANNEL_HEALS = 0x02
local HOT_HEALS = 0x04
--local ABSORB_SHIELDS = 0x08
local ABSORB_SHIELDS = 0x08
local ALL_HEALS = bit.bor(DIRECT_HEALS, CHANNEL_HEALS, HOT_HEALS)
local CASTED_HEALS = bit.bor(DIRECT_HEALS, CHANNEL_HEALS)
local OVERTIME_HEALS = bit.bor(HOT_HEALS, CHANNEL_HEALS)
......@@ -390,10 +390,6 @@ local function filterData(spells, filterGUID, bitFlag, time, ignoreGUID)
local healAmount = 0
local currentTime = GetTime()
if not spells then
return healAmount
end
for _, pending in pairs(spells) do
if( pending.bitType and bit.band(pending.bitType, bitFlag) > 0 ) then
for i=1, #(pending), 5 do
......@@ -436,9 +432,14 @@ end
-- Gets healing amount using the passed filters
function HealComm:GetHealAmount(guid, bitFlag, time, casterGUID)
local amount = 0
if( casterGUID and pendingHeals[casterGUID] ) then
amount = filterData(pendingHeals[casterGUID], guid, bitFlag, time) + filterData(pendingHots[casterGUID], guid, bitFlag, time)
elseif( not casterGUID ) then
if casterGUID then
if pendingHeals[casterGUID] then
amount = amount + filterData(pendingHeals[casterGUID], guid, bitFlag, time)
end
if pendingHots[casterGUID] then
amount = amount + filterData(pendingHots[casterGUID], guid, bitFlag, time)
end
else
for _, spells in pairs(pendingHeals) do
amount = amount + filterData(spells, guid, bitFlag, time)
end
......@@ -1296,7 +1297,7 @@ local function parseDirectHeal(casterGUID, spellID, amount, castTime, ...)
if unit == "player" then
endTime = select(5, CastingInfo())
else
endTime = GetTime() + castTime
endTime = GetTime() + (castTime or 1.5)
end
pendingHeals[casterGUID] = pendingHeals[casterGUID] or {}
......
......@@ -140,9 +140,9 @@ HarmSpells["PALADIN"] = {
}
FriendSpells["PRIEST"] = {
527, -- ["Purify"], -- 40
17, -- ["Power Word: Shield"], -- 40
2050, -- Lesser Heal
}
HarmSpells["PRIEST"] = {
589, -- ["Shadow Word: Pain"], -- 40
5019, -- ["Shoot"], -- 30
......
local ThreatLib = LibStub and LibStub("ThreatClassic-1.0", true)
if not ThreatLib then return end
if select(2, _G.UnitClass("player")) ~= "DRUID" then return end
local _G = _G
local pairs = _G.pairs
local