Don't return lazy seq and fix select-box

This commit is contained in:
oakes
2014-04-20 18:52:00 -04:00
parent 694d63448c
commit 515ed8d3f7
2 changed files with 11 additions and 9 deletions

View File

@@ -191,8 +191,9 @@ non-tile layers, like object and image layers.
"Returns a list with strings cooresponding to the name of each layer in the
tiled map in `screen`."
[screen]
(for [^MapLayer layer (map-layers screen)]
(.getName layer)))
(doall
(for [^MapLayer layer (map-layers screen)]
(.getName layer))))
(defn map-objects*
([]

View File

@@ -377,17 +377,18 @@ based on the file at `path`.
; select-box
(defn select-box*
[items arg]
(ActorEntity. (SelectBox. (into-array items) arg)))
[arg]
(ActorEntity. (SelectBox. arg)))
(defmacro select-box
"Returns an entity based on [SelectBox](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/ui/SelectBox.html).
(select-box [\"Item 1\" \"Item 2\" \"Item 3\"]
(style :select-box font color back scroll-style list-style))
(select-box [\"Item 1\" \"Item 2\" \"Item 3\"] (skin \"uiskin.json\"))"
[items arg & options]
`(let [entity# (select-box* ~items ~arg)]
(select-box (style :select-box font color back scroll-style list-style)
:set-items [\"Item 1\" \"Item 2\" \"Item 3\"])
(select-box (skin \"uiskin.json\")
:set-items [\"Item 1\" \"Item 2\" \"Item 3\"])"
[arg & options]
`(let [entity# (select-box* ~arg)]
(u/calls! ^SelectBox (u/get-obj entity# :object) ~@options)
entity#))