should start with scroll focus.

This commit is contained in:
Bryce Covert
2015-11-05 08:43:46 -08:00
parent fd3bfd691a
commit b6613a5106

View File

@@ -227,7 +227,7 @@
(every-pred :save #(utils/intersects? % [x y])) (every-pred :save #(utils/intersects? % [x y]))
(vals entities)))) (vals entities))))
(defn saves-table [entities] (defn saves-table [entities stage]
(let [group (doto (ButtonGroup.) (let [group (doto (ButtonGroup.)
(.setMaxCheckCount 1) (.setMaxCheckCount 1)
(.setMinCheckCount 0) (.setMinCheckCount 0)
@@ -253,19 +253,21 @@
save-screenshots (map make-save-screenshot (:saves-list entities)) save-screenshots (map make-save-screenshot (:saves-list entities))
grouped-screenshots (->> (partition-all 2 save-screenshots) grouped-screenshots (->> (partition-all 2 save-screenshots)
(mapcat (fn [group] (mapcat (fn [group]
(conj (map make-cell group) :row))))] (conj (map make-cell group) :row))))
[(doto (scroll-pane (table grouped-screenshots) scroll-pane (doto (scroll-pane (table grouped-screenshots)
(skin "ui/ui.json")) (skin "ui/ui.json"))
(scroll-pane! :set-fade-scroll-bars false)) (scroll-pane! :set-fade-scroll-bars false))]
(.setScrollFocus stage (:object scroll-pane))
[scroll-pane
:colspan 2 :height 224 :width 476])) :colspan 2 :height 224 :width 476]))
(defn saves-menu [entities] (defn saves-menu [entities stage]
(let [save-label (make-label "") (let [save-label (make-label "")
continue-button (doto (make-button "Continue" :key :continue) continue-button (doto (make-button "Continue" :key :continue)
(text-button! :set-disabled true))] (text-button! :set-disabled true))]
(assoc (make-table [[save-label :colspan 2 :height 32] (assoc (make-table [[save-label :colspan 2 :height 32]
:row :row
(saves-table entities) (saves-table entities stage)
:row :row
[(make-button "Back" :key :back) :width 150] [(make-button "Back" :key :back) :width 150]
[continue-button :width 150]]) [continue-button :width 150]])
@@ -393,7 +395,7 @@
(= :load actor-key) (= :load actor-key)
(-> entities (-> entities
(dissoc :main-menu) (dissoc :main-menu)
(assoc :save-menu (saves-menu entities))) (assoc :save-menu (saves-menu entities (:renderer screen))))
(= :chapters actor-key) (= :chapters actor-key)
(-> entities (-> entities