From 2f9529e7138a0bc3a8578aa89c9661fc89e81cc0 Mon Sep 17 00:00:00 2001 From: Elaine Looney Date: Fri, 9 Jun 2017 20:08:29 -0500 Subject: [PATCH] GitHub Issue #33 - persist theme changes from paused state --- src/client/game/core.cljs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/client/game/core.cljs b/src/client/game/core.cljs index b74a0cc..1eb2c5f 100644 --- a/src/client/game/core.cljs +++ b/src/client/game/core.cljs @@ -519,16 +519,17 @@ (defn resume-game! "Restores the state of the board pre-pausing, and resumes gravity" [] - (reset! state @paused-board) + (let [merge-paused-theme #(merge @paused-board {:theme (:theme %)})] + (swap! state merge-paused-theme) - ;; NOTE: this is just a quick hack to make the modal disappear after the - ;; scramble board is gone - ;; it was jarring visually otherwise - (js/setTimeout hide-paused-modal! 20) + ;; NOTE: this is just a quick hack to make the modal disappear after the + ;; scramble board is gone + ;; it was jarring visually otherwise + (js/setTimeout hide-paused-modal! 20) - (go-go-gravity!) - (reset! paused? false) - (reset! music-playing? @paused-music)) + (go-go-gravity!) + (reset! paused? false) + (reset! music-playing? @paused-music))) (defn pause-game! "Saves the current state of the board, loads the game-over animation and pauses gravity"