a lot of tweaks to make mobile faster.
This commit is contained in:
@@ -108,7 +108,7 @@
|
||||
(defn force-end [entities current-action key]
|
||||
(do (when current-action
|
||||
(put! (get-channel current-action) :end))
|
||||
(screen! dialogue/talking-screen :stop-talk :id key)
|
||||
(screen! dialogue/talking-screen :stop-talk {:id key})
|
||||
(-> entities
|
||||
(assoc-in [key :script-running?] false)
|
||||
(assoc-in [key :current] nil)
|
||||
@@ -411,14 +411,14 @@
|
||||
scale-fn (get-in entities [:room :scale-fn])
|
||||
scale (get-in entities [:room :entities target-id :scale-y] 1)
|
||||
height (* scale height)]
|
||||
(screen! dialogue/talking-screen :on-talk :text text
|
||||
:id fg-or-bg
|
||||
:scene-viewport (:viewport screen)
|
||||
:x target-x :y (+ target-y height)
|
||||
:color (or color (get-in entities [:room :entities target-id :talk-color]))
|
||||
|
||||
:target-id target-id
|
||||
:scale scale)
|
||||
(screen! dialogue/talking-screen :on-talk { :text text
|
||||
:id fg-or-bg
|
||||
:scene-viewport (:viewport screen)
|
||||
:x target-x :y (+ target-y height)
|
||||
:color (or color (get-in entities [:room :entities target-id :talk-color]))
|
||||
|
||||
:target-id target-id
|
||||
:scale scale})
|
||||
(if animate?
|
||||
(update-in entities [:room :entities target-id ] #(start-animation screen % (or anim (:talk-override %) :talk)))
|
||||
entities)))
|
||||
@@ -435,7 +435,7 @@
|
||||
(terminate [this screen entities]
|
||||
(if wait
|
||||
(do
|
||||
(screen! dialogue/talking-screen :stop-talk :id fg-or-bg)
|
||||
(screen! dialogue/talking-screen :stop-talk {:id fg-or-bg})
|
||||
(if stop?
|
||||
(stop screen entities target-id)
|
||||
entities))
|
||||
@@ -471,7 +471,7 @@
|
||||
dialogue-choices (filter first (partition 2 (:choices node)))]
|
||||
(run-action entities
|
||||
(begin [this screen entities]
|
||||
(screen! dialogue/choice-screen :on-present-choices :choices dialogue-choices :callback #(reset! selected-index %))
|
||||
(screen! dialogue/choice-screen :on-present-choices { :choices dialogue-choices :callback #(reset! selected-index %)})
|
||||
(assoc-in entities [:state :active?] false))
|
||||
|
||||
(continue [this screen entities] entities)
|
||||
@@ -540,7 +540,7 @@
|
||||
(run-action entities
|
||||
(begin [this screen entities]
|
||||
(when-not quiet?
|
||||
(screen! @(resolve 'advent.screens.scene/hud) :on-remove-item :item ((:all-items entities) item)))
|
||||
(screen! @(resolve 'advent.screens.scene/hud) :on-remove-item { :item ((:all-items entities) item)}))
|
||||
(-> entities
|
||||
(update-in [:state :inventory] #(remove (partial = item) %))))
|
||||
|
||||
@@ -581,7 +581,7 @@
|
||||
(run-action entities
|
||||
(begin [this screen entities]
|
||||
(utils/play-sound! screen entities :pickup (constantly 0.3))
|
||||
(screen! @(resolve 'advent.screens.scene/hud) :on-give-item :item ((:all-items entities) item))
|
||||
(screen! @(resolve 'advent.screens.scene/hud) :on-give-item { :item ((:all-items entities) item)})
|
||||
(-> entities
|
||||
(update-in [:state :inventory] #(conj % item))
|
||||
(update-in [:state :obtained-items] #(conj % item))))
|
||||
@@ -697,7 +697,7 @@
|
||||
(skip-type [this screen entities]
|
||||
:none))
|
||||
(log/info "Entering room " new-background )
|
||||
(screen! dialogue/talking-screen :stop-talk :id :bg-actions)
|
||||
(screen! dialogue/talking-screen :stop-talk { :id :bg-actions})
|
||||
(run-action entities
|
||||
(begin [this screen entities]
|
||||
(utils/stop-all-sounds! entities)
|
||||
|
||||
Reference in New Issue
Block a user