zorker / rothui

Just a bunch of stuff I wrote for World of Warcraft
MIT License
105 stars 56 forks source link

add conditions for actionbar fader #66

Closed fafaraway closed 4 years ago

fafaraway commented 4 years ago

Hey zork, I try to add some more conditions for actionbar fader I have modified this function and added two conditions But I dont know how to register events for them, could you point me a direction ❓

function IsMouseOverFrame(frame)
    -- added these two conditions

    if UnitExists("target") then return end  
    if InCombatLockdown() then return end

    -- I konw the events are PLAYER_TARGET_CHANGED and PLAYER_REGEN_ENABLED
    -- but how to register them?

    if MouseIsOver(frame) then return true end
    if not SpellFlyout:IsShown() then return false end
    if not SpellFlyout.__faderParent then return false end
    if SpellFlyout.__faderParent == frame and MouseIsOver(SpellFlyout) then return true end
    return false
end