Select and drag multiple entries. Close #74

This commit is contained in:
2022-06-27 21:57:10 +00:00
parent 5175622374
commit 4724d100cf
4 changed files with 53 additions and 15 deletions

View File

@@ -47,11 +47,14 @@
// mouseDown
->s {
(set mouseDown (FlxG.mouse.getScreenPosition))
(controller.SelectEntries [])
(entryGroup.forEach
->entrySprite
(when (.containsPoint (entrySprite.getScreenBounds) (FlxG.mouse.getScreenPosition))
(controller.SelectEntry entrySprite.e)))
(let [&mut clickedOnSomething false]
(entryGroup.forEach
->entrySprite
(when (.containsPoint (entrySprite.getScreenBounds) (FlxG.mouse.getScreenPosition))
(set clickedOnSomething true)
(unless (controller.isSelected entrySprite.e)
(controller.SelectEntry entrySprite.e))))
(unless clickedOnSomething (controller.SelectEntries [])))
}
// mouseUp
->s {
@@ -62,6 +65,7 @@
->s {}
// mouseOut
->s {}
// also send events to sprites that overlap the dragging background
true
true
false)