unavailable buffs

more comments for the last (and first!) Pull Request
This commit is contained in:
Sergio Álvarez 2014-12-29 16:42:26 +01:00
parent 1f15c320f6
commit 1811d2efd2
3 changed files with 45 additions and 23 deletions

View File

@ -128,19 +128,21 @@ local BrokerConsolidatedBuffs = LDB:NewDataObject("Broker_ConsolidatedBuffs", {
tooltip:AddSeparator() tooltip:AddSeparator()
--tooltip:AddLine(" ") --tooltip:AddLine(" ")
-- http://wowprogramming.com/utils/xmlbrowser/live/FrameXML/BuffFrame.lua
local buffmask = _G.GetRaidBuffInfo() or 0 local buffmask = _G.GetRaidBuffInfo() or 0
local mask = 1 local mask = 1
for i = 1, _G.NUM_LE_RAID_BUFF_TYPES do for i = 1, _G.NUM_LE_RAID_BUFF_TYPES do
local name, rank, texture, duration, expiration, spellId, slot = _G.GetRaidBuffTrayAuraInfo(i) local name, rank, texture, duration, expiration, spellId, slot = _G.GetRaidBuffTrayAuraInfo(i)
local c local c
if name then if name then
c = "FF00FF00" c = "00FF00"
else else
if bit.band(buffmask, mask) > 0 then if bit.band(buffmask, mask) > 0 then
c = "FFFF0000" c = "FF0000"
else else
c = "FF888888" c = "888888"
end end
end end
@ -153,14 +155,10 @@ local BrokerConsolidatedBuffs = LDB:NewDataObject("Broker_ConsolidatedBuffs", {
pets = pets ..", ".. defaults[i][3][ii] pets = pets ..", ".. defaults[i][3][ii]
end end
tooltip:AddLine( tooltip:AddLine(
"\124T"..defaults[i][1]..":0\124t \124c"..c.._G["RAID_BUFF_"..i]:gsub("-\n", "").."\124r", "\124T"..defaults[i][1]..":0\124t \124cFF"..c.._G["RAID_BUFF_"..i]:gsub("-\n", "").."\124r",
strsub(classes, 2), strsub(classes, 2),
strsub(pets, 2) strsub(pets, 2)
) )
--tooltip:AddLine(" ")
--tooltip:AddLine("\124T"..defaults[i][1]..":0\124t \124c"..c.._G["RAID_BUFF_"..i]:gsub("-\n", "").."\124r "..list)
--tooltip:AddLine(" "..list)
mask = bit.lshift(mask, 1) mask = bit.lshift(mask, 1)
end end
@ -176,27 +174,37 @@ local BrokerConsolidatedBuffs = LDB:NewDataObject("Broker_ConsolidatedBuffs", {
OnClick = function(button) OnClick = function(button)
local missing = "" local missing = ""
local unavailable = ""
local buffmask = _G.GetRaidBuffInfo() or 0 local buffmask = _G.GetRaidBuffInfo() or 0
local mask = 1 local mask = 1
for i = 1, _G.NUM_LE_RAID_BUFF_TYPES do for i = 1, _G.NUM_LE_RAID_BUFF_TYPES do
if not _G.GetRaidBuffTrayAuraInfo(i) and bit.band(buffmask, mask) > 0 then if not _G.GetRaidBuffTrayAuraInfo(i) then
missing = missing .. _G["RAID_BUFF_"..i]:gsub("-\n", "") ..", " if bit.band(buffmask, mask) > 0 then
missing = missing .. _G["RAID_BUFF_"..i]:gsub("-\n", "") ..", "
else
unavailable = unavailable .. _G["RAID_BUFF_"..i]:gsub("-\n", "") ..", "
end
end end
mask = bit.lshift(mask, 1) mask = bit.lshift(mask, 1)
end end
local channel = "SAY"
if _G.IsInGroup(_G.LE_PARTY_CATEGORY_INSTANCE) then
channel = "INSTANCE_CHAT"
elseif _G.IsInRaid() then
channel = "RAID"
elseif _G.IsInGroup() then
channel = "PARTY"
end
if missing ~= "" then if missing ~= "" then
local channel = "SAY"
if _G.IsInGroup(_G.LE_PARTY_CATEGORY_INSTANCE) then
channel = "INSTANCE_CHAT"
elseif _G.IsInRaid() then
channel = "RAID"
elseif _G.IsInGroup() then
channel = "PARTY"
end
_G.SendChatMessage(_G.ADDON_MISSING..": "..strsub(missing, 0, strlen(missing)-2), channel) _G.SendChatMessage(_G.ADDON_MISSING..": "..strsub(missing, 0, strlen(missing)-2), channel)
end end
if unavailable ~= "" then
_G.SendChatMessage(_G.UNAVAILABLE..": "..strsub(unavailable, 0, strlen(unavailable)-2), channel)
end
end end
}) })
@ -210,10 +218,17 @@ local function updateBuffs(self, event, unitID)
end end
end end
local buffcount = select(2, _G.GetRaidBuffInfo()) -- I'm gona keep the old code here. Becouse there is an issue with GetRaidBuffInfo()+versatility
--and sometimes can appear 2/2 with 1 buff missing
-- For example a party of Hunter+Druid. Hunter > AP, Druid > Stats+Vers. GRBI() report only Stats and AP.
-- IMO is better to show 2/9 than 2/2 in this cases.
--local buffcount = select(2, _G.GetRaidBuffInfo())
--BrokerConsolidatedBuffs.text = c.."/"..max(c, buffcount)
--BrokerConsolidatedBuffs.value = c.."/"..max(c, buffcount) -- for ElvUI datatexts
BrokerConsolidatedBuffs.text = c.."/"..max(c, buffcount) -- old code, to be replaced by ^^^^^
BrokerConsolidatedBuffs.value = c.."/"..max(c, buffcount) -- for ElvUI datatexts BrokerConsolidatedBuffs.text = c.."/"..NUM_LE_RAID_BUFF_TYPES
BrokerConsolidatedBuffs.value = c.."/"..NUM_LE_RAID_BUFF_TYPES -- for ElvUI datatexts
end end
end end

View File

@ -2,7 +2,7 @@
## Title: Broker_ConsolidatedBuffs ## Title: Broker_ConsolidatedBuffs
## Notes: Track consolidated buffs ## Notes: Track consolidated buffs
## Author: Gio ## Author: Gio
## Version: 0.8 ## Version: 0.9
## SavedVariables: ## SavedVariables:
libs\LibStub\LibStub.lua libs\LibStub\LibStub.lua
@ -20,3 +20,6 @@ Broker_ConsolidatedBuffs.lua
# http://sethcoder.com/reference/wow/INTERFACE/BUTTONS/ # http://sethcoder.com/reference/wow/INTERFACE/BUTTONS/
# http://www.curse.com/addons/wow/libbabble-talenttree-3-0 # http://www.curse.com/addons/wow/libbabble-talenttree-3-0
# http://www.curse.com/addons/wow/libbabble-creaturetype-3-0 # http://www.curse.com/addons/wow/libbabble-creaturetype-3-0
# Thanks to:
# Dairyman (https://github.com/Dairyman)

View File

@ -4,7 +4,7 @@ Track your consolidated buffs and show it in a Broker Display like Chocolate Bar
Simple :) Simple :)
![Image](http://i.imgur.com/aeJy3zl.png) ![Image](http://i.imgur.com/dPIDsTQ.png)
## Links ## Links
- [Curse](http://www.curse.com/addons/wow/broker_consolidatedbuffs) - [Curse](http://www.curse.com/addons/wow/broker_consolidatedbuffs)
@ -12,6 +12,10 @@ Simple :)
- [WoWInterface](http://www.wowinterface.com/downloads/info23247-Broker_ConsolidatedBuffs.html) - [WoWInterface](http://www.wowinterface.com/downloads/info23247-Broker_ConsolidatedBuffs.html)
## TODO ## TODO
- Who cast each buff
- (DONE) Change tooltip lib to LibQTip. - (DONE) Change tooltip lib to LibQTip.
- (DONE) To show more info about missing buffs. - (DONE) To show more info about missing buffs.
- (DONE) Workaround for ElvUI datatexts :/ - (DONE) Workaround for ElvUI datatexts :/
## Thanks!
- [Dairyman](https://github.com/Dairyman)