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 "Returns a list with strings cooresponding to the name of each layer in the
tiled map in `screen`." tiled map in `screen`."
[screen] [screen]
(for [^MapLayer layer (map-layers screen)] (doall
(.getName layer))) (for [^MapLayer layer (map-layers screen)]
(.getName layer))))
(defn map-objects* (defn map-objects*
([] ([]

View File

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