Is is possible to has a OnEnter Script and propagate or unregister mouse clicks?
I want to make a frame that has a OnEnter/OnLeave Script with a funciton to make a frame bigger and print more info on it, and at the same time be able to keep moving the character camera op top of the frame with the right mouse click as the frame doesn't exist.
In other words, i need to propagate mouseclicks, or unbind mouse clicks from a frame, but OnEnter Script at the same time binds the mouseclicks too. Test code: Code:
local f = CreateFrame("Frame",nil,UIParent) Code:
f:SetPropagateKeyboardInput(true) Making the frame a button and Code:
f:RegisterForClicks() I tried to manually move the camera with Code:
f:SetScript("OnMouseDown",function (self,button) if button=="RightButton" then CameraOrSelectOrMoveStart() end end) and same thing with Code:
MouselookStart() I got no more ideas, need some help of you. Thanks! |
Unfortunately OnEnter and OnLeave doesn't involve a mouse button being clicked. The frame is interactive.
However, you can register for OnMouseDown or OnMouseUp and check for a specific button being clicked to interact with the frame only on left click. However, whether that allows you to click behind it with the right mouse button is another thing. As you have been doing, all you can do is try things out. Which by the looks of your post you have tried to do. Hopefully if someone has done what you want they can either point you to an addon that has it working for you to look at or can talk through how they did it. As far as I am aware a frame is either interactive or non-interactive based on whether you have chosen to use the mouse with it or just using it as an overlay display like a hud. |
You said moving the camera so this might give you something to start/work with (as currently coded, requires mouseleft to be held down to move the camera but it's up to you):
Lua Code:
You can't have MouseLook "running" and interact with UI elements at the same time using the mouse. If MouseLook gets "stuck on" while figuring out all the ins and outs you might need to address, clicking both buttons should unlock it. |
Quote:
|
WorldFrame is where the focus goes when entering MouseLook.
Once you enter MouseLook you lose the cursor just like running using both buttons down (which is essentially a protected StartMoving + MouseLookStart). Edit: I might have over (or under) interpreted the last question. |
Maybe your looking for something more like:
Lua Code:
The setting of BigSize could also include whatever you wanted to do OnEnter/OnLeave. |
Quote:
Lua Code:
|
So, even though you later disable the mouse, because you have set up the scripts it will work for those actions ? And, nice find with the SetMouseMotionEnabled function. Not seen that one yet myself.
Quote:
|
Quote:
|
All times are GMT -6. The time now is 07:28 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI