mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Merge branch 'master' into svg-mana-icons-support
This commit is contained in:
commit
efee0b5328
37 changed files with 1134 additions and 193 deletions
|
|
@ -27,9 +27,7 @@
|
|||
*/
|
||||
package mage.client.deckeditor.collection.viewer;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardDimensions;
|
||||
import mage.cards.MageCard;
|
||||
import mage.cards.*;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
|
|
@ -38,9 +36,7 @@ import mage.client.MageFrame;
|
|||
import mage.client.cards.BigCard;
|
||||
import mage.client.components.HoverButton;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.NaturalOrderCardNumberComparator;
|
||||
import mage.client.util.*;
|
||||
import mage.client.util.audio.AudioManager;
|
||||
import mage.client.util.sets.ConstructedFormats;
|
||||
import mage.components.ImagePanel;
|
||||
|
|
@ -48,7 +44,6 @@ import mage.components.ImagePanelStyle;
|
|||
import mage.constants.Rarity;
|
||||
import mage.view.CardView;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mage.card.arcane.GlowText;
|
||||
import org.mage.card.arcane.ManaSymbols;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
|
@ -59,17 +54,17 @@ import java.io.FileNotFoundException;
|
|||
import java.io.InputStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import mage.client.util.CardsViewUtil;
|
||||
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.view.EmblemView;
|
||||
import mage.view.PermanentView;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import static java.lang.Math.min;
|
||||
import static org.mage.plugins.card.images.DownloadPictures.getTokenCardUrls;
|
||||
|
||||
/**
|
||||
|
|
@ -115,6 +110,7 @@ public class MageBook extends JComponent {
|
|||
|
||||
Image image = ImageHelper.loadImage(LEFT_PAGE_BUTTON_IMAGE_PATH);
|
||||
pageLeft = new HoverButton(null, image, image, image, new Rectangle(64, 64));
|
||||
//pageLeft.setBorder(BorderFactory.createLineBorder(new Color(180, 50, 0), 3, true)); //debug
|
||||
pageLeft.setBounds(0, 0, 64, 64);
|
||||
pageLeft.setVisible(false);
|
||||
pageLeft.setObserver(() -> {
|
||||
|
|
@ -146,12 +142,46 @@ public class MageBook extends JComponent {
|
|||
add(jPanelCenter, BorderLayout.CENTER);
|
||||
add(jPanelRight, BorderLayout.LINE_END);
|
||||
|
||||
cardDimensions = new CardDimensions(0.45d);
|
||||
}
|
||||
int captionHeight = Math.max(30, pageLeft.getHeight()); // caption size = next-prev images
|
||||
|
||||
private void addLeftRightPageButtons() {
|
||||
jLayeredPane.add(pageLeft, JLayeredPane.DEFAULT_LAYER, 0);
|
||||
jLayeredPane.add(pageRight, JLayeredPane.DEFAULT_LAYER, 1);
|
||||
|
||||
// Top Panel (left page + (caption / stats) + right page
|
||||
jPanelTop = new JPanel();
|
||||
jPanelTop.setLayout(new BorderLayout());
|
||||
// jPanelTop.setBorder(BorderFactory.createLineBorder(new Color(180, 50, 150), 3, true)); // debug
|
||||
jPanelTop.setPreferredSize(new Dimension(captionHeight, captionHeight));
|
||||
jPanelCenter.add(jPanelTop, BorderLayout.NORTH);
|
||||
|
||||
// page left
|
||||
pageRight.setPreferredSize(new Dimension(pageRight.getWidth(), pageRight.getHeight()));
|
||||
jPanelTop.add(pageRight, BorderLayout.EAST);
|
||||
// page right
|
||||
pageLeft.setPreferredSize(new Dimension(pageLeft.getWidth(), pageLeft.getHeight()));
|
||||
jPanelTop.add(pageLeft, BorderLayout.WEST);
|
||||
|
||||
// Caption Panel
|
||||
jPanelCaption = new JPanel();
|
||||
jPanelCaption.setLayout(new BorderLayout());
|
||||
jPanelCaption.setOpaque(false);
|
||||
jPanelTop.add(jPanelCaption, BorderLayout.CENTER);
|
||||
|
||||
// set's caption
|
||||
setCaption = new JLabel();
|
||||
setCaption.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
//setCaption.setBorder(BorderFactory.createLineBorder(new Color(180, 50, 150), 3, true)); // debug
|
||||
setCaption.setFont(jLayeredPane.getFont().deriveFont(25f));
|
||||
setCaption.setText("EMPTY CAPTION");
|
||||
jPanelCaption.add(setCaption, BorderLayout.NORTH);
|
||||
|
||||
// set's info
|
||||
setInfo = new JLabel();
|
||||
setInfo.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
//setCaption.setBorder(BorderFactory.createLineBorder(new Color(180, 50, 150), 3, true)); // debug
|
||||
setInfo.setFont(jLayeredPane.getFont().deriveFont(17f));
|
||||
setInfo.setText("EMPTY STATS");
|
||||
jPanelCaption.add(setInfo, BorderLayout.SOUTH);
|
||||
|
||||
cardDimensions = new CardDimensions(0.45d);
|
||||
}
|
||||
|
||||
private void addSetTabs() {
|
||||
|
|
@ -174,7 +204,7 @@ public class MageBook extends JComponent {
|
|||
if (setImage != null) {
|
||||
tab.setOverlayImage(setImage);
|
||||
} else {
|
||||
System.out.println("Couldn't find: " + "/plugins/images/sets/" + set + "-C.jpg");
|
||||
System.out.println("Couldn't find symbol image: " + "/plugins/images/sets/" + set + "-C.jpg");
|
||||
}
|
||||
tab.setSet(set);
|
||||
tab.setBounds(0, y, 39, 120);
|
||||
|
|
@ -217,8 +247,10 @@ public class MageBook extends JComponent {
|
|||
private void showCardsOrTokens() {
|
||||
stateChanged = false;
|
||||
if (showCardsOrTokens) {
|
||||
updateCardStats(currentSet, true);
|
||||
showCards();
|
||||
} else {
|
||||
updateCardStats(currentSet, false);
|
||||
int numTokens = showTokens();
|
||||
showEmblems(numTokens);
|
||||
}
|
||||
|
|
@ -226,14 +258,16 @@ public class MageBook extends JComponent {
|
|||
|
||||
public void showCards() {
|
||||
jLayeredPane.removeAll();
|
||||
addLeftRightPageButtons();
|
||||
|
||||
// stats info
|
||||
updateCardStats(currentSet, true);
|
||||
|
||||
List<CardInfo> cards = getCards(currentPage, currentSet);
|
||||
int size = cards.size();
|
||||
|
||||
Rectangle rectangle = new Rectangle();
|
||||
rectangle.translate(OFFSET_X, OFFSET_Y);
|
||||
for (int i = 0; i < Math.min(conf.CARDS_PER_PAGE / 2, size); i++) {
|
||||
for (int i = 0; i < min(conf.CARDS_PER_PAGE / 2, size); i++) {
|
||||
Card card = cards.get(i).getMockCard();
|
||||
addCard(new CardView(card), bigCard, null, rectangle);
|
||||
|
||||
|
|
@ -245,7 +279,7 @@ public class MageBook extends JComponent {
|
|||
- (cardDimensions.frameWidth + CardPosition.GAP_X) * conf.CARD_COLUMNS + CardPosition.GAP_X - OFFSET_X;
|
||||
|
||||
rectangle.setLocation(second_page_x, OFFSET_Y);
|
||||
for (int i = conf.CARDS_PER_PAGE / 2; i < Math.min(conf.CARDS_PER_PAGE, size); i++) {
|
||||
for (int i = conf.CARDS_PER_PAGE / 2; i < min(conf.CARDS_PER_PAGE, size); i++) {
|
||||
Card card = cards.get(i).getMockCard();
|
||||
addCard(new CardView(card), bigCard, null, rectangle);
|
||||
rectangle = CardPosition.translatePosition(i - conf.CARDS_PER_PAGE / 2, rectangle, conf);
|
||||
|
|
@ -256,7 +290,6 @@ public class MageBook extends JComponent {
|
|||
|
||||
public int showTokens() {
|
||||
jLayeredPane.removeAll();
|
||||
addLeftRightPageButtons();
|
||||
|
||||
List<Token> tokens = getTokens(currentPage, currentSet);
|
||||
int size = tokens.size();
|
||||
|
|
@ -264,7 +297,7 @@ public class MageBook extends JComponent {
|
|||
if (tokens != null && tokens.size() > 0) {
|
||||
Rectangle rectangle = new Rectangle();
|
||||
rectangle.translate(OFFSET_X, OFFSET_Y);
|
||||
for (int i = 0; i < Math.min(conf.CARDS_PER_PAGE / 2, size); i++) {
|
||||
for (int i = 0; i < min(conf.CARDS_PER_PAGE / 2, size); i++) {
|
||||
Token token = tokens.get(i);
|
||||
addToken(token, bigCard, null, rectangle);
|
||||
rectangle = CardPosition.translatePosition(i, rectangle, conf);
|
||||
|
|
@ -275,7 +308,7 @@ public class MageBook extends JComponent {
|
|||
- (cardDimensions.frameWidth + CardPosition.GAP_X) * conf.CARD_COLUMNS + CardPosition.GAP_X - OFFSET_X;
|
||||
|
||||
rectangle.setLocation(second_page_x, OFFSET_Y);
|
||||
for (int i = conf.CARDS_PER_PAGE / 2; i < Math.min(conf.CARDS_PER_PAGE, size); i++) {
|
||||
for (int i = conf.CARDS_PER_PAGE / 2; i < min(conf.CARDS_PER_PAGE, size); i++) {
|
||||
Token token = tokens.get(i);
|
||||
addToken(token, bigCard, null, rectangle);
|
||||
rectangle = CardPosition.translatePosition(i - conf.CARDS_PER_PAGE / 2, rectangle, conf);
|
||||
|
|
@ -346,12 +379,26 @@ public class MageBook extends JComponent {
|
|||
|
||||
boolean implemented = card.getRarity() != Rarity.NA;
|
||||
|
||||
// implemented label
|
||||
// old code, nowadays app load only implemented cards (JayDi85, 23.11.2017)
|
||||
/*
|
||||
GlowText label = new GlowText();
|
||||
label.setGlow(implemented ? Color.green : NOT_IMPLEMENTED, 12, 0.0f);
|
||||
label.setText(implemented ? "Implemented" : "Not implemented");
|
||||
int dx = implemented ? 15 : 5;
|
||||
label.setBounds(rectangle.x + dx, rectangle.y + cardDimensions.frameHeight + 7, 110, 30);
|
||||
jLayeredPane.add(label);
|
||||
*/
|
||||
|
||||
// card number label
|
||||
JLabel cardNumber = new JLabel();
|
||||
int dy = -5; // image panel have empty space in bottom (bug?), need to move label up
|
||||
cardNumber.setBounds(rectangle.x, rectangle.y + cardImg.getHeight() + dy, cardDimensions.frameWidth, 20);
|
||||
cardNumber.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
//cardNumber.setBorder(BorderFactory.createLineBorder(new Color(180, 50, 150), 3, true));
|
||||
cardNumber.setFont(jLayeredPane.getFont().deriveFont(jLayeredPane.getFont().getStyle() | Font.BOLD));
|
||||
cardNumber.setText(card.getCardNumber());
|
||||
jLayeredPane.add(cardNumber);
|
||||
}
|
||||
|
||||
private void addToken(Token token, BigCard bigCard, UUID gameId, Rectangle rectangle) {
|
||||
|
|
@ -389,6 +436,60 @@ public class MageBook extends JComponent {
|
|||
return cards.subList(start, end);
|
||||
}
|
||||
|
||||
private void updateCardStats(String setCode, boolean isCardsShow){
|
||||
// sets do not have total cards number, it's a workaround
|
||||
|
||||
ExpansionSet set = Sets.findSet(setCode);
|
||||
if (set != null){
|
||||
setCaption.setText(set.getCode() + " - " + set.getName());
|
||||
}else{
|
||||
setCaption.setText("ERROR");
|
||||
setInfo.setText("ERROR");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isCardsShow){
|
||||
// tokens or emblems, stats not need
|
||||
setInfo.setText("");
|
||||
return;
|
||||
}
|
||||
|
||||
// cards stats
|
||||
|
||||
int startNumber = 9999;
|
||||
int endNumber = 0;
|
||||
|
||||
List<ExpansionSet.SetCardInfo> cards = set.getSetCardInfo();
|
||||
|
||||
// first run for numbers list
|
||||
LinkedList<Integer> haveNumbers = new LinkedList<>();
|
||||
for (ExpansionSet.SetCardInfo card: cards){
|
||||
int cardNumber = Integer.parseInt(card.getCardNumber());
|
||||
startNumber = min(startNumber, cardNumber);
|
||||
endNumber = Math.max(endNumber, cardNumber);
|
||||
haveNumbers.add(cardNumber);
|
||||
}
|
||||
|
||||
// second run for empty numbers
|
||||
int countHave = haveNumbers.size();
|
||||
int countNotHave = 0;
|
||||
if (cards.size() > 0){
|
||||
for(int i = startNumber; i <= endNumber; i++){
|
||||
if(!haveNumbers.contains(i)){
|
||||
countNotHave++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// result
|
||||
setInfo.setText(String.format("Have %d cards of %d", countHave, countHave + countNotHave));
|
||||
if (countNotHave > 0) {
|
||||
setInfo.setForeground(new Color(150, 0, 0));
|
||||
}else{
|
||||
setInfo.setForeground(jLayeredPane.getForeground());
|
||||
}
|
||||
}
|
||||
|
||||
private List<Token> getTokens(int page, String set) {
|
||||
ArrayList<CardDownloadData> allTokens = getTokenCardUrls();
|
||||
ArrayList<Token> tokens = new ArrayList<>();
|
||||
|
|
@ -576,7 +677,6 @@ public class MageBook extends JComponent {
|
|||
setSize(conf.WIDTH, conf.HEIGHT);
|
||||
setPreferredSize(new Dimension(conf.WIDTH, conf.HEIGHT));
|
||||
setMinimumSize(new Dimension(conf.WIDTH, conf.HEIGHT));
|
||||
pageRight.setBounds(conf.WIDTH - 2 * LEFT_RIGHT_PAGES_WIDTH - 64, 0, 64, 64);
|
||||
addSetTabs();
|
||||
showCards();
|
||||
}
|
||||
|
|
@ -616,7 +716,7 @@ public class MageBook extends JComponent {
|
|||
|
||||
_3x3Configuration() {
|
||||
this.WIDTH = 950;
|
||||
this.HEIGHT = 650;
|
||||
this.HEIGHT = 650 + 50; // + for caption
|
||||
CARD_ROWS = 3;
|
||||
CARD_COLUMNS = 3;
|
||||
this.CARDS_PER_PAGE = 18;
|
||||
|
|
@ -629,7 +729,7 @@ public class MageBook extends JComponent {
|
|||
|
||||
_4x4Configuration() {
|
||||
this.WIDTH = 1250;
|
||||
this.HEIGHT = 850;
|
||||
this.HEIGHT = 850 + 50; // + for caption
|
||||
CARD_ROWS = 4;
|
||||
CARD_COLUMNS = 4;
|
||||
this.CARDS_PER_PAGE = 32;
|
||||
|
|
@ -638,6 +738,10 @@ public class MageBook extends JComponent {
|
|||
}
|
||||
}
|
||||
|
||||
private JPanel jPanelTop;
|
||||
private JPanel jPanelCaption;
|
||||
private JLabel setCaption;
|
||||
private JLabel setInfo;
|
||||
private JPanel jPanelLeft;
|
||||
private ImagePanel jPanelCenter;
|
||||
private JPanel jPanelRight;
|
||||
|
|
@ -648,6 +752,8 @@ public class MageBook extends JComponent {
|
|||
|
||||
private int currentPage = 0;
|
||||
private String currentSet = "RTR";
|
||||
private int currentCardsInSet = 0;
|
||||
private int currentCardsNotInSet = 0;
|
||||
|
||||
private static CardDimensions cardDimensions = new CardDimensions(1.2d);
|
||||
private static final Logger log = Logger.getLogger(MageBook.class);
|
||||
|
|
|
|||
|
|
@ -560,7 +560,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
formatFilterList.add(RowFilter.regexFilter("^Constructed - Vintage", TableTableModel.COLUMN_DECK_TYPE));
|
||||
}
|
||||
if (btnFormatCommander.isSelected()) {
|
||||
formatFilterList.add(RowFilter.regexFilter("^Commander|^Duel Commander|^Penny Dreadful Commander", TableTableModel.COLUMN_DECK_TYPE));
|
||||
formatFilterList.add(RowFilter.regexFilter("^Commander|^Duel Commander|^Penny Dreadful Commander|^Freeform Commander", TableTableModel.COLUMN_DECK_TYPE));
|
||||
}
|
||||
if (btnFormatTinyLeader.isSelected()) {
|
||||
formatFilterList.add(RowFilter.regexFilter("^Tiny", TableTableModel.COLUMN_DECK_TYPE));
|
||||
|
|
|
|||
|
|
@ -327,6 +327,10 @@ public abstract class CardRenderer {
|
|||
= faceArtImage.getSubimage(
|
||||
(int) (artRect.getX() * fullCardImgWidth), (int) (artRect.getY() * fullCardImgHeight),
|
||||
(int) artWidth, (int) artHeight);*/
|
||||
RenderingHints rh = new RenderingHints(
|
||||
RenderingHints.KEY_INTERPOLATION,
|
||||
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
|
||||
g.setRenderingHints(rh);
|
||||
g.drawImage(faceArtImage,
|
||||
x, y,
|
||||
(int) targetWidth, (int) targetHeight,
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ import java.util.regex.Pattern;
|
|||
|
||||
/**
|
||||
* @author stravant@gmail.com
|
||||
* <p>
|
||||
* Various static utilities for use in the card renderer
|
||||
* <p>
|
||||
* Various static utilities for use in the card renderer
|
||||
*/
|
||||
public final class CardRendererUtils {
|
||||
|
||||
|
|
@ -51,6 +51,38 @@ public final class CardRendererUtils {
|
|||
// Return the buffered image
|
||||
return bimage;
|
||||
}
|
||||
|
||||
private static Color abitbrighter(Color c) {
|
||||
int r = c.getRed();
|
||||
int g = c.getGreen();
|
||||
int b = c.getBlue();
|
||||
int alpha = c.getAlpha();
|
||||
|
||||
int plus_r = (int) ((255 - r) / 2);
|
||||
int plus_g = (int) ((255 - g) / 2);
|
||||
int plus_b = (int) ((255 - b) / 2);
|
||||
|
||||
return new Color(r + plus_r,
|
||||
g + plus_g,
|
||||
b + plus_b,
|
||||
alpha);
|
||||
}
|
||||
|
||||
private static Color abitdarker(Color c) {
|
||||
int r = c.getRed();
|
||||
int g = c.getGreen();
|
||||
int b = c.getBlue();
|
||||
int alpha = c.getAlpha();
|
||||
|
||||
int plus_r = (int) (Math.min (255 - r, r) / 2);
|
||||
int plus_g = (int) (Math.min (255 - g, g) / 2);
|
||||
int plus_b = (int) (Math.min (255 - b, b) / 2);
|
||||
|
||||
return new Color(r - plus_r,
|
||||
g - plus_g,
|
||||
b - plus_b,
|
||||
alpha);
|
||||
}
|
||||
|
||||
// Draw a rounded box with a 2-pixel border
|
||||
// Used on various card parts.
|
||||
|
|
@ -68,6 +100,12 @@ public final class CardRendererUtils {
|
|||
g.fillOval(x + 2, y + 2, bevel * 2 - 4, h - 4);
|
||||
g.fillOval(x + 2 + w - bevel * 2, y + 2, bevel * 2 - 4, h - 4);
|
||||
g.fillRect(x + bevel, y + 2, w - 2 * bevel, h - 4);
|
||||
g.setPaint(fill);
|
||||
g.setColor(abitbrighter(g.getColor()));
|
||||
g.drawLine(x + 1 + bevel, y + 1, x + 1 + bevel + w - 2 * bevel - 2, y + 1);
|
||||
g.setPaint(fill);
|
||||
g.setColor(abitdarker(g.getColor()));
|
||||
g.drawLine(x + 1 + bevel, y + h - 2, x + 1 + bevel + w - 2 * bevel - 2, y + h - 2);
|
||||
}
|
||||
|
||||
// Get the width of a mana cost rendered with ManaSymbols.draw
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class ModernCardRenderer extends CardRenderer {
|
|||
public static final Color BORDER_RED = new Color(201, 71, 58);
|
||||
public static final Color BORDER_GREEN = new Color(4, 136, 69);
|
||||
public static final Color BORDER_GOLD = new Color(255, 228, 124);
|
||||
public static final Color BORDER_COLORLESS = new Color(238, 242, 242);
|
||||
public static final Color BORDER_COLORLESS = new Color(208, 212, 212);
|
||||
public static final Color BORDER_LAND = new Color(190, 173, 115);
|
||||
|
||||
public static final Color BOX_WHITE = new Color(244, 245, 239);
|
||||
|
|
@ -115,7 +115,7 @@ public class ModernCardRenderer extends CardRenderer {
|
|||
public static final Color BOX_RED = new Color(246, 208, 185);
|
||||
public static final Color BOX_GREEN = new Color(205, 221, 213);
|
||||
public static final Color BOX_GOLD = new Color(223, 195, 136);
|
||||
public static final Color BOX_COLORLESS = new Color(220, 228, 232);
|
||||
public static final Color BOX_COLORLESS = new Color(200, 208, 212);
|
||||
public static final Color BOX_LAND = new Color(220, 215, 213);
|
||||
public static final Color BOX_INVENTION = new Color(209, 97, 33);
|
||||
public static final Color BOX_VEHICLE = new Color(155, 105, 60);
|
||||
|
|
@ -128,21 +128,21 @@ public class ModernCardRenderer extends CardRenderer {
|
|||
public static final Color BOX_GOLD_NIGHT = new Color(171, 134, 70);
|
||||
public static final Color BOX_COLORLESS_NIGHT = new Color(118, 147, 158);
|
||||
|
||||
public static final Color LAND_TEXTBOX_WHITE = new Color(248, 232, 188, 244);
|
||||
public static final Color LAND_TEXTBOX_BLUE = new Color(189, 212, 236, 244);
|
||||
public static final Color LAND_TEXTBOX_BLACK = new Color(174, 164, 162, 244);
|
||||
public static final Color LAND_TEXTBOX_RED = new Color(242, 168, 133, 244);
|
||||
public static final Color LAND_TEXTBOX_GREEN = new Color(198, 220, 198, 244);
|
||||
public static final Color LAND_TEXTBOX_GOLD = new Color(236, 229, 207, 244);
|
||||
public static final Color LAND_TEXTBOX_WHITE = new Color(248, 232, 188, 234);
|
||||
public static final Color LAND_TEXTBOX_BLUE = new Color(189, 212, 236, 234);
|
||||
public static final Color LAND_TEXTBOX_BLACK = new Color(174, 164, 162, 234);
|
||||
public static final Color LAND_TEXTBOX_RED = new Color(242, 168, 133, 234);
|
||||
public static final Color LAND_TEXTBOX_GREEN = new Color(198, 220, 198, 234);
|
||||
public static final Color LAND_TEXTBOX_GOLD = new Color(236, 229, 207, 234);
|
||||
|
||||
public static final Color TEXTBOX_WHITE = new Color(252, 249, 244, 244);
|
||||
public static final Color TEXTBOX_BLUE = new Color(229, 238, 247, 244);
|
||||
public static final Color TEXTBOX_BLACK = new Color(241, 241, 240, 244);
|
||||
public static final Color TEXTBOX_RED = new Color(243, 224, 217, 244);
|
||||
public static final Color TEXTBOX_GREEN = new Color(217, 232, 223, 244);
|
||||
public static final Color TEXTBOX_GOLD = new Color(240, 234, 209, 244);
|
||||
public static final Color TEXTBOX_COLORLESS = new Color(219, 229, 233, 244);
|
||||
public static final Color TEXTBOX_LAND = new Color(218, 214, 212, 244);
|
||||
public static final Color TEXTBOX_WHITE = new Color(252, 249, 244, 234);
|
||||
public static final Color TEXTBOX_BLUE = new Color(229, 238, 247, 234);
|
||||
public static final Color TEXTBOX_BLACK = new Color(241, 241, 240, 234);
|
||||
public static final Color TEXTBOX_RED = new Color(243, 224, 217, 234);
|
||||
public static final Color TEXTBOX_GREEN = new Color(217, 232, 223, 234);
|
||||
public static final Color TEXTBOX_GOLD = new Color(240, 234, 209, 234);
|
||||
public static final Color TEXTBOX_COLORLESS = new Color(199, 209, 213, 234);
|
||||
public static final Color TEXTBOX_LAND = new Color(218, 214, 212, 234);
|
||||
|
||||
public static final Color ERROR_COLOR = new Color(255, 0, 255);
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ public final class ImageCache {
|
|||
if (exists) {
|
||||
LOGGER.debug("loading thumbnail for " + key + ", path=" + thumbnailPath);
|
||||
BufferedImage thumbnailImage = loadImage(thumbnailFile);
|
||||
|
||||
if (thumbnailImage == null) { // thumbnail exists but broken for some reason
|
||||
LOGGER.warn("failed loading thumbnail for " + key + ", path=" + thumbnailPath
|
||||
+ ", thumbnail file is probably broken, attempting to recreate it...");
|
||||
|
|
@ -361,6 +360,23 @@ public final class ImageCache {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isFaceImagePresent(CardView card) {
|
||||
String path;
|
||||
path = CardImageUtils.generateFaceImagePath(card.getName(), card.getExpansionSetCode());
|
||||
|
||||
if (path == null) {
|
||||
return false;
|
||||
}
|
||||
TFile file = getTFile(path);
|
||||
if (file == null) {
|
||||
return false;
|
||||
}
|
||||
if (file.exists()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static BufferedImage getThumbnail(CardView card) {
|
||||
return getImage(getKey(card, card.getName(), "#thumb"));
|
||||
}
|
||||
|
|
@ -464,7 +480,6 @@ public final class ImageCache {
|
|||
// return alternateName + "#" + card.getExpansionSetCode() + "#" +card.getType()+ "#" + card.getCardNumber() + "#"
|
||||
// + (card.getTokenSetCode() == null ? "":card.getTokenSetCode());
|
||||
// }
|
||||
|
||||
/**
|
||||
* Load image from file
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue