Hand & Foot, Scopa, Casino: full SVG board via the shared helper

* cg-rummy.el (cg-rummy--board-svg): add :stock-label and a :discard 'none
books and your hand/foot.
* cg-scopa.el (cg-fish--svg, cg-fish--render-text): board with the table
* NEWS: note the new boards.
This commit is contained in:
Corwin Brust 2026-07-01 04:50:10 -05:00
parent 585c4449a0
commit 2ee802f52d
5 changed files with 92 additions and 10 deletions

View file

@ -335,8 +335,11 @@ Keyword ARGS: :title :infos :melds :discard :stock :hand :cursor :marks
(raw-melds (plist-get args :melds))
(show-table (not (eq raw-melds 'none)))
(melds (and show-table raw-melds))
(discard (plist-get args :discard))
(raw-discard (plist-get args :discard))
(show-discard (not (eq raw-discard 'none)))
(discard (and show-discard raw-discard))
(stock (or (plist-get args :stock) 0))
(stock-label (or (plist-get args :stock-label) "Stock"))
(hand (plist-get args :hand))
(cursor (or (plist-get args :cursor) 0))
(marks (plist-get args :marks))
@ -383,13 +386,14 @@ Keyword ARGS: :title :infos :melds :discard :stock :hand :cursor :marks
(let ((yy (+ y-info 4)))
(dolist (line infos) (txt line pad yy 12) (setq yy (+ yy 16))))
(cg-svg-card svg pad y-sd :down (> stock 0) :gap (= stock 0))
(txt (format "Stock %d" stock) pad (+ y-sd h 13) 11)
(let ((dx (+ pad w gap 24)))
(if discard
(let ((sp (cg-rummy--card-spec discard)))
(cg-svg-card svg dx y-sd :rank (car sp) :suit (cdr sp)))
(cg-svg-card svg dx y-sd :gap t))
(txt "Discard" dx (+ y-sd h 13) 11))
(txt (format "%s %d" stock-label stock) pad (+ y-sd h 13) 11)
(when show-discard
(let ((dx (+ pad w gap 24)))
(if discard
(let ((sp (cg-rummy--card-spec discard)))
(cg-svg-card svg dx y-sd :rank (car sp) :suit (cdr sp)))
(cg-svg-card svg dx y-sd :gap t))
(txt "Discard" dx (+ y-sd h 13) 11)))
(when show-table
(txt "Table" pad (- y-melds 4) 11)
(if (null melds)