disable save after save until script.
This commit is contained in:
@@ -753,6 +753,7 @@ void main ()
|
||||
(do
|
||||
(next-script entities)
|
||||
(println "starting script")
|
||||
(screen! hud :on-start-script)
|
||||
(assoc-in entities [:actions :script-running?] true))
|
||||
entities))))
|
||||
|
||||
@@ -1339,7 +1340,8 @@ void main ()
|
||||
(let [screen (assoc screen :total-time 0)]
|
||||
(utils/setup-viewport screen 320 240)
|
||||
|
||||
{:close (assoc (utils/get-texture "close.png")
|
||||
{:already-saved? false
|
||||
:close (assoc (utils/get-texture "close.png")
|
||||
:x 304 :y 224
|
||||
:width 16 :height 16
|
||||
:baseline 9000
|
||||
@@ -1361,15 +1363,18 @@ void main ()
|
||||
hud-interactable? (hud-interactable?)
|
||||
entities (if hud-interactable?
|
||||
(as-> entities entities
|
||||
(update-in entities [:save] assoc :r 1.0 :g 1.0 :b 1.0 )
|
||||
(update-in entities [:inventory] assoc :r 1.0 :g 1.0 :b 1.0 ))
|
||||
(as-> entities entities
|
||||
(update-in entities [:save] assoc :r 0.75 :g 0.75 :b 0.75)
|
||||
(update-in entities [:inventory] assoc :r 0.75 :g 0.75 :b 0.75)
|
||||
(grow-hud screen entities :save false)
|
||||
(grow-hud screen entities :inventory false)))]
|
||||
(grow-hud screen entities :inventory false)))
|
||||
entities (if (and hud-interactable? (not (:already-saved? entities)))
|
||||
(as-> entities entities
|
||||
(update-in entities [:save] assoc :r 1.0 :g 1.0 :b 1.0 ))
|
||||
(as-> entities entities
|
||||
(update-in entities [:save] assoc :r 0.75 :g 0.75 :b 0.75)
|
||||
(grow-hud screen entities :save false)))]
|
||||
#_(label! (:fps entities) :set-text (str (game :fps)))
|
||||
(render! screen [ (if hud-interactable?
|
||||
(render! screen [ (if (and hud-interactable? (not (:already-saved? entities)))
|
||||
(:save entities)
|
||||
(assoc (:save entities) :opacity 0.5))
|
||||
(if hud-interactable?
|
||||
@@ -1382,6 +1387,10 @@ void main ()
|
||||
(fn [{:keys [^FitViewport viewport width height]} entities]
|
||||
(.update viewport width height true))
|
||||
|
||||
:on-start-script
|
||||
(fn [_ [entities]]
|
||||
(assoc-in entities [:already-saved?] false))
|
||||
|
||||
:on-mouse-moved
|
||||
(fn [screen [entities]]
|
||||
(let [[x y] (utils/unproject screen)
|
||||
@@ -1418,7 +1427,9 @@ void main ()
|
||||
(screen! scene :on-menu)
|
||||
|
||||
(and (utils/intersects? (:save entities) [x y]) (hud-interactable?))
|
||||
(screen! scene :on-save)
|
||||
(do
|
||||
(screen! scene :on-save)
|
||||
(assoc entities :already-saved? true))
|
||||
|
||||
:else
|
||||
nil)))))
|
||||
|
||||
Reference in New Issue
Block a user