better (but still broken) removal from playgrounds

This commit is contained in:
2022-07-05 14:55:49 +00:00
parent 4a379e00ba
commit 81ae02a58d
4 changed files with 17 additions and 14 deletions

View File

@@ -16,12 +16,11 @@
(unless (sprites.exists e.id)
(let [sprite (new EntrySprite this _playgroundKey pos archive e controller)]
(playState.entryGroup.add sprite)
(dictSet sprites e.id sprite))))
(set onRemoveEntry
(dictSet sprites e.id sprite)))
->[archive e &opt ui]
{
(.kill (dictGet sprites e.id))
(playState.entryGroup.remove (dictGet sprites e.id))
(sprites.remove e.id)
// When an Entry is hidden, we can bet the user doesn't want it selected anymore
(controller.DeSelectEntry e)

View File

@@ -1,9 +1,5 @@
(loadFrom "nat-archive-tool" "src/nat/Lib.kiss")
// TODO handleChanges() will need to kill every changed Entry's sprite and make a new one
// make interactible sprites for entries that have images
(var TEXT_SIZE 16)
(prop &mut :EntrySpriteSystem spriteSystem)
@@ -251,9 +247,7 @@
// process the WikipediaImageSystem and run spriteSystem process on newly created entries that get one
(archive.processSystems this)
// Do a second loop through the systems, so Playground systems that trigger Core systems have their effects processed
(archive.processSystems this)
(FlxG.camera.calculateScrollBounds entryGroup SCROLL_BOUND_MARGIN))
(archive.processSystems this))
(doFor e changeSet
// Entries whose data changed to remove them from the sprite pool will already have been removed
@@ -262,7 +256,9 @@
// refresh the sprites for entries that changed data but still should have sprites
(when (spriteSystem.sprites.exists e.id)
(spriteSystem.onRemoveEntry archive e))
(spriteSystem.processEntry archive e))))
(spriteSystem.processEntry archive e)))
(FlxG.camera.calculateScrollBounds entryGroup SCROLL_BOUND_MARGIN))
(prop &mut :Int uiY 0)