Skip to content

Commit

Permalink
Merge branch 'develop' into release/9.0.000
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWanderer-GH committed Oct 20, 2020
2 parents fb13f12 + b846f64 commit a77536a
Showing 1 changed file with 14 additions and 48 deletions.
62 changes: 14 additions & 48 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ CoolLine.frames, CoolLine.cooldowns, CoolLine.specialspells = frames, cooldowns,
local NO_RELOCATE = "NO_RELOCATE"
CoolLine.NO_RELOCATE = NO_RELOCATE

local MINIMUM_COOLDOWN_DURATION = 2499

local SetValue, updatelook, createfs, ShowOptions, RuneCheck

local function SetValueH(this, v, just)
Expand Down Expand Up @@ -508,21 +510,23 @@ do
local lastID
local sb = spells[btype]

if IS_RETAIL_RELEASE then
local _, _, offset, numSpells = GetSpellTabInfo(2)
for i = 1, offset + numSpells do
local spellName = GetSpellBookItemName(i, btype)
local _, numTabs
numTabs = GetNumSpellTabs()
for i = 1, numTabs do
local _, _, offset, numSpells = GetSpellTabInfo(i)
for j = 1, offset + numSpells do
local spellName = GetSpellBookItemName(j, btype)
if not spellName then break end
local spellType, spellID = GetSpellBookItemInfo(i, btype)
if spellID and spellType == "FLYOUT" then
local spellType, spellID = GetSpellBookItemInfo(j, btype)
if IS_RETAIL_RELEASE and spellID and spellType == "FLYOUT" then
local _, _, numSlots, isKnown = GetFlyoutInfo(spellID)
if isKnown then
for j = 1, numSlots do
local flyID, _, _, flyName = GetFlyoutSlotInfo(spellID, j)
for k = 1, numSlots do
local flyID, _, _, flyName = GetFlyoutSlotInfo(spellID, k)
lastID = flyID
if flyID then
local flyCD = GetSpellBaseCooldown(flyID)
if flyCD and flyCD > 2499 then
if flyCD and flyCD > MINIMUM_COOLDOWN_DURATION then
sb[flyID] = flyName -- specialspells[flyID] or flyName
end
end
Expand All @@ -544,7 +548,7 @@ do
chargespells[btype][spellID] = spellName
else
local cd = GetSpellBaseCooldown(spellID)
if cd and cd > 2499 then
if cd and cd > MINIMUM_COOLDOWN_DURATION then
sb[spellID] = spellName
-- if specialspells[spellName] then
-- sb[ specialspells[spellName] ] = spellName
Expand All @@ -554,45 +558,7 @@ do
end
end
end
elseif IS_CLASSIC then
local offsets, numTabs
numTabs = GetNumSpellTabs()
for i = 1, numTabs do
local _, _, offset, numSpells = GetSpellTabInfo(i)
for j = 1, offset + numSpells do
local spellName, spellRank, spellId = GetSpellBookItemName(j, btype)
if not spellName then break end
local spellType, spellID = GetSpellBookItemInfo(j, btype)
-- copy pasta of above retail code
if spellID and spellType == "SPELL" and spellID ~= lastID then
-- Base spell = slot ID + name from slot ID
-- Real spell = ID from slot name + name from slot name
-- For the purposes of CoolLine we only care about the real spell.
lastID = spellID
spellName, _, _, _, _, _, spellID = GetSpellInfo(spellName)
if spellID then
-- Special spells like warlock Cauterize Master can be in
-- a limbo state during loading. Just ignore them in that
-- case. The spellbook will update again momentarily and
-- they will correctly resolve then.
local _, maxCharges = GetSpellCharges(spellID)
if maxCharges and maxCharges > 0 then
chargespells[btype][spellID] = spellName
else
local cd = GetSpellBaseCooldown(spellID)
if cd and cd > 2499 then
sb[spellID] = spellName
-- if specialspells[spellName] then
-- sb[ specialspells[spellName] ] = spellName
-- end
end
end
end
end
end
end
end

end

----------------------------------
Expand Down

0 comments on commit a77536a

Please sign in to comment.