View Single Post
03-03-13, 04:22 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Not possible. You cannot modify the mouse-enabled state of secure frames while in combat. The best you could do would be to enable the mouse when you enter combat, and disable it again when you leave.

Also, that is a horribly written macro. I'm guessing you found it, or based it on something you found, on ArenaJunkies. You can just do this instead:

Code:
/run PlayerFrame:EnableMouse(false)
If you want it to be a toggle:

Code:
/run PlayerFrame:EnableMouse(not PlayerFrame:IsMouseEnabled())
If you want to automatically enable the mouse during combat, and disable it out of combat:

Code:
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_REGEN_ENABLED")
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:SetScript("OnEvent", function()
    if InCombatLockdown() then return end
    PlayerFrame:EnableMouse(UnitAffectingCombat("player"))
end)
If you need help turning the above code into an addon, copy and paste it into this page:
http://addon.ziuo.net/
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 03-03-13 at 11:01 PM.
  Reply With Quote