Add a text/svg/full display-treatment selector to the menu

* card-games.el (card-games-treatment, card-games--svg-card-vars,
card-games--full-svg-vars, card-games-set-treatment): switch all games
between UNICODE, SVG cards, and the full-window SVG table by toggling the
per-game display vars together.  (card-game--cycle-treatment, card-game):
a clickable control in the chooser.
* test/card-games-tests.el: cgt-treatment-set.
* NEWS: note the treatment selector.
This commit is contained in:
Corwin Brust 2026-07-01 11:46:00 -05:00
parent e816cc0551
commit b2a8d6ad93
3 changed files with 64 additions and 1 deletions

View file

@ -1580,3 +1580,19 @@
(cg-put g :turn 1)
(let ((cg-ai-level 'easy) (cg-crap--recording nil)) (cg-crap--ai-play g))
(should (cg-crap--reserve g 1))))
(ert-deftest cgt-treatment-set ()
(let ((saved (mapcar (lambda (v) (cons v (symbol-value v)))
(append card-games--svg-card-vars card-games--full-svg-vars)))
(savedt card-games-treatment))
(unwind-protect
(progn
(card-games-set-treatment 'text)
(should-not cg-sol-svg-cards) (should-not cg-crapette-svg-cards)
(card-games-set-treatment 'full)
(should cg-sol-svg-cards) (should cg-bid-svg-ui) (should cg-gaps-svg-ui)
(card-games-set-treatment 'svg)
(should cg-sol-svg-cards) (should-not cg-bid-svg-ui))
(dolist (pr saved) (set (car pr) (cdr pr)))
(setq card-games-treatment savedt))))