View Single Post
05-06-21, 12:04 PM   #1
OverCraft
A Murloc Raider
Join Date: May 2021
Posts: 4
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)
    f.tex = f:CreateTexture()
    f.tex:SetAllPoints(f)
    f.tex:SetColorTexture(0.5, 0.2, 1 , 0.5)
    f:SetSize(300,200)
    f:SetPoint("CENTER")
    f:SetScript ("OnEnter", function(self) print ("myfunc")  end)
With
Code:
f:SetPropagateKeyboardInput(true)
    f:EnableMouse(false)
not working and mouse isn't a keyboard . EnableMouse(false) removes OnEnter Script.

Making the frame a button and
Code:
f:RegisterForClicks()
void RegisterForClicks not working

I tried to manually move the camera with
Code:
f:SetScript("OnMouseDown",function (self,button) if button=="RightButton" then CameraOrSelectOrMoveStart()  end end)
f:SetScript("OnMouseUp",function (self,button) if button=="RightButton" then  CameraOrSelectOrMoveStop()  end end)
They are protected and I cannot use them

and same thing with
Code:
MouselookStart()
MouselookStop()
And I think they are not even related with the camera movement.

I got no more ideas, need some help of you. Thanks!
  Reply With Quote