forked from External/mage
Merge remote-tracking branch 'origin/master' into decouple-client
Conflicts: Mage/src/mage/cards/repository/CardRepository.java
This commit is contained in:
commit
1fccbd6b87
339 changed files with 17278 additions and 1002 deletions
|
|
@ -154,12 +154,15 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane {
|
|||
} else if (CardUtil.isPlaneswalker(card)) {
|
||||
pt = card.getLoyalty().toString();
|
||||
}
|
||||
if (pt.length() > 0) {
|
||||
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%' valign='bottom'><tr><td>");
|
||||
buffer.append("<b>");
|
||||
buffer.append(pt);
|
||||
buffer.append("</b>");
|
||||
buffer.append("</td></tr></table>");
|
||||
|
||||
if (pt.length() > 0 || card.isToken()) {
|
||||
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%' valign='bottom'><tr><td><b>");
|
||||
buffer.append(pt).append("</b></td>");
|
||||
if (card.isToken()) {
|
||||
buffer.append("<td align='right'>Token</td>");
|
||||
}
|
||||
|
||||
buffer.append("</tr></table>");
|
||||
}
|
||||
|
||||
StringBuilder rule = new StringBuilder("<br/>");
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ public interface ImageManager {
|
|||
Image getSicknessImage();
|
||||
Image getDayImage();
|
||||
Image getNightImage();
|
||||
|
||||
Image getTokenIconImage();
|
||||
|
||||
Image getDlgAcceptButtonImage();
|
||||
Image getDlgActiveAcceptButtonImage();
|
||||
|
|
|
|||
|
|
@ -97,6 +97,15 @@ public class ImageManagerImpl implements ImageManager {
|
|||
return imageNight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedImage getTokenIconImage() {
|
||||
if (imageTokenIcon == null) {
|
||||
Image image = getImageFromResourceTransparent("/card/token.png", Color.WHITE, new Rectangle(20, 20));
|
||||
imageTokenIcon = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB);
|
||||
}
|
||||
return imageTokenIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getDlgCancelButtonImage() {
|
||||
if (imageDlgCancelButton == null) {
|
||||
|
|
@ -216,6 +225,8 @@ public class ImageManagerImpl implements ImageManager {
|
|||
private static BufferedImage imageDay;
|
||||
private static BufferedImage imageNight;
|
||||
|
||||
private static BufferedImage imageTokenIcon;
|
||||
|
||||
private static BufferedImage imageDlgAcceptButton;
|
||||
private static BufferedImage imageDlgActiveAcceptButton;
|
||||
private static BufferedImage imageDlgCancelButton;
|
||||
|
|
|
|||
|
|
@ -78,25 +78,12 @@ public class ThemePluginImpl implements ThemePlugin {
|
|||
background = loadbuffer_default();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if(loadimages()){
|
||||
int it = (int)Math.abs(Math.random()*(flist.getItemCount()));
|
||||
filename = BackgroundDir + flist.getItem(it);
|
||||
background = ImageIO.read(new File(filename));
|
||||
}else{
|
||||
filename = "/dragon.png";
|
||||
InputStream is = this.getClass().getResourceAsStream(filename);
|
||||
if (is == null)
|
||||
throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
background = ImageIO.read(is);
|
||||
if (background == null) {
|
||||
background = loadbuffer_default();
|
||||
}
|
||||
if (background == null){
|
||||
throw new FileNotFoundException("Couldn't find in resources.");
|
||||
}
|
||||
*/
|
||||
if (background == null) {
|
||||
throw new FileNotFoundException("Couldn't find background file in resources.");
|
||||
}
|
||||
|
||||
if (ui.containsKey("gamePanel") && ui.containsKey("jLayeredPane")) {
|
||||
ImagePanel bgPanel = new ImagePanel(background, ImagePanel.TILED);
|
||||
|
||||
|
|
@ -143,9 +130,13 @@ public class ThemePluginImpl implements ThemePlugin {
|
|||
BufferedImage res;
|
||||
String path = PreferencesDialog.getCachedValue(PreferencesDialog.
|
||||
KEY_BATTLEFIELD_IMAGE, "");
|
||||
if(path != null){
|
||||
res = ImageIO.read(new File(path));
|
||||
return res;
|
||||
if(path != null && !path.equals("")){
|
||||
try{
|
||||
res = ImageIO.read(new File(path));
|
||||
return res;
|
||||
}catch(Exception e){
|
||||
res = null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -176,23 +167,28 @@ public class ThemePluginImpl implements ThemePlugin {
|
|||
if (is == null)
|
||||
throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
background = ImageIO.read(is);
|
||||
}else if(PreferencesDialog.getCachedValue(PreferencesDialog.
|
||||
KEY_BACKGROUND_IMAGE, "") != null){
|
||||
}else{
|
||||
String path = PreferencesDialog.getCachedValue(PreferencesDialog.
|
||||
KEY_BATTLEFIELD_IMAGE, "");
|
||||
if(path != null){
|
||||
background = ImageIO.read(new File(path));
|
||||
}else{
|
||||
InputStream is = this.getClass().getResourceAsStream(filename);
|
||||
if (is == null)
|
||||
throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
background = ImageIO.read(is);
|
||||
}
|
||||
KEY_BACKGROUND_IMAGE, "");
|
||||
if(path != null && !path.equals("")){
|
||||
try{
|
||||
File f = new File(path);
|
||||
if(f != null)
|
||||
background = ImageIO.read(f);
|
||||
}catch(Exception e){
|
||||
background = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (background == null)
|
||||
if (background == null){
|
||||
InputStream is = this.getClass().getResourceAsStream(filename);
|
||||
if (is == null)
|
||||
throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
} catch (Exception e) {
|
||||
background = ImageIO.read(is);
|
||||
}
|
||||
if(background == null) throw new
|
||||
FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
}catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue