made it easier to click on things.

This commit is contained in:
Bryce Covert
2017-03-11 10:03:25 -08:00
parent b7f8d0d6f2
commit b038dfbb98
4 changed files with 30 additions and 26 deletions

View File

@@ -125,8 +125,10 @@
(get-in entities [:room :interactions]))) )
(defn get-interacting-entity [entities x y]
(let [interactable-entities (if (= (doto (get-selected-inventory-item)
(#(log/info "clicked with " %)) ) :main)
(let [interactable-entities (if (or (= (doto (get-selected-inventory-item)
(#(log/info "clicked with " %)) )
:main)
(not (get-selected-inventory-item)))
(vals (dissoc (get-in entities [:room :entities]) :ego))
(vals (get-in entities [:room :entities])))
interacting-entity (first (sort-by (comp - :baseline)
@@ -149,6 +151,7 @@
(skip-action screen entities)
entities)]
(log/info "clicked interaction" interaction "entity" (:id interacting-entity))
(when (and (not (get-in entities [:fg-actions :script-running?])))
((or (when (and (not (:override-cursor interaction))
@@ -1489,8 +1492,9 @@
(defn get-selected-inventory-item []
(let [{{:keys [state state-data]} :inv-fsm} (-> hud :entities deref)]
(and (= state :selected)
state-data)))
(if (= state :selected)
state-data
nil)))
(defscreen demo
:on-show