only when you interact with something is it saveable again.

This commit is contained in:
Bryce Covert
2015-11-11 18:39:36 -08:00
parent 190db3dcd6
commit 6c5db9b061

View File

@@ -243,11 +243,13 @@ void main ()
(= (get-in entities [:cursor :down-target]) (= (get-in entities [:cursor :down-target])
(or (:id interacting-entity) (:id interaction) nil))) (or (:id interacting-entity) (:id interaction) nil)))
((or (when interacting-entity ((or (when interacting-entity
((:get-script interacting-entity) (get-in entities [:cursor :current]) [x y])) (do (screen! hud :on-start-script)
((:get-script interacting-entity) (get-in entities [:cursor :current]) [x y])))
(when interaction (when interaction
((:get-script interaction) (or (when (:cursor interaction) :main) (do (screen! hud :on-start-script)
(get-in entities [:cursor :current])) ((:get-script interaction) (or (when (:cursor interaction) :main)
[x y])) (get-in entities [:cursor :current]))
[x y])))
((:get-script default-interaction) (get-in entities [:cursor :current]) [x y])) entities)) ((:get-script default-interaction) (get-in entities [:cursor :current]) [x y])) entities))
(assoc-in entities [:cursor :down-target] nil))) (assoc-in entities [:cursor :down-target] nil)))
@@ -754,7 +756,7 @@ void main ()
(do (do
(next-script entities) (next-script entities)
(println "starting script") (println "starting script")
(screen! hud :on-start-script)
(assoc-in entities [:actions :script-running?] true)) (assoc-in entities [:actions :script-running?] true))
entities)))) entities))))
@@ -1406,7 +1408,7 @@ void main ()
hovered-close? hovered-close?
(grow-hud screen entities :close true) (grow-hud screen entities :close true)
(and hovered-save? (hud-interactable?)) (and hovered-save? (hud-interactable?) (not (:already-saved? entities)))
(grow-hud screen entities :save true) (grow-hud screen entities :save true)
:else :else