local original_SpellButton_OnClick = SpellButton_OnClick
function SpellButton_OnClick(drag)
local id = SpellBook_GetSpellID(this:GetID())
if (id > MAX_SPELLS) then
return
end
if (IsShiftKeyDown() and ChatFrameEditBox:IsVisible() and not (MacroFrame and MacroFrame:IsVisible())) then
local spellName, subSpellName = GetSpellName(id, SpellBookFrame.bookType)
if(spellName) then
if (subSpellName and (strlen(subSpellName) > 0)) then
spellName = spellName.."("..subSpellName..")"
end
ChatFrameEditBox:Insert(" "..spellName)
end
return
else
original_SpellButton_OnClick(drag)
end
end