WoWInterface SVN NeedToKnow-Updated

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 121 to Rev 122
    Reverse comparison

Rev 121 → Rev 122

trunk/NeedToKnow/NeedToKnow_Localization.lua
67,6 → 67,9
NEEDTOKNOW.BARMENU_SHOW_SPARK = "Spark";
NEEDTOKNOW.BARMENU_SHOW_MYPIP = "Indicator If Mine";
NEEDTOKNOW.BARMENU_SHOW_TEXT_USER = "Override Aura Name...";
NEEDTOKNOW.BARMENU_SHOW_TTN1 = "First Tooltip Number";
NEEDTOKNOW.BARMENU_SHOW_TTN2 = "Second Tooltip Number";
NEEDTOKNOW.BARMENU_SHOW_TTN3 = "Third Tooltip Number";
 
 
NEEDTOKNOW.UIPANEL_SUBTEXT1 = "These options allow you to customize NeedToKnow's timer bar groups.";
trunk/NeedToKnow/NeedToKnow_Options.lua
826,6 → 826,9
{ VariableName = "show_time", MenuText = NEEDTOKNOW.BARMENU_SHOW_TIME },
{ VariableName = "show_spark", MenuText = NEEDTOKNOW.BARMENU_SHOW_SPARK },
{ VariableName = "show_mypip", MenuText = NEEDTOKNOW.BARMENU_SHOW_MYPIP },
{ VariableName = "show_ttn1", MenuText = NEEDTOKNOW.BARMENU_SHOW_TTN1 },
{ VariableName = "show_ttn2", MenuText = NEEDTOKNOW.BARMENU_SHOW_TTN2 },
{ VariableName = "show_ttn3", MenuText = NEEDTOKNOW.BARMENU_SHOW_TTN3 },
{ VariableName = "show_text_user", MenuText = NEEDTOKNOW.BARMENU_SHOW_TEXT_USER, Type = "Dialog", DialogText = "CHOOSE_OVERRIDE_TEXT", Checked = function(settings) return "" ~= settings.show_text_user end },
},
BlinkSettings = {
trunk/NeedToKnow/NeedToKnow.lua
51,7 → 51,8
duration = 0,
expirationTime = 0,
},
total = 0
total = 0,
total_ttn = { 0, 0, 0 }
}
NeedToKnow.scratch.buff_stacks =
{
68,7 → 69,8
duration = 0,
expirationTime = 0,
},
total = 0
total = 0,
total_ttn = { 0, 0, 0 }
}
NeedToKnow.scratch.bar_entry =
{
120,6 → 122,9
show_icon = false,
show_mypip = false,
show_all_stacks = false,
show_ttn1 = false,
show_ttn2 = false,
show_ttn3 = false,
show_text_user = "",
blink_enabled = false,
blink_ooc = true,
185,6 → 190,9
show_mypip = "sPp",
show_all_stacks = "All",
show_text_user = "sUr",
show_ttn1 = "sN1",
show_ttn2 = "sN2",
show_ttn3 = "sN3",
blink_enabled = "BOn",
blink_ooc = "BOC",
blink_boss = "BBs",
233,6 → 241,9
Ext = "bDetectExtends",
sTx = "show_text",
sCt = "show_count",
sN1 = "show_ttn1",
sN2 = "show_ttn2",
sN3 = "show_ttn3",
sTm = "show_time",
sSp = "show_spark",
sIc = "show_icon",
538,7 → 549,6
end
end
 
 
function NeedToKnow.GetNameAndServer(unit)
local name, server = UnitName(unit)
if name and server then
547,7 → 557,6
return name
end
 
 
function NeedToKnow.RefreshRaidMemberNames()
NeedToKnow.raid_members = {}
 
1650,13 → 1659,23
 
-- AuraCheck calls on this to compute the "text" of the bar
-- It is separated out like this in part to be hooked by other addons
function NeedToKnow.ComputeBarText(buffName, count, extended)
function NeedToKnow.ComputeBarText(buffName, count, extended, buff_stacks, bar)
local text
if ( count > 1 ) then
text = buffName.." ["..count.."]"
else
text = buffName
end
 
if ( bar.settings.show_ttn1 and buff_stacks.total_ttn[1] > 0 ) then
text = text .. " ("..buff_stacks.total_ttn[1]..")"
end
if ( bar.settings.show_ttn2 and buff_stacks.total_ttn[2] > 0 ) then
text = text .. " ("..buff_stacks.total_ttn[2]..")"
end
if ( bar.settings.show_ttn3 and buff_stacks.total_ttn[3] > 0 ) then
text = text .. " ("..buff_stacks.total_ttn[3]..")"
end
if ( extended and extended > 1 ) then
text = text .. string.format(" + %.0fs", extended)
end
1745,7 → 1764,7
end
end
 
function NeedToKnow.ConfigureVisibleBar(bar, count, extended)
function NeedToKnow.ConfigureVisibleBar(bar, count, extended, buff_stacks)
local text = ""
if ( bar.settings.show_icon and bar.iconPath and bar.icon ) then
bar.icon:SetTexture(bar.iconPath)
1773,19 → 1792,25
txt = txt .. "* "
end
 
local n = ""
if ( bar.settings.show_text ) then
local n = bar.buffName
n = bar.buffName
if "" ~= bar.settings.show_text_user then
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
c = 1
end
txt = txt .. NeedToKnow.ComputeBarText(n, c, extended)
end
 
local c = count
if not bar.settings.show_count then
c = 1
end
local to_append = NeedToKnow.ComputeBarText(n, c, extended, buff_stacks, bar)
if to_append and to_append ~= "" then
txt = txt .. to_append
end
 
if ( bar.settings.append_cd
and (bar.settings.BuffOrDebuff == "CASTCD"
or bar.settings.BuffOrDebuff == "BUFFCD"
2101,6 → 2126,7
end
data.expiration = GetTime() + data.expiration/1000
if oldname ~= data.name then
local _
_,_,data.icon = GetSpellInfo(data.name)
if nil == data.icon then
_,_,data.icon = GetSpellInfo(data.name .. " Weapon")
2140,7 → 2166,7
end
 
 
local function AddInstanceToStacks(all_stacks, bar_entry, duration, name, count, expirationTime, iconPath, caster)
local function AddInstanceToStacks(all_stacks, bar_entry, duration, name, count, expirationTime, iconPath, caster, tt1, tt2, tt3)
if duration then
if (not count or count < 1) then count = 1 end
if ( 0 == all_stacks.total or all_stacks.min.expirationTime > expirationTime ) then
2156,6 → 2182,15
all_stacks.max.expirationTime = expirationTime
end
all_stacks.total = all_stacks.total + count
if ( tt1 ) then
all_stacks.total_ttn[1] = all_stacks.total_ttn[1] + tt1
if ( tt2 ) then
all_stacks.total_ttn[2] = all_stacks.total_ttn[2] + tt2
end
if ( tt3 ) then
all_stacks.total_ttn[3] = all_stacks.total_ttn[3] + tt3
end
end
end
end
 
2313,12 → 2348,19
end
 
 
function NeedToKnow.ResetScratchStacks(buff_stacks)
buff_stacks.total = 0;
buff_stacks.total_ttn[1] = 0;
buff_stacks.total_ttn[2] = 0;
buff_stacks.total_ttn[3] = 0;
end
 
-- Bar_AuraCheck helper for watching "internal cooldowns", which is like a spell
-- cooldown for spells cast automatically (procs). The "reset on buff" logic
-- is still handled by
function NeedToKnow.AuraCheck_BUFFCD(bar, bar_entry, all_stacks)
local buff_stacks = NeedToKnow.scratch.buff_stacks
buff_stacks.total = 0
NeedToKnow.ResetScratchStacks(buff_stacks);
NeedToKnow.AuraCheck_Single(bar, bar_entry, buff_stacks)
local tNow = GetTime()
if ( buff_stacks.total > 0 ) then
2363,6 → 2405,43
end
end
 
local function UnitAuraWrapper(a,b,c,d)
local
name,
_, -- rank,
icon,
count,
_, -- type,
dur,
expiry,
caster,
_, -- uao.steal,
_, -- uao.cons -- Should consolidate
id,
_, -- uao.canCast -- The player's class/spec can cast this spell
_, -- A boss applied this
v1,
v2,
v3,
bEnd -- Just indicates the end of the variable number of return results
= UnitAura(a,b,c,d)
if name then
-- There is a boolean at the end of the list whos purpose is unknown
-- It can be either true or false, so we must test against nil explicitly
-- Between the boss boolean and this end boolean will be 0-3 integers
if nil == bEnd then
-- some or all tooltip values are missing
if nil == v3 then
if nil == v2 then
v1 = nil
end
v2 = nil
end
v3 = nil
end
return name, icon, count, dur, expiry, caster, id, v1, v2, v3, bEnd
end
end
 
-- Bar_AuraCheck helper that looks for the first instance of a buff
-- Uses the UnitAura filters exclusively if it can
2379,8 → 2458,8
local barID = bar_entry.id
local j = 1
while true do
local buffName, _, iconPath, count, _, duration, expirationTime, caster, _, _, spellID
= UnitAura(bar.unit, j, filter)
local buffName, iconPath, count, duration, expirationTime, caster, spellID, tt1, tt2, tt3
= UnitAuraWrapper(bar.unit, j, filter)
if (not buffName) then
break
end
2392,21 → 2471,23
count, -- count
expirationTime, -- expiration time
iconPath, -- icon path
caster ) -- caster
caster, -- caster
tt1, tt2, tt3 ) -- extra status values, like vengeance armor or healing bo
return;
end
j=j+1
end
else
local buffName, _ , iconPath, count, _, duration, expirationTime, caster
= UnitAura(bar.unit, bar_entry.name, nil, filter)
local buffName, iconPath, count, duration, expirationTime, caster, _, tt1, tt2, tt3
= UnitAuraWrapper(bar.unit, bar_entry.name, nil, filter)
AddInstanceToStacks( all_stacks, bar_entry,
duration, -- duration
buffName, -- name
count, -- count
expirationTime, -- expiration time
iconPath, -- icon path
caster ) -- caster
caster, -- caster
tt1, tt2, tt3 ) -- extra status values, like vengeance armor or healing bo
end
end
 
2419,8 → 2500,8
local filter = settings.BuffOrDebuff
 
while true do
local buffName, _, iconPath, count, _, duration, expirationTime, caster, _, _, spellID
= UnitAura(bar.unit, j, filter)
local buffName, iconPath, count, duration, expirationTime, caster, spellID, tt1, tt2, tt3
= UnitAuraWrapper(bar.unit, j, filter)
if (not buffName) then
break
end
2433,7 → 2514,8
count,
expirationTime,
iconPath,
caster )
caster,
tt1, tt2, tt3 )
end
 
j = j+1
2460,9 → 2542,9
-- Determine if the bar should be showing anything
local all_stacks
local idxName, duration, buffName, count, expirationTime, iconPath, caster
if ( bUnitExists ) then
if ( bUnitExists ) then
all_stacks = NeedToKnow.scratch.all_stacks
all_stacks.total = 0
NeedToKnow.ResetScratchStacks(all_stacks);
 
-- Call the helper function for each of the spells in the list
for idx, entry in ipairs(bar.spells) do
2491,7 → 2573,7
local maxStart = 0
local tNow = GetTime()
local buff_stacks = NeedToKnow.scratch.buff_stacks
buff_stacks.total = 0
NeedToKnow.ResetScratchStacks(buff_stacks);
-- Keep track of when the reset auras were last applied to the player
for idx, resetSpell in ipairs(bar.reset_spells) do
-- Note this relies on BUFFCD setting the target to player, and that the onlyMine will work either way
2573,7 → 2655,7
-- Mark the bar as not blinking before calling ConfigureVisibleBar,
-- since it calls OnUpdate which checks bar.blink
bar.blink=false
NeedToKnow.ConfigureVisibleBar(bar, count, extended)
NeedToKnow.ConfigureVisibleBar(bar, count, extended, all_stacks)
bar:Show()
else
if (settings.bDetectExtends and bar.buffName) then