can return the portrait.

This commit is contained in:
Bryce Covert
2015-08-16 14:14:39 -07:00
parent 772e2bb0bf
commit d75693a910
3 changed files with 67 additions and 22 deletions

View File

@@ -252,7 +252,8 @@
out-of-bounds (not (contains-point? (.getScreenX viewport) (.getScreenY viewport)
(.getScreenWidth viewport) (.getScreenHeight viewport)
(first raw-pos) (last raw-pos)))
hovering-ego (hovering-ego entities last-pos)]
hovering-ego (hovering-ego entities last-pos)
current (get-in entities [:cursor :current])]
(cond
out-of-bounds
@@ -274,7 +275,7 @@
(assoc-in [:cursor :override] nil)
(assoc-in [:cursor :active] false))
(and hovering-ego (not= :main (get-in entities [:cursor :current])))
(and hovering-ego (not= :main 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))