started multiple saves.

This commit is contained in:
Bryce Covert
2015-09-28 12:49:26 -07:00
parent c732d15750
commit 1cb21ce28b
13 changed files with 81 additions and 57 deletions

View File

@@ -13,6 +13,7 @@
[advent.actions :as actions]
[advent.zone :as zone]
[advent.utils :as utils]
[advent.saves :as saves]
[advent.tween :as tween]
[advent.screens.rooms :as rooms]
[advent.screens.fade :refer [fade-screen]]
@@ -768,9 +769,9 @@ void main()
((get-in entities [:state :time]) layers)
layers)))
(defn get-state []
(if (utils/has-save?)
(utils/load)
(defn get-state [selected-save]
(if selected-save
(utils/load-snapshot selected-save)
{:object nil
:active? true
:last-room :dream
@@ -934,7 +935,7 @@ void main()
:night (utils/make-music "music/night.ogg")
:dream (utils/make-music "dream/music.ogg")
:secret-hideout (utils/make-music "music/secret-hideout.ogg")}
:state (get-state)
:state (get-state @utils/selected-save)
:time-profiles {:object nil
:default utils/default-night-merge
:sprite utils/default-night-merge-sprite
@@ -973,7 +974,7 @@ void main()
:all-items (assoc items/items :object nil)
:started? {:value false
:object nil}
:room (as-> (get rooms (:last-room (get-state))) room
:room (as-> (get rooms (:last-room (get-state @utils/selected-save))) room
(assoc-in room [:entities :ego] (get-ego screen (:start-pos room) ((:scale-fn room) (:start-pos room)))))}]
(doseq [[k [start time fn]] (get-in entities [:room :timers])]