It is currently 19 Apr 2024, 09:27
   
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: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 58 guests

cron

Who is online

In total there are 58 users online :: 0 registered, 0 hidden and 58 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 58 guests

Login Form