melonDS icon indicating copy to clipboard operation
melonDS copied to clipboard

Add playing cards UI

Open rzumer opened this issue 5 years ago • 1 comments

This adds an interface to view and manipulate playing cards, for Magic Taizen/Master of Illusion/Magic Made Fun. Card images have to be provided by the user, since the deck of cards is unique and cannot be replaced by a regular one. The UI is self-contained and only spawns when a supported cartridge is inserted (detected by gamecode), so title-specific settings don't take space in the other settings windows and the feature should be invisible to users who don't play the relevant title.

The card image root directory is expected to contain folders named "front" and "back". When the directory is set, the application navigates to the "front" directory and looks for image files it can decode. Once 54 images are found (standard 52 cards and 2 jokers), the application navigates to the "back" directory and looks for image files matching the file names found in the "front" directory. There is no restriction to card image names.

The Draw button removes the topmost card from the deck. The Flip button reveals (or conceals) the topmost card on the deck. The Shuffle button reshuffles the entire deck, including any previously-drawn cards.

Demo: https://files.catbox.moe/il29nr.mp4

rzumer avatar Aug 02 '20 01:08 rzumer

Turns out I didn't take into account the fact that most people will not have 4K displays, and the size of the window can get pretty large with a few stacks added (>1080p even with just one stack). I'll either make the size dynamic, enable resizing, lower fixed sizes, and/or add a scrollbar... probably a mix so 1080p screens can fit at least 2-3 rows at once with a scrollbar.

rzumer avatar May 17 '21 20:05 rzumer