Use any card's art as a deck sleeve#10994
Open
MostCromulent wants to merge 1 commit into
Open
Conversation
Let a player use any card's art as their deck-back sleeve, alongside the built-in sleeves. A picker dialog chooses the card; chosen art is saved to a per-user library (the UI_SLEEVE_ART_LIBRARY preference). Card-art sleeves show in the lobby and in-match wherever the built-in sleeves do, on desktop and mobile. The sleeve is stored as either a built-in index or a card image key on LobbyPlayer/Player/PlayerView, exposed as a TrackableProperty and sent in UpdateLobbyPlayerEvent so opponents see it. Only the image key travels over the network -- never a URL or image file; each client derives the art itself, and an unresolved key falls back to the built-in sleeve. The art is Scryfall's art_crop: the existing image fetcher is reused but forced to the art_crop variant (regardless of UI_CARD_ART_FORMAT), gated by the online-image-fetcher preference, cached under CACHE_SLEEVE_PICS_DIR by a hash of the image key. At render time it is centre-cropped to the built-in sleeve aspect and framed to match them -- a charcoal border plus a diagonal bevel on desktop, a charcoal border on mobile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Since this just uses a card identifier to fetch the relevant scryfall art, it opens up some fun design space for future development: e.g. Adventure Mode enemies could have an optional field to use a specific card's art as their sleeve / player decks could designate sleeve art as metadata. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Select any card's art as a deck sleeve. You pick a card from a dialog; chosen art renders in the lobby and in-match exactly where the built-in sleeves do, styled to match them, on both desktop and mobile.
How it works
A player's sleeve is stored as either a built-in sleeve index or a card image key, carried on
LobbyPlayer/Player/PlayerViewand exposed as aTrackablePropertyso opponents see the choice; it travels over the wire inUpdateLobbyPlayerEvent.Two preferences persist the choice across sessions:
UI_SLEEVE_ART_LIBRARYholds the saved "Card Art Sleeves" library, andUI_SLEEVE_ART_KEYSholds the per-lobby-slot selection — sitting parallel to the existingUI_SLEEVES(built-in index per slot), so a slot using card art stores its key here while choosing a built-in sleeve clears it. Both are stored as comma-joined, URL-safe-base64-encoded image keys so card identifiers stay valid in theKEY=VALUEpreference format.The art itself comes from Scryfall's
art_crop:art_cropvariant (Scryfall's tightly-cropped artwork), regardless of the user'sUI_CARD_ART_FORMATpreference. It's gated behind the online-image-fetcher preference and skips cards with no usable art_crop (custom cards, or those missing an artist / collector number).CACHE_SLEEVE_PICS_DIR), keyed by a hash of the image key with an.artcrop.jpgfilename — chosen so the fetcher's Scryfall URL rewriting leaves it as the art_crop image.Safety
The only thing sent over the network is a card image key (a card identifier) — never a URL or an image file. Each client independently derives the Scryfall
art_cropfrom that key through its own preference-gated fetch path, so a player cannot point opponents at an arbitrary URL or push image bytes to them; an unrecognised key simply falls back to the built-in sleeve.🤖 Generated with Claude Code