slightly less shitty ui.
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter Color]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||
[com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget ButtonGroup]
|
||||
[com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget ButtonGroup TextButton$TextButtonStyle]
|
||||
[com.badlogic.gdx.scenes.scene2d Group Actor]
|
||||
[play_clj.entities ActorEntity]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align NinePatchDrawable TextureRegionDrawable]
|
||||
@@ -125,13 +125,7 @@
|
||||
(tween/tween :fade-out-music screen [:volume] 1.0 0.0 1.0)))))
|
||||
|
||||
(defn button-style []
|
||||
(let [font (utils/get-font "ego/font.fnt")
|
||||
style (style :text-button nil nil nil font)]
|
||||
(set! (.fontColor style) button-color)
|
||||
(set! (.overFontColor style) (color :yellow))
|
||||
(set! (.downFontColor style) (Color/valueOf "49224aff"))
|
||||
(set! (.disabledFontColor style) (color :gray))
|
||||
style))
|
||||
(skin! (skin "ui/ui.json") :get TextButton$TextButtonStyle))
|
||||
|
||||
(defn save-object [a]
|
||||
(.setUserObject ^Actor (:object a) a)
|
||||
@@ -183,28 +177,29 @@
|
||||
(defn main-menu []
|
||||
(let [start-playing-label (quest-label)
|
||||
is-starting? (= "Begin quest" start-playing-label)]
|
||||
(make-table [[(make-button start-playing-label :key :continue-or-start) :height 32]
|
||||
(make-table [[(make-button start-playing-label :key :continue-or-start) :height 56 :pad-bottom 4 :width 250]
|
||||
:row
|
||||
[(doto (make-button "Load" :key :load)
|
||||
(text-button! :set-disabled (not (seq (utils/snapshot-list))))) :height 32]
|
||||
(text-button! :set-disabled (not (seq (utils/snapshot-list))))) :height 56 :pad-bottom 4 :width 250]
|
||||
:row
|
||||
[(doto (make-button "Chapters" :key :chapters)
|
||||
(text-button! :set-disabled (not (->> (utils/get-chapters)
|
||||
(vals)
|
||||
(filter identity)
|
||||
seq)))) :height 32]
|
||||
seq)))) :height 56 :pad-bottom 4 :width 250]
|
||||
|
||||
:row
|
||||
[(make-button "Settings" :key :settings) :height 56 :pad-bottom 4 :width 250]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
:row
|
||||
[(make-label "Music" label-color) :height 32]
|
||||
:row
|
||||
[(make-slider (:music-volume @utils/settings) :key :music-volume-slider) :height 32 :width 305]
|
||||
:row
|
||||
[(make-label "FX" label-color) :height 32]
|
||||
:row
|
||||
[(make-slider (:sound-volume @utils/settings) :key :sound-volume-slider) :height 32 :width 305]
|
||||
:row
|
||||
[(make-button "Fullscreen" :key :toggle-fullscreen) :height 32]
|
||||
:row
|
||||
[(make-button "End quest" :key :end-quest) :height 32]
|
||||
[(make-button "End quest" :key :end-quest) :height 56 :width 250]
|
||||
])))
|
||||
|
||||
(defn chapters-menu []
|
||||
@@ -216,15 +211,10 @@
|
||||
(saves/chapter-name chapter)
|
||||
"---")
|
||||
:chapter (chapter chapters))
|
||||
(text-button! :set-disabled (nil? (chapter chapters)))) :height 32]
|
||||
(text-button! :set-disabled (nil? (chapter chapters)))) :height 56 :pad-bottom 4]
|
||||
:row]))
|
||||
[[(ActorEntity. (Widget.)) :height 32]
|
||||
:row
|
||||
[(ActorEntity. (Widget.)) :height 32]
|
||||
:row
|
||||
[(ActorEntity. (Widget.)) :height 32]
|
||||
:row
|
||||
(make-button "Back" :key :back)]))))
|
||||
[
|
||||
[ (make-button "Back" :key :back) :height 56]]))))
|
||||
|
||||
(defn get-selected-save [entities [x y]]
|
||||
(first (filter
|
||||
@@ -276,9 +266,9 @@
|
||||
:row
|
||||
(saves-table entities stage)
|
||||
:row
|
||||
[delete-button :width 100]
|
||||
[(make-button "Back" :key :back) :width 100]
|
||||
[continue-button :width 100]])
|
||||
[delete-button :width 100 :height 56]
|
||||
[(make-button "Back" :key :back) :width 100 :height 56]
|
||||
[continue-button :width 100 :height 56]])
|
||||
:save-label save-label
|
||||
:delete-button delete-button
|
||||
:continue-button continue-button)))
|
||||
|
||||
Reference in New Issue
Block a user