It is currently 19 Apr 2024, 01:09
   
Text Size

Foil card display fix in packs

Post MTG Forge Related Programming Questions Here

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

Foil card display fix in packs

Postby Seravy » 15 Jul 2017, 12:11

Finally managed to solve this!

This patch allows the foil effect to correctly show up on cards while opening packs - and I expect it to work in other views that utilize the CardPicturePanel class as well.
Attachments
FoilInPacks.txt
(2.5 KiB) Downloaded 219 times
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Foil card display fix in packs

Postby Agetian » 15 Jul 2017, 18:10

Thanks! Integrated after some minor tweaks and modifications (since cloning an image might be a somewhat "expensive" operation, I'm only doing it in case the card is actually a foil and thus the clone/apply foil effect operation actually needs to be done). Also, formatting was still off, using tabs instead of spaces :/

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Foil card display fix in packs

Postby Seravy » 15 Jul 2017, 18:27

Agetian wrote:Thanks! Integrated after some minor tweaks and modifications (since cloning an image might be a somewhat "expensive" operation, I'm only doing it in case the card is actually a foil and thus the clone/apply foil effect operation actually needs to be done). Also, formatting was still off, using tabs instead of spaces :/

- Agetian
That's weird, as I did use the format option you specified.
Looked at the code in my copy - indeed, in the area where "source-format" was used there are tabs instead of spaces. I didn't add those manually, it was the automatic formatting.

...looks like formatting has its own settings and ignores the editor preferences. It was on "tabs only". Changed to spaces only, hope that will finally work.
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Foil card display fix in packs

Postby Seravy » 25 Jul 2017, 00:41

I opened a booster box and every time a foil card was opened, every single copy of that card was shown foil in future packs in the box.
Furthermore the foil effect was permanently left on the card image, both the foil and nonfoil copies were shown foil in the shop screen. (this freaked me out and I rolled back my save thinking I actually got 12 copies of foil commons - what a waste, it had a foil Mother of Runes in one of the packs. The box I bought afterwards had only crap.)

I'm removing your change in my local files, reapply my patch and rebuild the whole thing because my patch doesn't have this bug.
I suggest you fix the already committed bug as soon as the migration is complete - in whichever way you prefer.
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Foil card display fix in packs

Postby Agetian » 25 Jul 2017, 03:25

Ah, I can see why (particularly, since you're resetting the image of the card to the new one that has the foil drawn on top of it, it's then necessary to "unfoil" the next card with the same name the same way it was foiled), and actually it's very unfortunate that I can't easily limit your code only to cards that have foils since it's rather expensive to call for every single card every single time, but I think that in the long run it won't matter much on most modern hardware (while older hardware might start to lag a bit more, but I don't know, don't have any hardware like that to test on). I'll set it to the way you originally coded it for the time being, but it's important to think about how to actually limit it to the foils only.

Speaking of possible side effects because of the way it was coded, we also need to test that your code doesn't show the foil effect on foil face-down cards on the opponent's side of the battlefield during the game (e.g. if an opponent plays a foil Morph card, will it show normally in the card picture panel or will it show that it's foiled? If it's the latter, then it's a bug; if not, no worries).

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Foil card display fix in packs

Postby Seravy » 25 Jul 2017, 08:47

I believe during matches, CardPanels are used and not CardPicturePanels. Anywhere that already was able to show foil effects before this patch should be unaffected as those used a different class to display the card.

btw one of those that also has a bug : sideboarding. Foils are shown inconsistently during that, sometimes it's correct, sometimes foils don't show up, or only on some of the cards. I haven't had the time to investigate that yet.
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 64 guests


Who is online

In total there are 64 users online :: 0 registered, 0 hidden and 64 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 64 guests

Login Form