better mouseeventmanager handling of SimpleWindow

This commit is contained in:
Trent Nelson
2023-08-02 17:25:08 -07:00
parent ded9cd74b5
commit 7ec5117480

View File

@@ -162,10 +162,6 @@
(a) (a)
(keyHandler.start) (keyHandler.start)
}) })
(FlxMouseEvent.globalManager.add this)
(FlxMouseEvent.globalManager.setMouseMoveCallback this ->_
(set mouseMode true))
(prop &mut :Bool justPressedUIButton false) (prop &mut :Bool justPressedUIButton false)
(set xHandler.cancelKey null) (set xHandler.cancelKey null)
(set xHandler.onBadKey ->:Void [key context] 0) (set xHandler.onBadKey ->:Void [key context] 0)
@@ -540,10 +536,17 @@
(windowStack.push this) (windowStack.push this)
(keyHandler.start) (keyHandler.start)
(xHandler.start) (xHandler.start)
(FlxMouseEvent.globalManager.add this)
(FlxMouseEvent.globalManager.setMouseMoveCallback this ->_
(set mouseMode true))
(set _shown true))) (set _shown true)))
(method :Void hide [] (method :Void hide []
(when _shown (when _shown
(FlxMouseEvent.globalManager.remove this)
(FlxG.cameras.remove controlCamera false) (FlxG.cameras.remove controlCamera false)
(FlxG.state.remove this true) (FlxG.state.remove this true)
(FlxG.state.remove controls true) (FlxG.state.remove controls true)