Originally Posted by LBXZero
Right now, I don't know how to keep SpellBookFrame from showing during combat if requested to show.
|
You can use
InCombatLockdown() to determine if protected frames are locked due to being in combat.
Code:
SpellBookFrame:HookScript("OnShow",function(self)
if InCombatLockdown() then self:Hide(); end
end);
Alternatively, you can temporarily replace the
frame:Show() and
frame:SetShown() methods to
nop() to catch and disable any attempt to show the spellbook and set them to
nil afterward to restore functions. This works because the original functions are in the frame's metatable and are only accessed if the corresponding entry in the frame's own table doesn't exist.