From 6c5db9b06144d092a3ec7b59e39472516ed5f9f6 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Wed, 11 Nov 2015 18:39:36 -0800 Subject: [PATCH] only when you interact with something is it saveable again. --- desktop/src-common/advent/screens/scene.clj | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index a956994c..b2cee53a 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -243,11 +243,13 @@ void main () (= (get-in entities [:cursor :down-target]) (or (:id interacting-entity) (:id interaction) nil))) ((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 - ((:get-script interaction) (or (when (:cursor interaction) :main) - (get-in entities [:cursor :current])) - [x y])) + (do (screen! hud :on-start-script) + ((:get-script interaction) (or (when (:cursor interaction) :main) + (get-in entities [:cursor :current])) + [x y]))) ((:get-script default-interaction) (get-in entities [:cursor :current]) [x y])) entities)) (assoc-in entities [:cursor :down-target] nil))) @@ -754,7 +756,7 @@ void main () (do (next-script entities) (println "starting script") - (screen! hud :on-start-script) + (assoc-in entities [:actions :script-running?] true)) entities)))) @@ -1406,7 +1408,7 @@ void main () hovered-close? (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) :else