Make this script work in combat?
/run local f={PlayerFrame} for i=1,#f do f[i]:EnableMouse(0)end
This makes it so I can click through my player frame but I want to use this in combat. How do I do this? |
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) Code:
/run PlayerFrame:EnableMouse(not PlayerFrame:IsMouseEnabled()) Code:
local f = CreateFrame("Frame") http://addon.ziuo.net/ |
Quote:
|
Quote:
A more fitting solution would be to enable the mouse based on modifier state (ctrl/shift/alt keys): lua Code:
Untested, and probably has errors, but I think something like this would work :) |
It's possible to change the attributes on the frames, so you could for example only click the frame if you're holding down shift.
Lua Code:
|
Quote:
|
Fixed the missing "not" in my original post.
Quote:
A better overall solution might be to simply move the frames to some part of the screen you aren't accidentally clicking all the time. |
Quote:
Or better, make an addon out of it: http://addon.ziuo.net/ |
Hmm, this got me thinking... Would this not be possible with a custom state, or are custom states not allowed on unitframes (Is SecureUnitButtonTemplate inheriting attributes/methods of SecureHandlerStateTemplate)?
lua Code:
|
Yes, although I'm not sure if you can use it on PlayerFrame or not, and not sure about :EnableMouse() inside the wrapper.
|
Quote:
I just tried this and it didn't work for PlayerFrame and I tried in and out of combat. |
All times are GMT -6. The time now is 03:04 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI