Change how recording is started

This commit is contained in:
oakes
2014-09-23 05:39:07 -04:00
parent cb1af60e5a
commit 6d184d8b98
2 changed files with 4 additions and 4 deletions

View File

@@ -64,11 +64,11 @@
(defn ^:private add-to-timeline! (defn ^:private add-to-timeline!
[screen-atom entities] [screen-atom entities]
(let [screen @screen-atom] (let [screen @screen-atom]
(when (:record? screen) (when (:timeline screen)
(swap! screen-atom (swap! screen-atom
update-in update-in
[:timeline] [:timeline]
#(conj (or %1 []) %2) conj
[(:total-time screen) entities])))) [(:total-time screen) entities]))))
(defn defscreen* (defn defscreen*

View File

@@ -80,8 +80,8 @@ specified path.
(defn rewind! (defn rewind!
"Returns the most recent entities vector saved in the timeline after removing "Returns the most recent entities vector saved in the timeline after removing
the last `steps` from it. The timeline is recorded by calling the last `steps` from it. Start recording to the timeline by calling
`(update! screen :record? true)`. `(update! screen :timeline [])`.
If there are 100 items saved in the timeline and `(rewind! screen 1)` is called, If there are 100 items saved in the timeline and `(rewind! screen 1)` is called,
it will remove the last one and return the entities vector from the 99th item. it will remove the last one and return the entities vector from the 99th item.