WoWInterface SVN NeedToKnow-Updated

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 128 to Rev 129
    Reverse comparison

Rev 128 → Rev 129

trunk/NeedToKnow/NeedToKnow.toc
1,7 → 1,7
## Interface: 050300
## Interface: 050400
## Title: NeedToKnow
## Author: Kitjan, lieandswell
## Version: 4.0.16
## Version: 4.0.17
## 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
12,6 → 12,15
NeedToKnowOptions = {}
NeedToKnowRMB = {}
 
function NeedToKnow.FindProfileByName(profName)
local key
for k,t in pairs(NeedToKnow_Profiles) do
if t.name == profName then
return k
end
end
end
 
function NeedToKnow.SlashCommand(cmd)
local args = {}
for arg in cmd:gmatch("(%S+)") do
32,15 → 41,7
elseif ( cmd == NEEDTOKNOW.CMD_PROFILE ) then
if args[1] then
local profileName = table.concat(args, " ")
local key
for k,t in pairs(NeedToKnow_Profiles) do
if t.name == profileName then
if key then
print("Warning! Ambiguity between account-wide and per-character profile.")
end
key = k
end
end
local key = NeedToKnow.FindProfileByName( profileName )
if key then
NeedToKnow.ChangeProfile(key)
NeedToKnowOptions.UIPanel_Profile_Update()
trunk/NeedToKnow/NeedToKnow.lua
111,7 → 111,7
}
-- NEEDTOKNOW = {} is defined in the localization file, which must be loaded before this file
 
NEEDTOKNOW.VERSION = "4.0.16"
NEEDTOKNOW.VERSION = "4.0.17"
local c_UPDATE_INTERVAL = 0.05
local c_MAXBARS = 20
 
890,9 → 890,22
return "G"..n;
end
 
function NeedToKnow.FindUnusedNumericSuffix(prefix, defPrefix)
local suffix = defPrefix
if not suffix then suffix = 1 end
 
local candidate = prefix .. suffix
while ( NeedToKnow.FindProfileByName(candidate) ) do
suffix = suffix + 1
candidate = prefix .. suffix
end
return candidate;
end
 
function NeedToKnow.CreateProfile(settings, idxSpec, nameProfile)
if not nameProfile then
nameProfile = UnitName("player") .. "-"..GetRealmName() .. "." .. idxSpec
local prefix = UnitName("player") .. "-"..GetRealmName() .. "."
nameProfile = NeedToKnow.FindUnusedNumericSuffix(prefix, idxSpec)
end
settings.name = nameProfile
 
1051,6 → 1064,7
end
 
local maxKey = 0
local aByName = {}
for iS,vS in pairs(NeedToKnow_Globals.Profiles) do
if vS.bUncompressed then
NeedToKnow.CompressProfile(vS)
1060,26 → 1074,63
local cur = tonumber(iS:sub(2))
if ( cur > maxKey ) then maxKey = cur end
NeedToKnow_Profiles[iS] = vS
if aByName[ vS.name ] then
local renamed = NeedToKnow.FindUnusedNumericSuffix(vS.name, 2)
print("Error! the profile name " .. vS.name .. " has been reused! Renaming one of them to " .. renamed)
vS.name = renamed;
end
aByName[vS.name] = vS
end
 
local aFixups = {}
if NeedToKnow_CharSettings.Profiles then
for iS,vS in pairs(NeedToKnow_CharSettings.Profiles) do
-- Check for collisions by name
if aByName[ vS.name ] then
local renamed = NeedToKnow.FindUnusedNumericSuffix(vS.name, 2)
print("Error! the profile name " .. vS.name .. " has been reused! Renaming one of them to " .. renamed)
vS.name = renamed;
end
aByName[vS.name] = vS
 
-- Check for collisions by key
if ( NeedToKnow_Profiles[iS] ) then
print("NeedToKnow error encountered, both", vS.name, "and", NeedToKnow_Profiles[iS].name, "collided. Some specs may be mapped to one that should have been mapped to the other.");
print("NeedToKnow error encountered, both", vS.name, "and", NeedToKnow_Profiles[iS].name, "collided as " .. iS .. ". Some specs may be mapped to one that should have been mapped to the other.");
local oS = iS;
iS = NeedToKnow.AllocateProfileKey();
aFixups[oS] = iS
end
 
-- Although name should never be compressed, it could have been prior to 4.0.16
if not vS.name then vS.name = "Default" end
local cur = tonumber(iS:sub(2))
if ( cur > maxKey ) then maxKey = cur end
NeedToKnow_Profiles[iS] = vS
local k = NeedToKnow.FindProfileByName(vS.name);
end
end
 
-- fixup character profile collisions by key
for oS,iS in pairs(aFixups) do
NeedToKnow_CharSettings.Profiles[iS] = NeedToKnow_CharSettings.Profiles[oS];
NeedToKnow_CharSettings.Profiles[oS] = nil;
end
 
if ( not NeedToKnow_Globals.NextProfile or maxKey > NeedToKnow_Globals.NextProfile ) then
print("Warning, NeedToKnow forgot how many profiles it had allocated. New account profiles may hiccup when switching characters.")
NeedToKnow_Globals.NextProfile = maxKey + 1
end
 
local spec = g_GetActiveTalentGroup()
local curKey = NeedToKnow.CharSettings.Specs[spec]
if ( curKey and not NeedToKnow_Profiles[curKey] ) then
print("Current profile (" .. curKey .. ") has been deleted!");
curKey = NeedToKnow.CreateProfile(CopyTable(NEEDTOKNOW.PROFILE_DEFAULTS), spec)
local curProf = NeedToKnow_Profiles[curKey]
NeedToKnow.CharSettings.Specs[spec] = curKey
end
 
 
-- TODO: check the required members for existence and delete any corrupted profiles
end
 
2693,27 → 2744,14
id,
_, -- uao.canCast -- The player's class/spec can cast this spell
_, -- A boss applied this
_, -- Unknown boolean
_, -- cast by any player
v1,
v2,
v3,
bEnd -- Just indicates the end of the variable number of return results
v3
= 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
return name, icon, count, dur, expiry, caster, id, v1, v2, v3
end
end