Quantcast
WoWInterface - View Single Post - Is is possible to has a OnEnter Script and propagate or unregister mouse clicks?
View Single Post
05-06-21, 01:14 PM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,424
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:
  1. local f = CreateFrame("Button", "SomeOnEnterFrame", WorldFrame)
  2. f:SetSize(200, 200)
  3. f:SetPoint("TOPLEFT")
  4. f.t = f:CreateTexture()
  5. f.t:SetAllPoints()
  6. f.t:SetTexture("abc")
  7. f:RegisterForClicks("LeftButtonDown", "LeftButtonUp")
  8. f:SetScript("OnEnter", function(self)
  9.     print("Entered")
  10.     self:SetSize(400, 400)
  11. end)
  12. f:SetScript("OnLeave", function(self)
  13.     print("Left")
  14.     if self.MouseLooking or MouseIsOver(self) then
  15.         return
  16.     end
  17.     self:SetSize(200, 200)
  18. end)
  19. f:SetScript("OnClick", function(self, button, down)
  20.     if down then
  21.         if not self.MouseLooking then
  22.             self.MouseLooking = true
  23.             MouselookStart()
  24.         else
  25.             self.MouseLooking = nil
  26.             MouselookStop()
  27.         end
  28.     end
  29. end)
  30. WorldFrame:HookScript("OnMouseUp", function(self, button)
  31.     if SomeOnEnterFrame.MouseLooking then
  32.         SomeOnEnterFrame:Click(button, true)
  33.     end
  34. end)
... or not.

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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-06-21 at 02:29 PM.
  Reply With Quote