Patch Suggestion: White Borders for Earlier Core Sets
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
19 posts
• Page 1 of 2 • 1, 2
Patch Suggestion: White Borders for Earlier Core Sets
by Agetian » 18 May 2011, 18:35
Hello,
Recently I've shown interest in making a minor, yet in my opinion esthetically pleasing modification to the Forge display code - I decided to try and make sure that in case a card has a picture, the border for the card should be drawn in the correct color (white for the earlier core sets between Unlimited and 9th and some other sets that had white borders - e.g. Portal, and black for everything else). This is consistent with the way earlier sets were printed and removes the somewhat strange-looking effect of having a card with a thin white border drawn inside the thicker black frame (the effect that can be seen e.g. if you're using the HQ pics that contain a thin part of the card border). I'm suggesting the patch below which chooses whether to use white or black borders depending on the card set - it'll pick white for 2ED...9ED, POR, PTK, CHR, S99, and S00, and will pick black otherwise. Also, it'll still draw the card in all black if the card has no picture (cause white empty cards just don't work) and if the card is named "Morph" (so that all cards placed face down on the table are consistently drawn with black borders) - actually, I'm not quite positive if any of the Core set cards ever had "Morph" on them, but just to be on the safe side and to exclude this possibility in the future sets, I included the necessary check.
I gave the patch a test and it seemed to work correctly for me, picking the proper border color when necessary and not triggering the code in exceptional cases I outlined above. However, since this is the first time ever I dabble with the Forge code, and since the potential usefulness of this patch is questionable (I'm not sure if maybe I'm the only one who prefers to be so perfect about the card appearance in the game
), I decided to first post it here - if anyone is willing to give it a try as well, feel free to, and if you think this might be useful, feel free to commit to the SVN repo at will. Also, if you have any suggestions, I'm ready to listen to them - particularly:
a) Are you aware of any other sets that used white borders? I know there were some occasional ones such as Portal or Chronicles that were white-bordered, but I'm not quite positive if I know all of them.
b) Can you prove that this code doesn't break anything? It seems quite safe and non-invasive to me, but since I haven't worked with the Forge codebase before, I might actually be missing something very important.
The code for the patch follows.
It has to do with the file src.arcane.ui.CardPanel.java and I'm posting the replacement for the function protected void paintComponent (Graphics g).
I'll see if I can be of help to the Forge team in the future too. Best of luck in all your endeavors!
- Agetian
Recently I've shown interest in making a minor, yet in my opinion esthetically pleasing modification to the Forge display code - I decided to try and make sure that in case a card has a picture, the border for the card should be drawn in the correct color (white for the earlier core sets between Unlimited and 9th and some other sets that had white borders - e.g. Portal, and black for everything else). This is consistent with the way earlier sets were printed and removes the somewhat strange-looking effect of having a card with a thin white border drawn inside the thicker black frame (the effect that can be seen e.g. if you're using the HQ pics that contain a thin part of the card border). I'm suggesting the patch below which chooses whether to use white or black borders depending on the card set - it'll pick white for 2ED...9ED, POR, PTK, CHR, S99, and S00, and will pick black otherwise. Also, it'll still draw the card in all black if the card has no picture (cause white empty cards just don't work) and if the card is named "Morph" (so that all cards placed face down on the table are consistently drawn with black borders) - actually, I'm not quite positive if any of the Core set cards ever had "Morph" on them, but just to be on the safe side and to exclude this possibility in the future sets, I included the necessary check.
I gave the patch a test and it seemed to work correctly for me, picking the proper border color when necessary and not triggering the code in exceptional cases I outlined above. However, since this is the first time ever I dabble with the Forge code, and since the potential usefulness of this patch is questionable (I'm not sure if maybe I'm the only one who prefers to be so perfect about the card appearance in the game

a) Are you aware of any other sets that used white borders? I know there were some occasional ones such as Portal or Chronicles that were white-bordered, but I'm not quite positive if I know all of them.
b) Can you prove that this code doesn't break anything? It seems quite safe and non-invasive to me, but since I haven't worked with the Forge codebase before, I might actually be missing something very important.
The code for the patch follows.
It has to do with the file src.arcane.ui.CardPanel.java and I'm posting the replacement for the function protected void paintComponent (Graphics g).
- Code: Select all
protected void paintComponent (Graphics g) {
Graphics2D g2d = (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
// + Patch by Agetian - white borders for Core sets Unlimited - 9th +
int cornerSize = Math.max(4, Math.round(cardWidth * ROUNDED_CORNER_SIZE));
if (this.gameCard != null)
{
if ( (!this.gameCard.getImageFilename().equals("none")) && (!this.gameCard.getName().equals("Morph")) )
{
if ( (this.gameCard.getCurSetCode().equals("2ED")) ||
(this.gameCard.getCurSetCode().equals("3ED")) ||
(this.gameCard.getCurSetCode().equals("4ED")) ||
(this.gameCard.getCurSetCode().equals("5ED")) ||
(this.gameCard.getCurSetCode().equals("6ED")) ||
(this.gameCard.getCurSetCode().equals("7ED")) ||
(this.gameCard.getCurSetCode().equals("8ED")) ||
(this.gameCard.getCurSetCode().equals("9ED")) ||
(this.gameCard.getCurSetCode().equals("CHR")) ||
(this.gameCard.getCurSetCode().equals("POR")) ||
(this.gameCard.getCurSetCode().equals("PTK")) ||
(this.gameCard.getCurSetCode().equals("S99")) ||
(this.gameCard.getCurSetCode().equals("S00")) )
{
if (!isSelected)
{
g2d.setColor(Color.black);
int offset = tapped ? 1 : 0;
for (int i = 1, n = Math.max(1, Math.round(cardWidth * SELECTED_BORDER_SIZE)); i <= n; i++)
g2d.drawRoundRect(cardXOffset - i, cardYOffset - i + offset, cardWidth + i * 2 - 1, cardHeight + i * 2 - 1,
cornerSize, cornerSize);
}
g2d.setColor(Color.white);
}
else
{
g2d.setColor(Color.black);
}
}
}
// int cornerSize = Math.max(4, Math.round(cardWidth * ROUNDED_CORNER_SIZE)); // This line must be commented out
// - Patch by Agetian - white borders for Core sets Unlimited - 9th -
g2d.fillRoundRect(cardXOffset, cardYOffset, cardWidth, cardHeight, cornerSize, cornerSize);
if (isSelected) {
g2d.setColor(Color.green);
int offset = tapped ? 1 : 0;
for (int i = 1, n = Math.max(1, Math.round(cardWidth * SELECTED_BORDER_SIZE)); i <= n; i++)
g2d.drawRoundRect(cardXOffset - i, cardYOffset - i + offset, cardWidth + i * 2 - 1, cardHeight + i * 2 - 1,
cornerSize, cornerSize);
}
}

- Agetian
Last edited by Agetian on 19 May 2011, 05:04, edited 2 times in total.
- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by slapshot5 » 18 May 2011, 19:44
I like it. The only problem I have is the full white border on a white (hand/battlefield) or light grey (CardDetailPanel) doesn't work. Could we paint a very thin black edge right at the edge of any white bordered cards?
Then I would be in full support. I tested with a deck with lots of Revised/Legends/Arabian Nights/Alpha cards.
-slapshot5
Then I would be in full support. I tested with a deck with lots of Revised/Legends/Arabian Nights/Alpha cards.
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by Agetian » 18 May 2011, 19:46
Yep, sure thing, I'll work on that tomorrow (I'll need to research how that can be done in Java, though I have a couple ideas already.slapshot5 wrote:I like it. The only problem I have is the full white border on a white (hand/battlefield) or light grey (CardDetailPanel) doesn't work. Could we paint a very thin black edge right at the edge of any white bordered cards?
Then I would be in full support. I tested with a deck with lots of Revised/Legends/Arabian Nights/Alpha cards.
-slapshot5

- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by Agetian » 19 May 2011, 05:03
Alrighty, here's the modified version of the patch I originally suggested, with the thin black border around the white-bordered cards. This patch is a little more invasive than the previous version because I had to move the declaration of int cornerSize before the white/black border condition test because I needed that definition for the code I duplicated from below to draw the black border around the white-bordered card similar to how the green border is drawn around the card when it's selected, so the cornerSize definition below had to be commented out to avoid double declaration of the same variable. At any rate, this setup works well with themes that have a pure white background for the game table, hand, and card panel. I hope you like this version more. 
If you have any other suggestions, you're welcome to tell me. If not and if you believe this patch is useful, do you think it's OK to push it into the SVN repository as well? (I'm currently working on getting a write permission to the Forge SVN).
P.S. I'll update the code block in the first post accordingly, too.

If you have any other suggestions, you're welcome to tell me. If not and if you believe this patch is useful, do you think it's OK to push it into the SVN repository as well? (I'm currently working on getting a write permission to the Forge SVN).
P.S. I'll update the code block in the first post accordingly, too.
- Code: Select all
protected void paintComponent (Graphics g) {
Graphics2D g2d = (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
// + Patch by Agetian - white borders for Core sets Unlimited - 9th +
int cornerSize = Math.max(4, Math.round(cardWidth * ROUNDED_CORNER_SIZE));
if (this.gameCard != null)
{
if ( (!this.gameCard.getImageFilename().equals("none")) && (!this.gameCard.getName().equals("Morph")) )
{
if ( (this.gameCard.getCurSetCode().equals("2ED")) ||
(this.gameCard.getCurSetCode().equals("3ED")) ||
(this.gameCard.getCurSetCode().equals("4ED")) ||
(this.gameCard.getCurSetCode().equals("5ED")) ||
(this.gameCard.getCurSetCode().equals("6ED")) ||
(this.gameCard.getCurSetCode().equals("7ED")) ||
(this.gameCard.getCurSetCode().equals("8ED")) ||
(this.gameCard.getCurSetCode().equals("9ED")) ||
(this.gameCard.getCurSetCode().equals("CHR")) ||
(this.gameCard.getCurSetCode().equals("POR")) ||
(this.gameCard.getCurSetCode().equals("PTK")) ||
(this.gameCard.getCurSetCode().equals("S99")) ||
(this.gameCard.getCurSetCode().equals("S00")) )
{
if (!isSelected)
{
g2d.setColor(Color.black);
int offset = tapped ? 1 : 0;
for (int i = 1, n = Math.max(1, Math.round(cardWidth * SELECTED_BORDER_SIZE)); i <= n; i++)
g2d.drawRoundRect(cardXOffset - i, cardYOffset - i + offset, cardWidth + i * 2 - 1, cardHeight + i * 2 - 1,
cornerSize, cornerSize);
}
g2d.setColor(Color.white);
}
else
{
g2d.setColor(Color.black);
}
}
}
// int cornerSize = Math.max(4, Math.round(cardWidth * ROUNDED_CORNER_SIZE)); // This line must be commented out
// - Patch by Agetian - white borders for Core sets Unlimited - 9th -
g2d.fillRoundRect(cardXOffset, cardYOffset, cardWidth, cardHeight, cornerSize, cornerSize);
if (isSelected) {
g2d.setColor(Color.green);
int offset = tapped ? 1 : 0;
for (int i = 1, n = Math.max(1, Math.round(cardWidth * SELECTED_BORDER_SIZE)); i <= n; i++)
g2d.drawRoundRect(cardXOffset - i, cardYOffset - i + offset, cardWidth + i * 2 - 1, cardHeight + i * 2 - 1,
cornerSize, cornerSize);
}
}
- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by slapshot5 » 19 May 2011, 15:09
ooohhhhh. I *like* it. I'd say, go ahead and commit. Unless anyone else has objections.
I played the most when Revised/Fallen Empires was out, so this looks much more natural to me with my older decks.
-slapshot5
I played the most when Revised/Fallen Empires was out, so this looks much more natural to me with my older decks.
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by Agetian » 19 May 2011, 15:13
Hehe I'm glad to hear you like it! As soon as (and if) I get the commit permissions, I'll definitely check it in unless there are objections. I also played a lot during the "white borders" age, particularly the 4th/5th ed. era and its expansions, and the whole mixture of white- and black-bordered cards just looks heartwarming for some reason to me.slapshot5 wrote:ooohhhhh. I *like* it. I'd say, go ahead and commit. Unless anyone else has objections.
I played the most when Revised/Fallen Empires was out, so this looks much more natural to me with my older decks.
-slapshot5


- Agetian
- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by Agetian » 20 May 2011, 03:10
Umm, Denis Bergkamp didn't get back to me on my PM about the SVN write access (at least yet), maybe he's just busy with stuff at the moment or maybe he doesn't feel like giving me write access, but at any rate, it might take a while (or not work out at all) for me to get the write access - can someone please do me a favor and push the white borders patch into the SVN repo? Looks like there are no objections to it and it was tested to work well. 
- Agetian

- Agetian
- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by DennisBergkamp » 20 May 2011, 03:44
Ah, sorry. Been busy all day... anyway, you should be able to commit stuff now
As for a guide to using the SVN, I think Chris has a thread somewhere that explains things in more detail.
I recommend using Eclipse with the Subclipse plugin. Then just checkout the whole project, make your changes locally and commit the changed file(s).

As for a guide to using the SVN, I think Chris has a thread somewhere that explains things in more detail.
I recommend using Eclipse with the Subclipse plugin. Then just checkout the whole project, make your changes locally and commit the changed file(s).
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Patch Suggestion: White Borders for Earlier Core Sets
by Agetian » 20 May 2011, 03:59
Ohh awesome, thanks!DennisBergkamp wrote:Ah, sorry. Been busy all day... anyway, you should be able to commit stuff now![]()
As for a guide to using the SVN, I think Chris has a thread somewhere that explains things in more detail.
I recommend using Eclipse with the Subclipse plugin. Then just checkout the whole project, make your changes locally and commit the changed file(s).


- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by Sloth » 20 May 2011, 06:52
Nice update Agetian. People playing the quest mode will no longer be content with owning all power, they want the black border versions. More collecting experience is always good. When will we add foils?
Oh and I think you've added Portal to your list of sets, but it had black bodered cards.
Oh and I think you've added Portal to your list of sets, but it had black bodered cards.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by Agetian » 20 May 2011, 12:14
Hehe yeah, that's true.Sloth wrote:Nice update Agetian. People playing the quest mode will no longer be content with owning all power, they want the black border versions. More collecting experience is always good. When will we add foils?
Oh and I think you've added Portal to your list of sets, but it had black bodered cards.


And yep, I added Portal and Portal Three Kingdoms there because the HQ versions have white borders around them (only the second set from Portal is black-bordered) and I remember a friend of mine owned the original Portal cards and they had white borders... That's weird, were there maybe both the white-bordered and the black-bordered versions? At any rate, the CCGHQ high quality pictures for Portal and PTK are white-bordered, and the second set is black-bordered (and my patch displays them accordingly, too - they look wrong when black-bordered, as in the past - thin white border inside a thick black border :\ ) Does anyone know what's the correct solution here?

- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by Sloth » 20 May 2011, 12:42
I own quite a few portal cards (in english and german) and they are all black bordered.Agetian wrote:And yep, I added Portal and Portal Three Kingdoms there because the HQ versions have white borders around them (only the second set from Portal is black-bordered) and I remember a friend of mine owned the original Portal cards and they had white borders... That's weird, were there maybe both the white-bordered and the black-bordered versions? At any rate, the CCGHQ high quality pictures for Portal and PTK are white-bordered, and the second set is black-bordered (and my patch displays them accordingly, too - they look wrong when black-bordered, as in the past - thin white border inside a thick black border :\ ) Does anyone know what's the correct solution here?
EDIT: magiccards.info is also showing black borders: http://magiccards.info/po/en/80.html
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by Agetian » 20 May 2011, 15:20
Hmm probably I confused something big-time then, I dunno, maybe those were Starter cards and not Portal cards that my friend had that were white-bordered? Hm, it was a long time ago... Anyway, I reverted POR and PTK to black borders for now since authoritative sources, as Sloth said, point out that Portai should be a black-bordered edition.
EDIT: Updated PTK yet again, to white borders again, because magiccards.info show white borders on Portal Three Kingdoms. Portal and Portal Second Age are black-bordered (so POR and PO2 will display as black-bordered, thanks to Sloth for pointing it out!). Now that I think of it, maybe it was actually Portal Three Kingdoms that I saw white-bordered among my friend's deck collection.
EDIT: Updated PTK yet again, to white borders again, because magiccards.info show white borders on Portal Three Kingdoms. Portal and Portal Second Age are black-bordered (so POR and PO2 will display as black-bordered, thanks to Sloth for pointing it out!). Now that I think of it, maybe it was actually Portal Three Kingdoms that I saw white-bordered among my friend's deck collection.
- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Patch Suggestion: White Borders for Earlier Core Sets
by drugskill » 13 May 2012, 15:12
Horrible idea IMO. Card pictures already have borders. So it's like adding borders over borders. Looks pretty ugly. Also makes the use of a black border frame for cards that make the use of this mechanic. So it's either a white border frame over black border card picture (because I choose to use black border cards pictures), or a black border frame over an already black border card picture. But this particular black border frame makes it so there's some white showing in the corners. Pretty ugly. Trying to find a way to eliminate that mechanic, but I'm not a programmer or anything. Would be great to have the option to deactivate this horrible mandatory feature in future revisions.
If the software used the real pictures of each card's set respectively, and not only one picture for every set version of a card, I wouldn't mind. I don't like white borders cards from Core Sets 2ED to 9ED, often the card's drawing also happen to be the ugliest of all versions in those sets too, but at least it would not be horrible to look at as this border frame over pictures that already have borders thing...
If the software used the real pictures of each card's set respectively, and not only one picture for every set version of a card, I wouldn't mind. I don't like white borders cards from Core Sets 2ED to 9ED, often the card's drawing also happen to be the ugliest of all versions in those sets too, but at least it would not be horrible to look at as this border frame over pictures that already have borders thing...
Re: Patch Suggestion: White Borders for Earlier Core Sets
by friarsol » 13 May 2012, 16:51
I'm not sure what you mean, but we already have the capability to use pictures from all of the sets. You just have to download card LQ Set pics.drugskill wrote:If the software used the real pictures of each card's set respectively, and not only one picture for every set version of a card, I wouldn't mind. I don't like white borders cards from Core Sets 2ED to 9ED, often the card's drawing also happen to be the ugliest of all versions in those sets too, but at least it would not be horrible to look at as this border frame over pictures that already have borders thing...
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
19 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 21 guests