show new missing card image

master
melvin 2011-06-21 10:27:14 +08:00
parent ab9a434791
commit 7b9bc74b41
5 changed files with 18 additions and 15 deletions

View File

@ -126,4 +126,5 @@ ref/rules.txt:
flip -u $@
resources/magic/data/icons/missing_card.png:
convert -background white -size 312x445 -pointsize 30 label:'No card image found\n\nSelect\n\"Download images\"\nfrom Arena menu\n\nOR\n\nSwitch to text mode\nusing the Enter key' $@
convert -background gray -bordercolor black -border 5x5 -size 302x435 \
-pointsize 30 label:'\nNo card image found\n\nSelect\n\"Download images\"\nfrom Arena menu\n\nOR\n\nSwitch to text mode\nusing the Enter key' $@

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -64,7 +64,7 @@ public class HighQualityCardImagesProvider implements CardImagesProvider {
final boolean high) {
if (cardDefinition == null) {
return IconImages.MISSING;
return IconImages.MISSING_CARD;
}
final String filename=getFilename(cardDefinition,index);
@ -85,7 +85,7 @@ public class HighQualityCardImagesProvider implements CardImagesProvider {
image=loadCardImage(filename);
BufferedImage lowImage;
if (image==IconImages.MISSING) {
if (image==IconImages.MISSING_CARD) {
lowImage=image;
} else {
final Image scaledImage=image.getScaledInstance(

View File

@ -113,7 +113,7 @@ public class DefaultResolutionProfile implements ResolutionProfile {
new Rectangle(x,y,IMAGE_VIEWER_WIDTH,IMAGE_VIEWER_HEIGHT));
result.setBoundary(ResolutionProfileType.GameImageStackViewer,
new Rectangle(x,y,PLAYER_VIEWER_WIDTH,cardHeight-BUTTON_Y_SPACING-BUTTON_SIZE));
y+=(cardHeight-CARD_VIEWER_HEIGHT)/2;
//y+=(cardHeight-CARD_VIEWER_HEIGHT)/2;
//card viewer
result.setBoundary(ResolutionProfileType.GameCardViewer,

View File

@ -8,6 +8,7 @@ import javax.swing.JPanel;
import magic.data.CardImagesProvider;
import magic.data.GeneralConfig;
import magic.data.HighQualityCardImagesProvider;
import magic.data.IconImages;
import magic.model.MagicCardDefinition;
import magic.ui.DelayedViewer;
import magic.ui.theme.Theme;
@ -61,14 +62,15 @@ public class CardViewer extends JPanel implements DelayedViewer {
if (!opaque) {
opacity=((float)ThemeFactory.getInstance().getCurrentTheme().getValue(Theme.VALUE_POPUP_OPACITY))/100.0f;
}
final BufferedImage sourceImage=HighQualityCardImagesProvider.getInstance().getImage(cardDefinition,index,true);
final int imageWidth=sourceImage.getWidth(this);
final int imageHeight=sourceImage.getHeight(this);
cardImage=new BufferedImage(imageWidth,imageHeight,BufferedImage.TYPE_INT_ARGB);
cardImage.getGraphics().drawImage(sourceImage,0,0,null);
cardPanel.setOpacity(opacity);
setSize(imageWidth,imageHeight);
revalidate();
final BufferedImage sourceImage =
HighQualityCardImagesProvider.getInstance().getImage(cardDefinition,index,true);
final int imageWidth=sourceImage.getWidth(this);
final int imageHeight=sourceImage.getHeight(this);
cardImage=new BufferedImage(imageWidth,imageHeight,BufferedImage.TYPE_INT_ARGB);
cardImage.getGraphics().drawImage(sourceImage,0,0,null);
cardPanel.setOpacity(opacity);
setSize(imageWidth,imageHeight);
revalidate();
} else {
cardImage=HighQualityCardImagesProvider.getInstance().getImage(cardDefinition,index,false);
if (image) {
@ -77,9 +79,9 @@ public class CardViewer extends JPanel implements DelayedViewer {
}
}
cardPanel.setOpacity(opacity);
cardPanel.setImage(cardImage);
repaint();
cardPanel.setOpacity(opacity);
cardPanel.setImage(cardImage);
repaint();
}
}