removed pan.

This commit is contained in:
Bryce Covert
2017-02-09 08:33:28 -08:00
parent de68ce9f50
commit 72a0078e4d

View File

@@ -150,10 +150,7 @@
entities)] entities)]
(when (and (not (get-in entities [:fg-actions :script-running?])) (when (and (not (get-in entities [:fg-actions :script-running?])))
(or (= (get-in entities [:cursor :down-target])
(or (:id interacting-entity) (:id interaction) nil))
(get-in entities [:cursor :came-from-inventory?])))
((or (when (and (not (:override-cursor interaction)) ((or (when (and (not (:override-cursor interaction))
interacting-entity) interacting-entity)
(do (screen! hud :on-start-script {}) (do (screen! hud :on-start-script {})
@@ -1016,8 +1013,7 @@
e))) e)))
(defn mouse-moved [screen entities {:keys [input-x input-y] :as options}] (defn mouse-moved [screen entities {:keys [input-x input-y] :as options}]
(when (or (not utils/mobile?) (get-in entities [:cursor :came-from-inventory?])) (utils/update-override screen (assoc-in entities [:cursor :last-pos] [input-x input-y]) options))
(utils/update-override screen (assoc-in entities [:cursor :last-pos] [input-x input-y]) options)))
(defn grab-layers [entities] (defn grab-layers [entities]
(update-in entities [:room] (update-in entities [:room]
@@ -1220,25 +1216,6 @@
:else :else
nil)) nil))
:on-pan
(fn [screen entities {:keys [input-x input-y delta-x delta-y]}]
(when (and utils/mobile?
(get-in entities [:state :active?])
(not (get-in entities [:cursor :came-from-inventory?])))
(let [ideal-x (+ (get-in entities [:cam :x]) (- (/ delta-x 4)))
ideal-y (+ (get-in entities [:cam :y]) (/ delta-y 4))]
(-> entities
(remove-cam-tweens)
(assoc-in [:cursor :last-pos] [0 0])
(assoc-in [:cursor :last] [:main nil])
(assoc-in [:cursor :override] nil)
(assoc-in [:cursor :down-target] nil)
(assoc-in [:label :text] "")
(assoc-in [:cursor :last-pos] [0 0])
(assoc-in [:cam :ideal-x] ideal-x)
(assoc-in [:cam :ideal-y] ideal-y)
(assoc-in [:cam :x] (utils/bound-to-camera ideal-x 320 (get-in entities [:cam :zoom])) )
(assoc-in [:cam :y] (utils/bound-to-camera ideal-y 240 (get-in entities [:cam :zoom])) )))))
:pinch-stop :pinch-stop
(fn [screen entities options] (fn [screen entities options]
@@ -1432,9 +1409,7 @@
(assoc-in [:cursor :down-target] (or (:id interacting-entity ) (:id interaction) nil))))))) (assoc-in [:cursor :down-target] (or (:id interacting-entity ) (:id interaction) nil)))))))
:on-touch-up (fn [screen entities options] :on-touch-up (fn [screen entities options]
(when (or (not utils/mobile?) (handle-touch-up screen entities options))
(get-in entities [:cursor :came-from-inventory?]))
(handle-touch-up screen entities options)))
:on-tap (fn [screen entities options] :on-tap (fn [screen entities options]
(when utils/mobile? (when utils/mobile?