dialogue tree improvements.

This commit is contained in:
2014-09-24 18:39:07 -07:00
parent f90ae6b7c3
commit 240af5dcf0
3 changed files with 62 additions and 47 deletions

View File

@@ -10,7 +10,8 @@
[advent.screens.dialogue :as dialogue]
[clojure.core.async :refer [put! <! <!! >! >!! chan go thread take! alts!!]])
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
[com.badlogic.gdx.graphics.g2d TextureRegion]))
[com.badlogic.gdx.graphics.g2d TextureRegion]
[com.badlogic.gdx Screen]))
(defprotocol IAction
(begin [this screen entities])
@@ -148,17 +149,17 @@
entities)))))
(defn present-choices [entities & pairs]
(let [pairs (partition 2 pairs)]
(run-action entities
(begin [this screen entities]
(run! dialogue/choice-screen :on-present-choices :pairs pairs)
entities)
(run-action entities
(begin [this screen entities]
(run! dialogue/choice-screen :on-present-choices :pairs pairs)
(run! @(resolve 'advent.screens.scene/scene) :on-pause)
entities)
(continue [this screen entities] entities)
(continue [this screen entities] entities)
(done? [this screen entities] true)
(done? [this screen entities] true)
(terminate [this screen entities] entities))))
(terminate [this screen entities] entities)))
(defn give [entities target-id item]