background script pt 1
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
(defmacro run-action [entities & forms]
|
||||
`(let [c# (chan)]
|
||||
(do
|
||||
(put! (get-in (deref ~entities) [:actions :channel])
|
||||
(put! (get-in (deref ~entities) [:fg-actions :channel])
|
||||
(reify IAction
|
||||
(get-channel [_] c#)
|
||||
~@forms))
|
||||
@@ -64,7 +64,7 @@
|
||||
(defn change-script-state [entities state]
|
||||
(run-action entities
|
||||
(begin [this screen entities]
|
||||
(update-in entities [:actions] assoc :script-running? state :last-skip-type (if state :end nil)))
|
||||
(update-in entities [:fg-actions] assoc :script-running? state :last-skip-type (if state :end nil)))
|
||||
|
||||
(continue [this screen entities] entities)
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
(defmacro get-script [entities & forms]
|
||||
`(fn [starting-entities#]
|
||||
(put! (get-in starting-entities# [:actions :script-chan])
|
||||
(put! (get-in starting-entities# [:fg-actions :script-chan])
|
||||
(fn [starting-entities#]
|
||||
(let [~entities (atom starting-entities#)]
|
||||
(thread (do
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
(defmacro get-unsaved-script [entities & forms]
|
||||
`(fn [starting-entities#]
|
||||
(put! (get-in starting-entities# [:actions :script-chan])
|
||||
(put! (get-in starting-entities# [:fg-actions :script-chan])
|
||||
(fn [starting-entities#]
|
||||
(let [~entities (atom starting-entities#)]
|
||||
(thread (do
|
||||
|
||||
Reference in New Issue
Block a user