Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .snippets/ClickCastingTips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ local function ShowTips()
local bindKeyDisplay = strlen(bindKey) == 1 and bindKey or L[bindKey]

local bindActionDisplay, icon
bindAction, _, icon = GetSpellInfo(bindAction)
bindAction, icon = F:GetSpellNameAndIcon(bindAction)
if bindAction then
bindActionDisplay = bindAction.." |T"..icon..":0|t"
else
Expand Down
4 changes: 2 additions & 2 deletions .snippets/GenericRaidDebuffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function F:GetDebuffList(instanceName)
if loadedDebuffs[iId]["general"] then
n = #loadedDebuffs[iId]["general"]["enabled"]
for _, t in ipairs(loadedDebuffs[iId]["general"]["enabled"]) do
local spellName = GetSpellInfo(t["id"])
local spellName = F:GetSpellNameAndIcon(t["id"])
if spellName then
-- list[spellName/spellId] = {order, glowType, glowOptions}
if t["trackByID"] then
Expand All @@ -51,7 +51,7 @@ function F:GetDebuffList(instanceName)
for bId, bTable in pairs(loadedDebuffs[iId]) do
if bId ~= "general" then
for _, st in pairs(bTable["enabled"]) do
local spellName = GetSpellInfo(st["id"])
local spellName = F:GetSpellNameAndIcon(st["id"])
if spellName then -- check again
if st["trackByID"] then
list[st["id"]] = {["order"]=st["order"]+n+offset, ["condition"]=st["condition"], ["glowType"]=st["glowType"], ["glowOptions"]=st["glowOptions"], ["glowCondition"]=st["glowCondition"]}
Expand Down
2 changes: 1 addition & 1 deletion Cell.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 100207
## Interface: 100207,110000
## Title: Cell
## Version: r229-release
## Author: enderneko
Expand Down
32 changes: 28 additions & 4 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Cell.MIN_DEBUFFS_VERSION = 228
Cell.MIN_QUICKASSIST_VERSION = 227

--@debug@
local debugMode = true
--@end-debug@
-- local debugMode = true
--@end-debug@]==]
function F:Debug(arg, ...)
if debugMode then
if type(arg) == "string" or type(arg) == "number" then
Expand Down Expand Up @@ -227,8 +227,8 @@ function eventFrame:ADDON_LOADED(arg1)

-- spellRequest ---------------------------------------------------------------------------
if type(CellDB["spellRequest"]) ~= "table" then
local POWER_INFUSION, _, POWER_INFUSION_ICON = GetSpellInfo(10060)
local INNERVATE, _, INNERVATE_ICON = GetSpellInfo(29166)
local POWER_INFUSION, POWER_INFUSION_ICON = F:GetSpellNameAndIcon(10060)
local INNERVATE, INNERVATE_ICON = F:GetSpellNameAndIcon(29166)

CellDB["spellRequest"] = {
["enabled"] = false,
Expand Down Expand Up @@ -713,6 +713,28 @@ function eventFrame:PLAYER_ENTERING_WORLD()
end
end

local function registerGlobalClickCastings()
ClickCastFrames = ClickCastFrames or {}

if ClickCastFrames then
for frame, options in pairs(ClickCastFrames) do
F:RegisterFrame(frame)
end
end

ClickCastFrames = setmetatable({}, {__newindex = function(t, k, v)
if v == nil or v == false then
F:UnregisterFrame(k)
else
F:RegisterFrame(k)
end
end})

F:IterateAllUnitButtons(function (b)
ClickCastFrames[b] = true
end)
end

function eventFrame:PLAYER_LOGIN()
F:Debug("|cffbbbbbb=== PLAYER_LOGIN ===")
eventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
Expand Down Expand Up @@ -742,6 +764,8 @@ function eventFrame:PLAYER_LOGIN()
eventFrame:GROUP_ROSTER_UPDATE()
-- update visibility
Cell:Fire("UpdateVisibility")
-- register unitframes for click casting
registerGlobalClickCastings()
-- update click-castings
Cell:Fire("UpdateClickCastings")
-- update indicators
Expand Down
4 changes: 2 additions & 2 deletions Core_Cata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ function eventFrame:ADDON_LOADED(arg1)

-- spellRequest ---------------------------------------------------------------------------
if type(CellDB["spellRequest"]) ~= "table" then
local POWER_INFUSION, _, POWER_INFUSION_ICON = GetSpellInfo(10060)
local INNERVATE, _, INNERVATE_ICON = GetSpellInfo(29166)
local POWER_INFUSION, POWER_INFUSION_ICON = F:GetSpellNameAndIcon(10060)
local INNERVATE, INNERVATE_ICON = F:GetSpellNameAndIcon(29166)

CellDB["spellRequest"] = {
["enabled"] = false,
Expand Down
8 changes: 4 additions & 4 deletions Core_Vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Cell.MIN_LAYOUTS_VERSION = 228
Cell.MIN_INDICATORS_VERSION = 228
Cell.MIN_DEBUFFS_VERSION = 228

--@debug@
--[==[@debug@
local debugMode = true
--@end-debug@
--@end-debug@]==]
function F:Debug(arg, ...)
if debugMode then
if type(arg) == "string" or type(arg) == "number" then
Expand Down Expand Up @@ -190,8 +190,8 @@ function eventFrame:ADDON_LOADED(arg1)

-- spellRequest ---------------------------------------------------------------------------
if type(CellDB["spellRequest"]) ~= "table" then
local POWER_INFUSION, _, POWER_INFUSION_ICON = GetSpellInfo(10060)
local INNERVATE, _, INNERVATE_ICON = GetSpellInfo(29166)
local POWER_INFUSION, POWER_INFUSION_ICON = F:GetSpellNameAndIcon(10060)
local INNERVATE, INNERVATE_ICON = F:GetSpellNameAndIcon(29166)

CellDB["spellRequest"] = {
["enabled"] = false,
Expand Down
14 changes: 6 additions & 8 deletions Defaults/ClickCasting_DefaultSpells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ local _, Cell = ...
local L = Cell.L
local F = Cell.funcs

local GetSpellInfo = GetSpellInfo

-------------------------------------------------
-- click-castings
-------------------------------------------------
Expand Down Expand Up @@ -321,7 +319,7 @@ function F:GetClickCastingSpellList(class, spec)
spellType = L[spellType]
end

local name, _, icon = GetSpellInfo(spellId)
local name, icon = F:GetSpellNameAndIcon(spellId)
spells[i] = {icon, name, spellType, spellId}
end

Expand Down Expand Up @@ -366,12 +364,12 @@ local resurrections_for_dead = {
do
local temp = {}
for _, id in pairs(resurrections_for_dead) do
temp[GetSpellInfo(id)] = true
temp[F:GetSpellNameAndIcon(id)] = true
end
resurrections_for_dead = temp
end

local spell_soulstone = GetSpellInfo(20707)
local spell_soulstone = F:GetSpellNameAndIcon(20707)
function F:IsSoulstone(spell)
return spell == spell_soulstone
end
Expand Down Expand Up @@ -412,7 +410,7 @@ local resurrection_click_castings = {
-- do
-- for class, t in pairs(resurrection_click_castings) do
-- for _, clickCasting in pairs(t) do
-- clickCasting[3] = GetSpellInfo(clickCasting[3])
-- clickCasting[3] = F:GetSpellNameAndIcon(clickCasting[3])
-- end
-- end
-- end
Expand Down Expand Up @@ -454,7 +452,7 @@ local normalResurrection = {
do
for class, t in pairs(normalResurrection) do
for condition, spell in pairs(t) do
t[condition] = GetSpellInfo(spell)
t[condition] = F:GetSpellNameAndIcon(spell)
end
end
end
Expand All @@ -472,7 +470,7 @@ local combatResurrection = {

do
for class, spell in pairs(combatResurrection) do
combatResurrection[class] = GetSpellInfo(spell)
combatResurrection[class] = F:GetSpellNameAndIcon(spell)
end
end

Expand Down
12 changes: 5 additions & 7 deletions Defaults/ClickCasting_DefaultSpells_Cata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ local _, Cell = ...
local L = Cell.L
local F = Cell.funcs

local GetSpellInfo = GetSpellInfo

-------------------------------------------------
-- click-castings
-------------------------------------------------
Expand Down Expand Up @@ -175,7 +173,7 @@ function F:GetClickCastingSpellList(class)
spellType = L[spellType]
end

local name, _, icon = GetSpellInfo(spellId)
local name, icon = F:GetSpellNameAndIcon(spellId)
spells[i] = {icon, name, spellType, spellId}
end

Expand Down Expand Up @@ -207,7 +205,7 @@ local resurrections_for_dead = {
do
local temp = {}
for _, id in pairs(resurrections_for_dead) do
temp[GetSpellInfo(id)] = true
temp[F:GetSpellNameAndIcon(id)] = true
end
resurrections_for_dead = temp
end
Expand Down Expand Up @@ -242,7 +240,7 @@ local resurrection_click_castings = {
-- do
-- for class, t in pairs(resurrection_click_castings) do
-- for _, clickCasting in pairs(t) do
-- clickCasting[3] = GetSpellInfo(clickCasting[3])
-- clickCasting[3] = F:GetSpellNameAndIcon(clickCasting[3])
-- end
-- end
-- end
Expand All @@ -263,7 +261,7 @@ local normalResurrection = {

do
for class, spell in pairs(normalResurrection) do
normalResurrection[class] = GetSpellInfo(spell)
normalResurrection[class] = F:GetSpellNameAndIcon(spell)
end
end

Expand All @@ -278,7 +276,7 @@ local combatResurrection = {

do
for class, spell in pairs(combatResurrection) do
combatResurrection[class] = GetSpellInfo(spell)
combatResurrection[class] = F:GetSpellNameAndIcon(spell)
end
end

Expand Down
10 changes: 4 additions & 6 deletions Defaults/ClickCasting_DefaultSpells_Vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ local _, Cell = ...
local L = Cell.L
local F = Cell.funcs

local GetSpellInfo = GetSpellInfo

-------------------------------------------------
-- click-castings
-------------------------------------------------
Expand Down Expand Up @@ -160,7 +158,7 @@ function F:GetClickCastingSpellList(class)
spellType = L[spellType]
end

local name, _, icon = GetSpellInfo(spellId)
local name, icon = F:GetSpellNameAndIcon(spellId)
spells[i] = {icon, name, spellType, spellId}
end

Expand Down Expand Up @@ -188,7 +186,7 @@ local resurrections_for_dead = {
do
local temp = {}
for _, id in pairs(resurrections_for_dead) do
temp[GetSpellInfo(id)] = true
temp[F:GetSpellNameAndIcon(id)] = true
end
resurrections_for_dead = temp
end
Expand Down Expand Up @@ -231,7 +229,7 @@ local normalResurrection = {

do
for class, spell in pairs(normalResurrection) do
normalResurrection[class] = GetSpellInfo(spell)
normalResurrection[class] = F:GetSpellNameAndIcon(spell)
end
end

Expand All @@ -245,7 +243,7 @@ local combatResurrection = {

do
for class, spell in pairs(combatResurrection) do
combatResurrection[class] = GetSpellInfo(spell)
combatResurrection[class] = F:GetSpellNameAndIcon(spell)
end
end

Expand Down
Loading