Change how recording is started
This commit is contained in:
@@ -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*
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user