the finally opened up to failure again.
This commit is contained in:
@@ -172,7 +172,9 @@
|
||||
(:script %))
|
||||
(get-in entities [:room :interactions])))))
|
||||
|
||||
|
||||
(defn hovering-ego [entities [x y]]
|
||||
(when-let [mouse-in (get-in entities [:room :entities :ego :mouse-in?])]
|
||||
(mouse-in entities x y)))
|
||||
|
||||
(defn remove-interaction [entities id]
|
||||
(update-in entities [:room :interactions] (fn [i] (remove #(= id (:id %)) i))))
|
||||
@@ -249,7 +251,9 @@
|
||||
mouse-override (find-override entities last-pos)
|
||||
out-of-bounds (not (contains-point? (.getScreenX viewport) (.getScreenY viewport)
|
||||
(.getScreenWidth viewport) (.getScreenHeight viewport)
|
||||
(first raw-pos) (last raw-pos)))]
|
||||
(first raw-pos) (last raw-pos)))
|
||||
hovering-ego (hovering-ego entities last-pos)]
|
||||
|
||||
(cond
|
||||
out-of-bounds
|
||||
(update-in entities [:cursor] assoc :override nil :active false )
|
||||
@@ -269,12 +273,19 @@
|
||||
(-> entities
|
||||
(assoc-in [:cursor :override] nil)
|
||||
(assoc-in [:cursor :active] false))
|
||||
|
||||
|
||||
(and hovering-ego (not= :main (get-in entities [:cursor :current])))
|
||||
(-> 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))
|
||||
|
||||
mouse-override
|
||||
(-> 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))
|
||||
|
||||
|
||||
|
||||
:else
|
||||
(-> entities
|
||||
(assoc-in [:cursor :override] nil)
|
||||
|
||||
Reference in New Issue
Block a user