Skip to content

Commit

Permalink
GitHub Issue #33 - persist theme changes from paused state
Browse files Browse the repository at this point in the history
  • Loading branch information
imalooney committed Jun 10, 2017
1 parent 2c39497 commit 2f9529e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/client/game/core.cljs
Expand Up @@ -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"
Expand Down

0 comments on commit 2f9529e

Please sign in to comment.