- Support using art from standard (non-variant) Magic cards in PConq mode when there is no plane art available (e.g. for the newer sets like Kaladesh).

This commit is contained in:
Agetian
2017-07-02 09:23:41 +00:00
parent 2b5d3b0511
commit 07d65014ed
2 changed files with 18 additions and 4 deletions

View File

@@ -177,9 +177,19 @@ public class ConquestPlaneSelector extends FDisplayObject {
float artWidth = monitorWidth - 2 * monitorLeftOffset + 2;
float artHeight = monitorHeight - monitorTopOffset - monitorBottomOffset + 2;
//scale up art to fill height of monitor while retain aspect ratio
//scale up art to fill height of monitor while retaining aspect ratio
float fullArtWidth = artHeight * currentArt.getWidth() / currentArt.getHeight();
g.startClip(x, y, artWidth, artHeight);
float artHeightClipMod = 0f;
if (fullArtWidth < monitorWidth) {
//if the card art is too narrow, widen it to fully cover the monitor size
float scaledArtHeight = monitorWidth * (artHeight / fullArtWidth);
fullArtWidth = monitorWidth;
artHeightClipMod = scaledArtHeight - artHeight;
artHeight = scaledArtHeight;
}
g.startClip(x, y, artWidth, artHeight - artHeightClipMod);
g.drawImage(currentArt, x + (monitorWidth - fullArtWidth) / 2, y, fullArtWidth, artHeight);
g.endClip();

View File

@@ -139,8 +139,12 @@ public class ConquestPlane {
for (String name : planeCardNames) {
PaperCard pc = variantCards.getCard(name);
if (pc == null) {
System.out.println("\"" + name + "\" does not correspond to a valid Plane card");
continue;
// try to get a non-variant Magic card in case a plane card with the given name does not exist
pc = FModel.getMagicDb().getCommonCards().getCard(name);
if (pc == null) {
System.out.println("\"" + name + "\" does not correspond to a valid Plane card or standard Magic card!");
continue;
}
}
planeCards.add(pc);
}