more code cleanup because start-showing isn't needed.
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
opacity (get-in entities [:opacity])
|
||||
entities (-> entities
|
||||
(assoc-in [:overlay :opacity] opacity)
|
||||
(assoc-in [:fade :opacity] (* 0.3 opacity))
|
||||
(assoc-in [:fade :opacity] (* 0.6 opacity))
|
||||
(assoc-in [:highlighted-text :opacity] opacity)
|
||||
(update-in [:items] (fn [i]
|
||||
(map #(assoc % :opacity opacity) i))))]
|
||||
|
||||
@@ -54,27 +54,20 @@
|
||||
(assoc inputed-key
|
||||
:x (+ start-x 10 (* i 12))
|
||||
:y (+ start-y 56))))
|
||||
:start-showing? false
|
||||
:shown? false}))
|
||||
|
||||
|
||||
:on-render
|
||||
(fn [screen [entities]]
|
||||
(let [entities (if (:start-showing? entities)
|
||||
(-> entities
|
||||
(assoc :start-showing? false)
|
||||
(assoc :shown? true))
|
||||
entities)]
|
||||
|
||||
(when (:shown? entities)
|
||||
(render! screen [(:fade entities) (:safe entities)])
|
||||
(render! screen (take (count (:button-choices entities)) (:entered-keys entities))))
|
||||
entities))
|
||||
(when (:shown? entities)
|
||||
(render! screen [(:fade entities) (:safe entities)])
|
||||
(render! screen (take (count (:button-choices entities)) (:entered-keys entities))))
|
||||
entities)
|
||||
|
||||
:show-screen (fn [{:keys [success failure]} [entities]]
|
||||
(sound! (sound "inside-house/open-safe.ogg") :play (utils/current-sound-volume))
|
||||
(assoc entities
|
||||
:start-showing? true
|
||||
:shown? true
|
||||
:button-choices []
|
||||
:success success
|
||||
:failure failure))
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
:font font
|
||||
:music music
|
||||
:volume 1.0
|
||||
:start-showing? false
|
||||
:start-playing start-playing
|
||||
:quit quit
|
||||
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0
|
||||
|
||||
Reference in New Issue
Block a user