Skip to content

Commit

Permalink
Slim prompt choices when cards
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahTheDuke committed Jul 17, 2024
1 parent 43e1a88 commit 82e3ce4
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/clj/game/core/diffs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,24 @@

(defn prompt-summary
[prompt same-side?]
(if same-side?
(not-empty (select-non-nil-keys prompt prompt-keys))
nil))
(when same-side?
(-> prompt
(update :card #(not-empty (select-non-nil-keys % card-keys)))
(update :choices (fn [choices]
(->> choices
(mapv
(fn [choice]
(if (-> choice :value :cid)
(update choice :value select-non-nil-keys card-keys)
choice)))
(not-empty))))
(select-non-nil-keys prompt-keys)
(not-empty))))

(defn toast-summary
[toast same-side?]
(if same-side? toast nil))
(when same-side?
toast))

(def player-keys
[:aid
Expand Down

0 comments on commit 82e3ce4

Please sign in to comment.