It is currently 02 Sep 2025, 08:01
   
Text Size

Foil effect not shown on opened packs

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Foil effect not shown on opened packs

Postby Seravy » 02 Jul 2017, 14:04

I've investigated this problem.

In short, these views use CardPicturePanel, which seems to fetch the image for a card (generic) instead of a card (inventory item).

The relevant part of the code looks like this (in CardPicturePanel.java):
Code: Select all
      if (displayed instanceof InventoryItem) {
            final InventoryItem item = (InventoryItem) displayed;
            return ImageCache.getOriginalImage(item.getImageKey(false), true);
        }
To fix the problem, the return value should be changed to contain a foil image of the card when applicable.

Unfortunately, I have no idea how to add the foil effect to the image, but at least I know where it goes now.

The other possible solution I see is replacing CardPicturePanel with a different class that displays cards, one that already supports foils. One such class I found is CardPanel, but I don't know the correct parameters to use it, or if it can even be used outside of a match.
Seravy
 
Posts: 365
Joined: 26 Oct 2016, 21:23
Has thanked: 6 times
Been thanked: 27 times

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 30 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 30 users online :: 0 registered, 0 hidden and 30 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 30 guests

Login Form