/trunk
## Interface: 30300 |
## X-Compatible-With: 40000 |
## Title: NeedToKnow |
## Author: Kitjan, lieandswell |
## Version: 3.1.6 |
## Version: 3.1.7 |
## Notes: Timer bars for buffs, debuffs, cooldowns, etc. |
## X-Credits: Bilt, Fxfighter EU-Echsenkessel, metalchoir, sp00n, Vlakarados, wowui.cn |
## X-Category: Buffs, Combat |
end |
self:GetParent():Hide(); |
end, |
EditBoxOnEscapePressed = function() |
EditBoxOnEscapePressed = function(self) |
self:GetParent():Hide(); |
end, |
OnHide = function(self) |
-- NEEDTOKNOW = {} is defined in the localization file, which must be loaded before this file |
NEEDTOKNOW.VERSION = "3.1.6" |
NEEDTOKNOW.VERSION = "3.1.7" |
NEEDTOKNOW.MAXGROUPS = 4 |
NEEDTOKNOW.MAXBARS = 6 |
NEEDTOKNOW.UPDATE_INTERVAL = 0.05 |
then |
barSettings.Unit = "player" |
end |
-- Look for certain magic "spell" names |
-- Split the spell names |
bar.spells = {} |
for barSpell in bar.auraName:gmatch("([^,]+),*") do |
barSpell = strtrim(barSpell) |
table.insert(bar.spells, barSpell) |
end |
-- split the user name overrides |
bar.spell_names = {} |
for un in barSettings.show_text_user:gmatch("([^,]+),*") do |
un = strtrim(un) |
table.insert(bar.spell_names, un) |
end |
-- Look for certain special "spell" names |
barSettings.bAutoShot = nil |
if ( barSettings.BuffOrDebuff == "CASTCD" ) then |
local startIndex=1 |
local lastBuff = -1 |
if bar.auraName:len() > 0 then |
_ , lastBuff = string.gsub(bar.auraName, "," , ",") |
end |
for idxBuff=0, lastBuff do |
local endIndex = bar.auraName:find(",",startIndex,true) or (string.len(bar.auraName)+1) |
local barSpell = strtrim(string.sub(bar.auraName, startIndex, endIndex-1)) |
startIndex = endIndex+1 |
for idx, barSpell in ipairs(bar.spells) do |
if ( barSpell == "Auto Shot" or |
barSpell == NEEDTOKNOW.AUTO_SHOT or |
barSpell == "75" ) |
if ( bar.settings.show_text ) then |
local n = bar.buffName |
if "" ~= bar.settings.show_text_user then |
n = bar.settings.show_text_user |
local idx=bar.idxName |
if idx > #bar.spell_names then idx = #bar.spell_names end |
n = bar.spell_names[idx] |
end |
local c = count |
if not bar.settings.show_count then |
-- Called whenever the state of auras on the bar's unit may have changed |
function NeedToKnow.Bar_AuraCheck(bar) |
local buffName, count, duration, expirationTime, caster, iconPath |
local idxName = 0 |
local all_stacks |
local settings = bar.settings |
local bUnitExists, isWeapon |
end |
end |
local startIndex=1 |
local lastBuff = -1 |
if bar.auraName:len() > 0 then |
_ , lastBuff = string.gsub(bar.auraName, "," , ",") |
end |
for idxBuff=0, lastBuff do |
local endIndex = bar.auraName:find(",",startIndex,true) or (string.len(bar.auraName)+1) |
local barSpell = strtrim(string.sub(bar.auraName, startIndex, endIndex-1)) |
for idx, barSpell in ipairs(bar.spells) do |
idxName = idx |
local filter = settings.BuffOrDebuff |
local _, nDigits = barSpell:find("^%d+") |
local isSpellID = ( nDigits == barSpell:len() ) |
all_stacks.total = all_stacks.total + count |
if ( 0 == all_stacks.min.expirationTime or all_stacks.min.expirationTime > expirationTime ) then |
all_stacks.min.idxName = idxName |
all_stacks.min.buffName = buffName |
all_stacks.min.caster = caster |
all_stacks.min.duration = duration |
break |
end |
end |
startIndex = endIndex+1 |
end |
end |
if ( all_stacks ) then |
idxName = all_stacks.min.idxName |
buffName = all_stacks.min.buffName |
caster = all_stacks.min.caster |
duration = all_stacks.max.duration |
bar.duration = duration |
bar.expirationTime = expirationTime |
bar.idxName = idxName |
bar.buffName = buffName |
bar.iconPath = iconPath |
if ( all_stacks and all_stacks.max.expirationTime ~= expirationTime ) then |