mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
fix classic module crop on "art" mode
This commit is contained in:
@@ -7,6 +7,9 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import forge.ImageKeys;
|
||||||
|
import forge.localinstance.properties.ForgeConstants;
|
||||||
|
import forge.util.FileUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
@@ -195,6 +198,7 @@ public class CardRenderer {
|
|||||||
private static final Map<String, FImageComplex> cardArtCache = new HashMap<>(1024);
|
private static final Map<String, FImageComplex> cardArtCache = new HashMap<>(1024);
|
||||||
public static final float CARD_ART_RATIO = 1.302f;
|
public static final float CARD_ART_RATIO = 1.302f;
|
||||||
public static final float CARD_ART_HEIGHT_PERCENTAGE = 0.43f;
|
public static final float CARD_ART_HEIGHT_PERCENTAGE = 0.43f;
|
||||||
|
private static List<String> classicModuleCardtoCrop = FileUtil.readFile(ForgeConstants.CLASSIC_MODULE_CARD_TO_CROP_FILE);
|
||||||
|
|
||||||
public static void clearcardArtCache(){
|
public static void clearcardArtCache(){
|
||||||
cardArtCache.clear();
|
cardArtCache.clear();
|
||||||
@@ -217,6 +221,7 @@ public class CardRenderer {
|
|||||||
|
|
||||||
public static FImageComplex getCardArt(String imageKey, boolean isSplitCard, boolean isHorizontalCard, boolean isAftermathCard, boolean isSaga, boolean isClass, boolean isDungeon, boolean isFlipCard, boolean isPlanesWalker) {
|
public static FImageComplex getCardArt(String imageKey, boolean isSplitCard, boolean isHorizontalCard, boolean isAftermathCard, boolean isSaga, boolean isClass, boolean isDungeon, boolean isFlipCard, boolean isPlanesWalker) {
|
||||||
FImageComplex cardArt = cardArtCache.get(imageKey);
|
FImageComplex cardArt = cardArtCache.get(imageKey);
|
||||||
|
boolean isClassicModule = classicModuleCardtoCrop.contains(imageKey.substring(ImageKeys.CARD_PREFIX.length()).replace(".jpg","").replace(".png", ""));
|
||||||
if (cardArt == null) {
|
if (cardArt == null) {
|
||||||
Texture image = new RendererCachedCardImage(imageKey, true).getImage();
|
Texture image = new RendererCachedCardImage(imageKey, true).getImage();
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
@@ -227,7 +232,12 @@ public class CardRenderer {
|
|||||||
float x, y;
|
float x, y;
|
||||||
float w = image.getWidth();
|
float w = image.getWidth();
|
||||||
float h = image.getHeight();
|
float h = image.getHeight();
|
||||||
if (isPlanesWalker) {
|
if (isClassicModule) {
|
||||||
|
x = w * 0.09f;
|
||||||
|
y = h * 0.2f;
|
||||||
|
w -= 2f * x;
|
||||||
|
h -= 3f * y;
|
||||||
|
}else if (isPlanesWalker) {
|
||||||
x = w * 0.09f;
|
x = w * 0.09f;
|
||||||
y = h * 0.11f;
|
y = h * 0.11f;
|
||||||
w -= 2f * x;
|
w -= 2f * x;
|
||||||
|
|||||||
9
forge-gui/res/lists/classicModuleCardtoCrop.txt
Normal file
9
forge-gui/res/lists/classicModuleCardtoCrop.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Treasure Vault|AFR|2
|
||||||
|
Temple of the Dragon Queen|AFR|2
|
||||||
|
Lair of the Hydra|AFR|2
|
||||||
|
Hive of the Eye Tyrant|AFR|2
|
||||||
|
Hall of Storm Giants|AFR|2
|
||||||
|
Evolving Wilds|AFR|2
|
||||||
|
Dungeon Descent|AFR|2
|
||||||
|
Den of the Bugbear|AFR|2
|
||||||
|
Cave of the Frost Dragon|AFR|2
|
||||||
@@ -52,6 +52,7 @@ public final class ForgeConstants {
|
|||||||
public static final String NET_DECKS_OATHBREAKER_LIST_FILE = LISTS_DIR + "net-decks-oathbreaker.txt";
|
public static final String NET_DECKS_OATHBREAKER_LIST_FILE = LISTS_DIR + "net-decks-oathbreaker.txt";
|
||||||
public static final String NET_DECKS_TINYLEADERS_LIST_FILE = LISTS_DIR + "net-decks-tinyleaders.txt";
|
public static final String NET_DECKS_TINYLEADERS_LIST_FILE = LISTS_DIR + "net-decks-tinyleaders.txt";
|
||||||
public static final String BORDERLESS_CARD_LIST_FILE = LISTS_DIR + "borderlessCardList.txt";
|
public static final String BORDERLESS_CARD_LIST_FILE = LISTS_DIR + "borderlessCardList.txt";
|
||||||
|
public static final String CLASSIC_MODULE_CARD_TO_CROP_FILE = LISTS_DIR + "classicModuleCardtoCrop.txt";
|
||||||
public static final String SKINS_LIST_FILE = LISTS_DIR + "skinsList.txt";
|
public static final String SKINS_LIST_FILE = LISTS_DIR + "skinsList.txt";
|
||||||
public static final String CJK_FONTS_LIST_FILE = LISTS_DIR + "font-list.txt";
|
public static final String CJK_FONTS_LIST_FILE = LISTS_DIR + "font-list.txt";
|
||||||
public static final String NET_ARCHIVE_STANDARD_DECKS_LIST_FILE = LISTS_DIR + "net-decks-archive-standard.txt";
|
public static final String NET_ARCHIVE_STANDARD_DECKS_LIST_FILE = LISTS_DIR + "net-decks-archive-standard.txt";
|
||||||
|
|||||||
Reference in New Issue
Block a user