Skip to content

Commit 9e174a0

Browse files
committed
send the 'shift-key-is-held' status when clicking on a card
1 parent d4b4482 commit 9e174a0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/cljs/nr/gameboard/board.cljs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@
170170
(:poison card)
171171
(:highlight-in-discard card))))
172172

173-
(defn handle-card-click [{:keys [type zone] :as card}]
173+
(defn handle-card-click [{:keys [type zone] :as card} shift-key-held]
174174
(let [side (:side @game-state)]
175175
(when (not-spectator?)
176176
(cond
177177
;; Selecting card
178178
(= (get-in @game-state [side :prompt-state :prompt-type]) "select")
179-
(send-command "select" {:card (card-for-click card)})
179+
(send-command "select" {:card (card-for-click card) :shift-key-held shift-key-held})
180180

181181
;; Card is an identity of player's side
182182
(and (= (:type card) "Identity")
@@ -189,7 +189,7 @@
189189
(not (any-prompt-open? side))
190190
(= "hand" (first zone))
191191
(playable? card))
192-
(send-command "play" {:card (card-for-click card)})
192+
(send-command "play" {:card (card-for-click card) :shift-key-held shift-key-held})
193193

194194
;; Corp clicking on a corp card
195195
(and (= side :corp)
@@ -202,7 +202,8 @@
202202
(if (= (:cid card) (:source @card-menu))
203203
(do (send-command "generate-install-list" nil)
204204
(close-card-menu))
205-
(do (send-command "generate-install-list" {:card (card-for-click card)})
205+
(do (send-command "generate-install-list" {:card (card-for-click card)
206+
:shift-key-held shift-key-held})
206207
(open-card-menu (:cid card)))))
207208

208209
:else
@@ -722,13 +723,13 @@
722723
(put-game-card-in-channel card zoom-channel))
723724
:on-mouse-leave #(put! zoom-channel false)
724725
:on-click #(when (not disable-click)
725-
(handle-card-click card))
726+
(handle-card-click card (.-shiftKey %)))
726727
:on-key-down #(when (and (= "Enter" (.-key %))
727728
(not disable-click))
728-
(handle-card-click card))
729+
(handle-card-click card (.-shiftKey %)))
729730
:on-key-up #(when (and (= " " (.-key %))
730731
(not disable-click))
731-
(handle-card-click card))}
732+
(handle-card-click card (.-shiftKey %)))}
732733
(if (or (not code) flipped facedown)
733734
(let [facedown-but-known (or (not (or (not code) flipped facedown))
734735
(spectator-view-hidden?)

0 commit comments

Comments
 (0)