panning cancels click
This commit is contained in:
@@ -286,20 +286,23 @@
|
||||
|
||||
:on-hover-start
|
||||
(fn [screen {:keys [all-icons] :as entities} {:keys [hover-text x y scene-viewport cursor ]}]
|
||||
(println cursor hover-text)
|
||||
(let [x (if utils/mobile? x (+ 8 x))
|
||||
[scene-x scene-y] (scene-world->talk-world scene-viewport [x y])
|
||||
depressed? (< 0.5 (- (or (:total-time screen) 0) (int (or (:total-time screen) 0))))]
|
||||
depressed? (< 0.5 (- (or (:total-time screen) 0) (int (or (:total-time screen) 0))))
|
||||
item-cursor (:cursor (first (:last cursor)))
|
||||
action-cursor (utils/translate-depressed (first (:last cursor)) depressed?)]
|
||||
(label! (get-in entities [:label]) :set-text hover-text)
|
||||
(cond-> entities
|
||||
true (assoc-in [:label :text] hover-text)
|
||||
|
||||
utils/mobile? (update-in [:label] assoc :x (* 20 4) :y 12)
|
||||
|
||||
(and utils/mobile? (or (:cursor (first (:last cursor))) (first (:last cursor))))
|
||||
(and utils/mobile? (or item-cursor action-cursor)
|
||||
#_(not= :main action-cursor))
|
||||
(assoc-in [:action-icon]
|
||||
(assoc
|
||||
(texture (aget all-icons 0 (.indexOf utils/+all-cursors+ (or (:cursor (first (:last cursor))) (utils/translate-depressed (first (:last cursor))
|
||||
depressed?)))))
|
||||
(texture (aget all-icons 0 (.indexOf utils/+all-cursors+ (or item-cursor action-cursor))))
|
||||
:x 4 :y 4
|
||||
:width (* 18 4) :height (* 16 4)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user