Patch Suggestion: White Borders for Earlier Core Sets

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