Commit b8f8646c authored by Garkin's avatar Garkin

Fixed click heals

parent 60267df5
......@@ -185,8 +185,8 @@ end
-------------------------------------------------------------------------------
-- Support for Clique
-------------------------------------------------------------------------------
function SmartHealer:Clique_CastSpell(spellName, unit)
unit = unit or Clique.unit
function SmartHealer:Clique_CastSpell(clique, spellName, unit)
unit = unit or clique.unit
if UnitExists(unit) then
local spell, rank = libSC:GetRanklessSpellName(spellName)
......@@ -199,13 +199,13 @@ function SmartHealer:Clique_CastSpell(spellName, unit)
end
end
self.hooks[Clique]["CastSpell"](Clique, spellName, unit)
self.hooks[Clique]["CastSpell"](clique, spellName, unit)
end
-------------------------------------------------------------------------------
-- Support for ClassicMouseover
-------------------------------------------------------------------------------
function SmartHealer:CM_CastSpell(spellName, unit)
function SmartHealer:CM_CastSpell(cm, spellName, unit)
if UnitExists(unit) then
local spell, rank = libSC:GetRanklessSpellName(spellName)
......@@ -217,45 +217,48 @@ function SmartHealer:CM_CastSpell(spellName, unit)
end
end
self.hooks[CM]["CastSpell"](CM, spellName, unit)
self.hooks[CM]["CastSpell"](cm, spellName, unit)
end
-------------------------------------------------------------------------------
-- Support for pfUI
-------------------------------------------------------------------------------
function SmartHealer.pfUI_ClickAction(frame, button)
function SmartHealer:pfUI_ClickAction(pfui_uf, button)
local spellName = ""
local key = "clickcast"
local unit = (frame.label or "")..(frame.id or "")
if UnitExists(unit) then
if frame.config.clickcast == "1" then
if IsShiftKeyDown() then
key = key.."_shift"
elseif IsAltKeyDown() then
key = key.."_alt"
elseif IsControlKeyDown() then
key = key.."_ctrl"
end
if button == "LeftButton" then
local unit = (this.label or "")..(this.id or "")
if UnitExists(unit) then
if this.config.clickcast == "1" then
if IsShiftKeyDown() then
key = key.."_shift"
elseif IsAltKeyDown() then
key = key.."_alt"
elseif IsControlKeyDown() then
key = key.."_ctrl"
end
spellName = pfUI_config.unitframes[key]
spellName = pfUI_config.unitframes[key]
if spellName ~= "" then
local spell, rank = libSC:GetRanklessSpellName(spellName)
if spellName ~= "" then
local spell, rank = libSC:GetRanklessSpellName(spellName)
if spell and rank == nil and libHC.Spells[spell] then
rank = SmartHealer:GetOptimalRank(spellName, unit)
if rank then
pfUI_config.unitframes[key] = libSC:GetSpellNameText(spell, rank)
if spell and rank == nil and libHC.Spells[spell] then
rank = self:GetOptimalRank(spellName, unit)
if rank then
pfUI_config.unitframes[key] = libSC:GetSpellNameText(spell, rank)
end
end
end
end
end
end
self.hooks[pfUI.uf]["ClickAction"](pfUI.uf, button)
self.hooks[pfUI.uf]["ClickAction"](pfui_uf, button)
if spellName ~= "" then
pfUI_config.unitframes[key] = spell
pfUI_config.unitframes[key] = spellName
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment