source of truth comes from inventory for which item is selected.

This commit is contained in:
Bryce Covert
2016-08-03 19:35:17 -07:00
parent 62c9ceb5f9
commit 197165b663
5 changed files with 35 additions and 57 deletions

View File

@@ -361,7 +361,7 @@
(let [current-action (get-in entities [:fg-actions :current])
is-script-running (get-in entities [:fg-actions :script-running?])]
(and is-script-running
(not= :end (get-in entities [:fg-actions :last-skip-type])))))
(not ( #{nil :end :none-but-arrow} (get-in entities [:fg-actions :last-skip-type]))))))
(defn update-override [{:keys [^FitViewport viewport] :as screen} entities]
(let [raw-pos (get-in entities [:cursor :last-pos])
@@ -393,7 +393,7 @@
(assoc-in [:cursor :override] nil)
(assoc-in [:cursor :active] false))
(and hovering-ego (not= :main current))
(and hovering-ego (not @(resolve 'advent.screens.scene/get-selected-inventory-item)))
(-> entities
(assoc-in [:cursor :override] (or (:cursor mouse-override) (when (#{:main :active-main} (get-in entities [:cursor :last])) :active-main)))
(assoc-in [:cursor :active] true))