Skip to content

Commit

Permalink
Merge pull request #384 from datdamnzotz/fix-for-Mac-control-key
Browse files Browse the repository at this point in the history
Fix for Mac control key
  • Loading branch information
datdamnzotz authored May 6, 2020
2 parents 1b86e40 + 8930648 commit f06a56a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/cljs/orcpub/dnd/e5/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -1765,11 +1765,10 @@
(defn button-roll-fn [message roll]
(fn [e]
(if (.-shiftKey e)
(dispatch [:show-message-2 (str message " w/ Disadvantage: " (dice/dice-roll-text-2 roll) " | " (dice/dice-roll-text-2 roll))]))
(if (.-ctrlKey e)
(dispatch [:show-message-2 (str message " w/ Advantage: " (dice/dice-roll-text-2 roll) " | " (dice/dice-roll-text-2 roll))]))
(and (not (.-ctrlKey e)) (not (.-shiftKey e))
(dispatch [:show-message-2 (str message " " (dice/dice-roll-text-2 roll))]))))
(dispatch [:show-message-2 (str message " w/ Disadvantage: " (dice/dice-roll-text-2 roll) " | " (dice/dice-roll-text-2 roll))])
(if (or (.-ctrlKey e) (.-metaKey e))
(dispatch [:show-message-2 (str message " w/ Advantage: " (dice/dice-roll-text-2 roll) " | " (dice/dice-roll-text-2 roll))])
(dispatch [:show-message-2 (str message " " (dice/dice-roll-text-2 roll))])))))

(def button-roll-handler (memoize button-roll-fn))

Expand Down

0 comments on commit f06a56a

Please sign in to comment.