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, 02:42 PM   #4
OverCraft
A Defias Bandit
Join Date: May 2021
Posts: 3
Originally Posted by Fizzlemizz View Post
You said moving the camera so this might give you something to start/work with (requires mouseleft to be held down to move the camera):
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.

If MouseLook gets "stuck on" while figuring out all the ins and outs you might need to address, clicking both buttons should unlock it.
Thanks a lot, i was very close to it but never heared about WorldFrame. Do you think it is possible to use rightclick to do that and leftclick with the same behaviour as WorldFrame does? clicking object, targeting units etc.. ? To be a complete transparent frame.
  Reply With Quote