mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- 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:
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user