WoWInterface SVN NeedToKnow-Updated

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 126 to Rev 127
    Reverse comparison

Rev 126 → Rev 127

trunk/NeedToKnow/NeedToKnow.toc
1,7 → 1,7
## Interface: 050100
## Interface: 050300
## Title: NeedToKnow
## Author: Kitjan, lieandswell
## Version: 4.0.12
## Version: 4.0.14
## Notes: Timer bars for buffs, debuffs, cooldowns, etc.
## X-Credits: Bilt, Fxfighter EU-Echsenkessel, metalchoir, sp00n, Vlakarados, wowui.cn
## X-Category: Buffs, Combat
trunk/NeedToKnow/NeedToKnow_Options.lua
684,7 → 684,7
button2 = CANCEL,
hasEditBox = 1,
editBoxWidth = 300,
--maxLetters = 255,
maxLetters = 0,
OnAccept = function(self)
local text = self.editBox:GetText();
local variable = self.variable;
782,6 → 782,7
Opt_CASTCD =
{
{ VariableName = "append_cd", MenuText = "Append \"CD\"" }, -- LOCME
{ VariableName = "show_charges", MenuText = "Show first and last charge CD" }, -- LOCME
},
Opt_EQUIPSLOT =
{
trunk/NeedToKnow/NeedToKnow.lua
59,6 → 59,7
local mfn_AuraCheck_AllStacks
local mfn_GetUnresolvedCooldown
local mfn_GetAutoShotCooldown
local mfn_GetSpellChargesCooldown
local mfn_GetSpellCooldown
local mfn_AddInstanceToStacks
local mfn_SetStatusBarValue
110,7 → 111,7
}
-- NEEDTOKNOW = {} is defined in the localization file, which must be loaded before this file
 
NEEDTOKNOW.VERSION = "4.0.12"
NEEDTOKNOW.VERSION = "4.0.14"
local c_UPDATE_INTERVAL = 0.05
local c_MAXBARS = 20
 
152,6 → 153,7
show_icon = false,
show_mypip = false,
show_all_stacks = false,
show_charges = true,
show_ttn1 = false,
show_ttn2 = false,
show_ttn3 = false,
220,6 → 222,7
show_icon = "sIc",
show_mypip = "sPp",
show_all_stacks = "All",
show_charges = "Chg",
show_text_user = "sUr",
show_ttn1 = "sN1",
show_ttn2 = "sN2",
281,6 → 284,7
sIc = "show_icon",
sPp = "show_mypip",
All = "show_all_stacks",
Chg = "show_charges",
sUr = "show_text_user",
BOn = "blink_enabled",
BOC = "blink_ooc",
1388,6 → 1392,13
else
bar.cd_functions[idx] = mfn_GetSpellCooldown
end
 
if ( bar.cd_functions[idx] == mfn_GetSpellCooldown ) then
local key = entry.id or entry.name
if ( bar.settings.show_charges and GetSpellCharges(key) ) then
bar.cd_functions[idx] = mfn_GetSpellChargesCooldown
end
end
end
end
end
1554,8 → 1565,8
end
 
barSettings.bAutoShot = nil
bar.is_counter = nil
bar.ticker = NeedToKnow.Bar_OnUpdate
bar.is_counter = nil
bar.ticker = NeedToKnow.Bar_OnUpdate
 
-- Determine which helper functions to use
if "BUFFCD" == barSettings.BuffOrDebuff then
1569,8 → 1580,8
elseif "POWER" == barSettings.BuffOrDebuff then
bar.fnCheck = mfn_AuraCheck_POWER
bar.is_counter = true
bar.ticker = nil
bar.ticking = false
bar.ticker = nil
bar.ticking = false
elseif "CASTCD" == barSettings.BuffOrDebuff then
bar.fnCheck = mfn_AuraCheck_CASTCD
for idx, entry in ipairs(bar.spells) do
1986,7 → 1997,7
bar.time:Show()
elseif bar.is_counter then
bar.max_value = 1
local pct = buff_stacks.total_ttn[1] / buff_stacks.total_ttn[2]
local pct = buff_stacks.total_ttn[1] / buff_stacks.total_ttn[2]
mfn_SetStatusBarValue(bar,bar.bar1,pct)
if bar.bar2 then mfn_SetStatusBarValue(bar,bar.bar2,pct) end
 
1996,7 → 2007,7
if ( bar.vct ) then
bar.vct:Hide()
end
else
else
-- Hide the time text and spark for auras with "infinite" duration
bar.max_value = 1
 
2260,6 → 2271,25
 
 
 
mfn_GetSpellChargesCooldown = function(bar, entry)
local barSpell = entry.id or entry.name
local cur, max, charge_start, recharge = GetSpellCharges(barSpell)
if ( cur ~= max ) then
trace(barSpell, cur, max, charge_start, recharge, g_GetTime()-charge_start)
local start, cd_len, enable, spellName, spellIconPath
if ( cur == 0 ) then
start, cd_len, enable, spellName, spellIconPath = mfn_GetSpellCooldown(bar, entry)
return start, cd_len, enable, spellName, spellIconPath, max, charge_start
else
local spellName, _, spellIconPath = GetSpellInfo(barSpell)
if not spellName then spellName = barSpell end
return charge_start, recharge, 1, spellName, spellIconPath, max-cur
end
end
end
 
 
 
-- Wrapper around GetItemCooldown
-- Expected to return start, cd_len, enable, buffName, iconpath
function NeedToKnow.GetItemCooldown(bar, entry)
2436,7 → 2466,7
(not bar.settings.power_sole or pt == cpt) )
then
local bTick = false
if pt == 3 then
if pt == 3 then -- SPELL_POWER_ENERGY
if (pt == cpt) then
bar.power_regen = GetPowerRegen()
end
2461,6 → 2491,7
bar.tPower = now
bar.last_power = curPower
bar.last_power_max = maxPower
 
end
end
 
2508,7 → 2539,7
print("NTK ERROR setting up index",idxName,"on bar",bar:GetName(),bar.settings.AuraName);
return;
end
local start, cd_len, should_cooldown, buffName, iconPath = func(bar, bar_entry)
local start, cd_len, should_cooldown, buffName, iconPath, stacks, start_2 = func(bar, bar_entry)
 
-- filter out the GCD, we only care about actual spell CDs
if start and cd_len <= 1.5 and func ~= mfn_GetAutoShotCooldown then
2524,13 → 2555,25
local tNow = g_GetTime()
local tEnd = start + cd_len
if ( tEnd > tNow + 0.1 ) then
if start_2 then
mfn_AddInstanceToStacks( all_stacks, bar_entry,
cd_len, -- duration
buffName, -- name
1, -- count
start_2+cd_len, -- expiration time
iconPath, -- icon path
"player" ) -- caster
stacks = stacks - 1
else
if not stacks then stacks = 1 end
end
mfn_AddInstanceToStacks( all_stacks, bar_entry,
cd_len, -- duration
buffName, -- name
1, -- count
tEnd, -- expiration time
iconPath, -- icon path
"player" ) -- caster
cd_len, -- duration
buffName, -- name
stacks, -- count
tEnd, -- expiration time
iconPath, -- icon path
"player" ) -- caster
end
end
end
3108,7 → 3151,12
EDT["UNIT_POWER"] = fnAuraCheckIfUnitMatches
EDT["UNIT_DISPLAYPOWER"] = fnAuraCheckIfUnitMatches
EDT["UNIT_COMBO_POINTS"] = mfn_Bar_AuraCheck
EDT["UNIT_INVENTORY_CHANGED"] = fnAuraCheckIfUnitPlayer
EDT["UNIT_INVENTORY_CHANGED"] = function(self, unit)
if unit == "player" then
NeedToKnow.UpdateWeaponEnchants()
mfn_Bar_AuraCheck(self)
end
end
EDT["PLAYER_TARGET_CHANGED"] = function(self, unit)
if self.unit == "targettarget" then
NeedToKnow.CheckCombatLogRegistration(self)
3156,4 → 3204,4
if fn then
fn(self, unit, ...)
end
end
\ No newline at end of file +end