clear dragTarget when window appears

This commit is contained in:
2022-08-20 17:16:10 +00:00
parent ab9e47e271
commit fe1c231802
2 changed files with 10 additions and 2 deletions

View File

@@ -46,7 +46,12 @@
(super.update elapsed) (super.update elapsed)
(if (windowIsShown) (if (windowIsShown)
(set FlxMouseControl.mouseZone disableMouse) {
(set FlxMouseControl.mouseZone disableMouse)
(when FlxMouseControl.dragTarget
(FlxMouseControl.dragTarget.stopDrag)
(set FlxMouseControl.dragTarget null))
}
(set FlxMouseControl.mouseZone null)) (set FlxMouseControl.mouseZone null))
(#when debug (#when debug
@@ -442,6 +447,7 @@
(loadRotatedGraphic unhighlightedS) (loadRotatedGraphic unhighlightedS)
}) })
// Uncomment to debug piece IDs
**(#when debug **(#when debug
(kiss_flixel.SpriteTools.writeOnSprite "$i" 32 s (object x (Percent 0.5) y (Percent 0.5)) FlxColor.RED) (kiss_flixel.SpriteTools.writeOnSprite "$i" 32 s (object x (Percent 0.5) y (Percent 0.5)) FlxColor.RED)
(kiss_flixel.SpriteTools.writeOnSprite "(${jig.col},${jig.row})" 32 s (object x (Percent 0.5) y (Percent 0.7)) FlxColor.RED)) (kiss_flixel.SpriteTools.writeOnSprite "(${jig.col},${jig.row})" 32 s (object x (Percent 0.5) y (Percent 0.7)) FlxColor.RED))

View File

@@ -83,4 +83,6 @@
(method &override update [:Float elapsed] (method &override update [:Float elapsed]
(super.update elapsed) (super.update elapsed)
(when (= (last windowStack) this) (when (= (last windowStack) this)
(keyHandler.update))) (keyHandler.update)
// TODO handle mouse input
))