Allow for real time window resize

This commit is contained in:
jgk
2021-04-08 13:21:40 +02:00
parent 7969c3f9e8
commit feec924d5d
5 changed files with 25 additions and 8 deletions
+10 -2
View File
@@ -22,12 +22,20 @@ import qualified Data.Set as S
import qualified Data.IntMap.Strict as IM
import qualified Data.Map as M
import Control.Lens
update = update' . pushSideEffects
pushSideEffects :: World -> World
pushSideEffects w = w
& sideEffects .~ []
& doneSideEffects .~ _sideEffects w
{- | The update step.
If '_menuLayers' is not empty, or the saving screen, this is the identity.
In such menus, the only way to change the world is using event handling.
-}
update :: World -> World
update w = case _menuLayers w of
update' :: World -> World
update' w = case _menuLayers w of
(ConfigSaveScreen : ls) -> w & menuLayers .~ ls
(_ : _) -> w
[] -> let w1 = updateParticles' . updateProjectiles