camera option

This commit is contained in:
Bryce Covert
2016-05-20 00:22:12 -07:00
parent d298e495bd
commit 1a230ee934
3 changed files with 18 additions and 9 deletions

View File

@@ -1 +1 @@
60 61

View File

@@ -1221,7 +1221,8 @@ void main ()
[id ((:update-fn entity) screen entities entity)] [id ((:update-fn entity) screen entities entity)]
[id entity]))))) [id entity])))))
entities (if (and (not (get-in entities [:cam :paused?])) entities (if (and (@utils/settings :camera-man? true)
(not (get-in entities [:cam :paused?]))
(nil? (get-in entities [:tweens :cam-x])) (nil? (get-in entities [:tweens :cam-x]))
(= 1 (rand-int 20))) (= 1 (rand-int 20)))
(if (= (rand-int 2) 1) (if (= (rand-int 2) 1)

View File

@@ -165,7 +165,7 @@
(doto (merge (check-box msg s) (doto (merge (check-box msg s)
(apply hash-map rest)) (apply hash-map rest))
(set-checkbox-state (utils/is-fullscreen?)) (set-checkbox-state checked)
save-object)))) save-object))))
(defn make-label (defn make-label
@@ -253,17 +253,20 @@
[ (make-button "Back" :key :back) :height 56]]))) [ (make-button "Back" :key :back) :height 56]])))
(defn settings-menu [] (defn settings-menu []
(let [fullscreen-button (make-checkbox "Fullscreen" (utils/is-fullscreen?) :key :toggle-fullscreen)] (let [fullscreen-button (make-checkbox "Fullscreen" (utils/is-fullscreen?) :key :toggle-fullscreen)
cameraman-button (make-checkbox "Handheld Camera" (@utils/settings :camera-man? true) :key :camera-man?)]
(assoc (make-table [[(make-label "Music" label-color) :height 40 :pad-bottom 4] (assoc (make-table [[(make-label "Music" label-color) :height 40]
:row :row
[(make-slider (:music-volume @utils/settings) :key :music-volume-slider) :width 240 :pad-bottom 4] [(make-slider (:music-volume @utils/settings) :key :music-volume-slider) :width 240]
:row :row
[(make-label "FX" label-color) :height 40 :width 200 :pad-bottom 4] [(make-label "FX" label-color) :height 40 :width 200]
:row :row
[(make-slider (:sound-volume @utils/settings) :key :sound-volume-slider) :width 240 :pad-bottom 4] [(make-slider (:sound-volume @utils/settings) :key :sound-volume-slider) :width 240]
:row :row
[fullscreen-button :height 56 :pad-bottom 4 :width 240] [fullscreen-button :height 56 :width 240]
:row
[cameraman-button :height 56 :width 280]
:row :row
[ (make-button "Back" :key :back) :height 56 :width 240]]) [ (make-button "Back" :key :back) :height 56 :width 240]])
@@ -450,6 +453,11 @@
(utils/save-settings!) (utils/save-settings!)
entities) entities)
(= :camera-man? actor-key)
(do (swap! utils/settings assoc :camera-man? (check-box! e :is-checked))
(utils/save-settings!)
entities)
(= :sound-volume-slider actor-key) (= :sound-volume-slider actor-key)
(do (swap! utils/settings assoc :sound-volume (slider! e :get-value)) (do (swap! utils/settings assoc :sound-volume (slider! e :get-value))
(utils/save-settings!) (utils/save-settings!)