progress on dynamic saves.
This commit is contained in:
@@ -6,6 +6,7 @@ PROGRAMMING
|
||||
+ preload all sounds
|
||||
+ behind house left direction not great
|
||||
+ magic sound busted when fading music in
|
||||
+ brian goes down after wrong item
|
||||
|
||||
IOS
|
||||
+ all mp3s
|
||||
@@ -37,3 +38,4 @@ AUDIO
|
||||
|
||||
+ EDGES
|
||||
+ Gandarf magic handskkk
|
||||
+ arm wrestle
|
||||
|
||||
@@ -634,6 +634,20 @@ title/banner-back
|
||||
orig: 540, 42
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
title/save-indicator
|
||||
rotate: false
|
||||
xy: 1015, 909
|
||||
size: 7, 7
|
||||
orig: 7, 7
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
title/save-indicator-active
|
||||
rotate: false
|
||||
xy: 1015, 900
|
||||
size: 7, 7
|
||||
orig: 7, 7
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
wizard/Untitled
|
||||
rotate: false
|
||||
xy: 923, 582
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 182 KiB |
@@ -177,24 +177,33 @@
|
||||
(defn saves-menu [entities [save screenshot]]
|
||||
(let [last? (= save (-> (:saves-list entities) last first))
|
||||
first? (= save (-> (:saves-list entities) first first))]
|
||||
{:back (-> (make-label "Back")
|
||||
(stack-y 305 7)
|
||||
(assoc :z 8 :interactable true))
|
||||
:title (-> (make-label (str save))
|
||||
(stack-y 305 0)
|
||||
(assoc :z 8
|
||||
:interactable true
|
||||
:save (saves/name->save save)))
|
||||
:screenshot (-> (texture screenshot)
|
||||
(assoc :z 8 :x (/ 1280 2) :y (- 305 5) :origin-y 180 :origin-x 120 :height 180 :width 240
|
||||
:save (saves/name->save save)))
|
||||
(into
|
||||
{:back (-> (make-label "Back")
|
||||
(stack-y 305 7)
|
||||
(assoc :z 8 :interactable true))
|
||||
:title (-> (make-label (str save))
|
||||
(stack-y 305 0)
|
||||
(assoc :z 8
|
||||
:interactable true
|
||||
:save (saves/name->save save)))
|
||||
:screenshot (-> (texture screenshot)
|
||||
(assoc :z 8 :x (/ 1280 2) :y 214 :origin-y 60 :origin-x 80 :height 120 :width 160
|
||||
:save (saves/name->save save)))
|
||||
|
||||
:next (-> (make-label "Next >" (when last? (color :gray)))
|
||||
(assoc :x 780 :y 203
|
||||
:interactable (not last?)))
|
||||
:prev (as-> (make-label "< Prev" (when first? (color :gray))) prev
|
||||
(assoc prev :x (- 500 (.getWidth (:object prev))) :y 203
|
||||
:interactable (not first?)))}))
|
||||
:next (-> (make-label "Next >" (when last? (color :gray)))
|
||||
(assoc :x 780 :y 203
|
||||
:interactable (not last?)))
|
||||
:prev (as-> (make-label "< Prev" (when first? (color :gray))) prev
|
||||
(assoc prev :x (- 500 (.getWidth (:object prev))) :y 203
|
||||
:interactable (not first?)))}
|
||||
(for [[[save-l] index] (map vector (:saves-list entities) (range))
|
||||
:let [image (if (= save-l save)
|
||||
(utils/get-texture "title/save-indicator-active.png")
|
||||
(utils/get-texture "title/save-indicator.png"))]]
|
||||
|
||||
[[:save-indicator save-l] (assoc image
|
||||
:y 124 :x (- (+ 640 (* index 7 4))
|
||||
(/ (* (dec (count (:saves-list entities))) 7 4) 2)) :z 15 :scale-x 4 :scale-y 4)]))))
|
||||
|
||||
(defn style-ui [entities]
|
||||
(doseq [entity (vals entities)
|
||||
@@ -343,8 +352,11 @@
|
||||
(utils/toggle-fullscreen!)
|
||||
|
||||
(and (:back entities) (utils/intersects? (:back entities) [x y]))
|
||||
(-> entities (dissoc :screenshot :back :title :prev :next)
|
||||
(merge (:main-menu entities)))
|
||||
(as-> entities entities
|
||||
(dissoc entities :screenshot :back :title :prev :next)
|
||||
(apply dissoc entities (map #(vector :save-indicator (first %))
|
||||
(:saves-list entities)))
|
||||
(merge entities(:main-menu entities)))
|
||||
|
||||
(and next (:interactable next) (utils/intersects? next [x y]))
|
||||
(-> entities
|
||||
|
||||
Reference in New Issue
Block a user