Quantcast
WoWInterface: SVN - CoolLineFix - Path Comparison - / Rev 9 and / Rev 10

WoWInterface SVN CoolLineFix

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 9 to Rev 10
    Reverse comparison

Rev 9 → Rev 10

trunk/README.txt File deleted
trunk/LICENSE.txt File deleted
trunk/Fix.lua
1,84 → 1,7
--[[--------------------------------------------------------------------
CoolLine Fix
Hides CoolLine in pet battles, and adds support for spell charges.
Copyright (c) 2014 Phanx <addons@phanx.net>. All rights reserved.
See the accompanying README and LICENSE files for more information.
http://www.wowinterface.com/downloads/info22791-CoolLineFix.html
http://www.curse.com/wow/addons/coolline-fix
----------------------------------------------------------------------]]
-- Hide in pet battles
 
CoolLine:RegisterEvent("PET_BATTLE_OPENING_START")
CoolLine:RegisterEvent("PET_BATTLE_CLOSE")
 
CoolLine.PET_BATTLE_OPENING_START = CoolLine.Hide
CoolLine.PET_BATTLE_CLOSE = CoolLine.Show
 
if C_PetBattles.IsInBattle() then
CoolLine:Hide()
end
 
------------------------------------------------------------------------
-- Show spell charges
 
local CoolLineFix = CreateFrame("Frame")
CoolLineFix:SetScript("OnEvent", function(f, e, ...) return (f[e] or f["SPELLS_CHANGED"])(f, ...) end)
CoolLineFix:RegisterEvent("PLAYER_LOGIN")
CoolLineFix:RegisterEvent("SPELLS_CHANGED")
CoolLineFix:RegisterEvent("SPELL_UPDATE_CHARGES")
 
local chargeSpells = {
[BOOKTYPE_SPELL] = {},
[BOOKTYPE_PET] = {},
}
 
do -- cache spells that have a cooldown
local last
local GetSpellBookItemName, GetSpellBookItemInfo, GetSpellCharges = GetSpellBookItemName, GetSpellBookItemInfo, GetSpellCharges
local function CacheBook(bookType)
local t = chargeSpells[bookType]
local _, _, offset, numSpells = GetSpellTabInfo(2)
for i = 1, offset + numSpells do
local name = GetSpellBookItemName(i, bookType)
if not name then break end
local slotType, id = GetSpellBookItemInfo(i, bookType)
if id and slotType ~= "FLYOUT" and slotType ~= "FUTURESPELL" and id ~= last then
last = id
local currentCharges, maxCharges, cooldownStart, cooldownDuration = GetSpellCharges(id)
if maxCharges and maxCharges > 0 then
t[id] = name
end
end
end
end
 
function CoolLineFix:SPELLS_CHANGED()
CacheBook(BOOKTYPE_SPELL)
if not CoolLineDB.hidepet then
CacheBook(BOOKTYPE_PET)
end
end
end
 
do
local AVAILABLE = 2^32 / 1000
local GetSpellCharges, GetSpellTexture = GetSpellCharges, GetSpellTexture
local function CheckSpellBook(bookType)
for id, name in pairs(chargeSpells[bookType]) do
local currentCharges, maxCharges, cooldownStart, cooldownDuration = GetSpellCharges(id)
if cooldownStart and cooldownDuration and currentCharges < maxCharges and not CoolLineDB.block[name] then
local _, _, texture = GetSpellInfo(id)
CoolLine.NewCooldown(name, texture, cooldownStart + cooldownDuration, bookType == BOOKTYPE_SPELL)
else
CoolLine.ClearCooldown(nil, name)
end
end
end
 
function CoolLineFix:SPELL_UPDATE_CHARGES()
CheckSpellBook(BOOKTYPE_SPELL)
if not CoolLineDB.hidepet and HasPetUI() then
CheckSpellBook(BOOKTYPE_PET)
end
end
end
\ No newline at end of file +local f = CreateFrame("Frame") +f:RegisterEvent("PLAYER_LOGIN") +f:SetScript("OnEvent", function() + C_Timer.After(5, function() + DEFAULT_CHAT_FRAME:AddMessage("|cffff7f7fIMPORTANT:|r CoolLine Fix is no longer needed. You should uninstall it!") + end) +end) \ No newline at end of file
trunk/CoolLineFix.toc
1,21 → 1,5
## Interface: 60000
## Version: 6.0.2.wowi:revision
 
## Title: CoolLine Fix
## Notes: Hides CoolLine in pet battles, and adds support for spell charges.
## Notes-deDE: Versteckt CoolLine in Haustierkämpfen, und fügt Unterstützung für die Zaubersaufladungen hinzu.
## Notes-esES: Oculta CoolLine en los duelos de mascotas, y añade soporto para los cargas de hechizos.
## Notes-esMX: Oculta CoolLine en los duelos de mascotas, y añade soporto para los cargas de hechizos.
## Notes: No longer needed. Uninstall!
 
## Author: Phanx
## X-Email: addons@phanx.net
## X-Copyright: Copyright (c) 2014 Phanx. All rights reserved.
## X-License: See the accompanying LICENSE file for details.
## X-CompatibleLocales: enUS, deDE, esES, esMX, frFR, itIT, ptBR, ruRU, koKR, zhCN, zhTW
## X-Website: http://www.wowinterface.com/downloads/info22791-CoolLineFix.html
## X-Curse-Project-ID: coolline-fix
## X-WoWI-ID: 22791
 
## Dependencies: CoolLine
 
Fix.lua
\ No newline at end of file