Merge branch 'master' into master

This commit is contained in:
CollinJ
2024-10-20 22:05:24 -07:00
committed by GitHub
193 changed files with 2771 additions and 1844 deletions

Binary file not shown.

View File

@@ -4,7 +4,7 @@
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId>
<version>1.6.66-SNAPSHOT</version>
<version>${revision}</version>
</parent>
<artifactId>forge-gui-mobile</artifactId>
@@ -17,8 +17,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
@@ -75,12 +75,12 @@
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx</artifactId>
<version>1.12.1</version>
<version>1.13.0</version>
</dependency>
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx-freetype</artifactId>
<version>1.12.1</version>
<version>1.13.0</version>
</dependency>
<dependency>
<groupId>com.github.raeleus.TenPatch</groupId>
@@ -97,7 +97,7 @@
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx-box2d</artifactId>
<version>1.12.1</version>
<version>1.13.0</version>
</dependency>
<dependency>
<groupId>com.badlogicgames.gdx</groupId>

View File

@@ -1,7 +1,11 @@
package forge;
import com.badlogic.gdx.*;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.controllers.Controller;
import com.badlogic.gdx.controllers.ControllerAdapter;
import com.badlogic.gdx.controllers.ControllerListener;
@@ -50,7 +54,7 @@ import java.nio.file.Paths;
import java.util.*;
public class Forge implements ApplicationListener {
public static final String CURRENT_VERSION = "1.6.66-SNAPSHOT";
public static String CURRENT_VERSION = "0.0";
private static ApplicationListener app = null;
static Scene currentScene = null;
@@ -88,6 +92,7 @@ public class Forge implements ApplicationListener {
private static boolean destroyThis = false;
public static String extrawide = "default";
public static float heigtModifier = 0.0f;
public static float deltaTime = 0f;
private static boolean isloadingaMatch = false;
public static boolean autoAIDeckSelection = false;
public static boolean showFPS = false;
@@ -122,20 +127,23 @@ public class Forge implements ApplicationListener {
public static boolean createNewAdventureMap = false;
private static Localizer localizer;
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean value, boolean androidOrientation, int totalRAM, boolean isTablet, int AndroidAPI, String AndroidRelease, String deviceName) {
app = new Forge();
if (GuiBase.getInterface() == null) {
clipboard = clipboard0;
deviceAdapter = deviceAdapter0;
GuiBase.setUsingAppDirectory(assetDir0.contains("forge.app")); //obb directory on android uses the package name as entrypoint
GuiBase.setInterface(new GuiMobile(assetDir0));
GuiBase.enablePropertyConfig(value);
isPortraitMode = androidOrientation;
totalDeviceRAM = totalRAM;
isTabletDevice = isTablet;
androidVersion = AndroidAPI;
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean propertyConfig, boolean androidOrientation, int totalRAM, boolean isTablet, int AndroidAPI, String AndroidRelease, String deviceName, String versionString) {
if (app == null) {
app = new Forge();
if (GuiBase.getInterface() == null) {
CURRENT_VERSION = versionString;
clipboard = clipboard0;
deviceAdapter = deviceAdapter0;
GuiBase.setUsingAppDirectory(assetDir0.contains("forge.app")); //obb directory on android uses the package name as entrypoint
GuiBase.setInterface(new GuiMobile(assetDir0));
GuiBase.enablePropertyConfig(propertyConfig);
isPortraitMode = androidOrientation;
totalDeviceRAM = totalRAM;
isTabletDevice = isTablet;
androidVersion = AndroidAPI;
}
GuiBase.setDeviceInfo(deviceName, AndroidRelease, AndroidAPI, totalRAM);
}
GuiBase.setDeviceInfo(deviceName, AndroidRelease, AndroidAPI, totalRAM);
return app;
}
@@ -154,6 +162,7 @@ public class Forge implements ApplicationListener {
public void create() {
//install our error handler
ExceptionHandler.registerErrorHandling();
getDeviceAdapter().closeSplashScreen();
GuiBase.setIsAndroid(Gdx.app.getType() == Application.ApplicationType.Android);
@@ -709,6 +718,7 @@ public class Forge implements ApplicationListener {
}
}
}
deltaTime = 0f;
}
}
});
@@ -845,6 +855,10 @@ public class Forge implements ApplicationListener {
ForgeAnimation.advanceAll();
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // Clear the screen.
//set delta for rotation
deltaTime += Gdx.graphics.getDeltaTime();
if (deltaTime > 22.5f)
deltaTime = 0f;
FContainer screen = currentScreen;

View File

@@ -320,16 +320,17 @@ public class Graphics {
fillCircle(skinColor.getColor(), x2, y2, arrowThickness);
drawLineArrow(arrowThickness, skinColor.getColor(), x1, y1, x2, y2);
fillCircle(Color.WHITE, x2, y2, arrowThickness / 2);
drawLine(arrowThickness / 3, Color.WHITE, x1, y1, x2, y2);
drawLineArrow(arrowThickness / 3, Color.WHITE, x1, y1, x2, y2);
//drawLine(arrowThickness / 3, Color.WHITE, x1, y1, x2, y2);
}
public void drawLineArrow(float thickness, Color color, float x1, float y1, float x2, float y2) {
batch.end(); //must pause batch while rendering shapes
float angle = new Vector2(x1 - x2, y1 - y2).angleRad();
/*float angle = new Vector2(x1 - x2, y1 - y2).angleRad();
float arrowHeadRotation = (float) (Math.PI * 0.8f);
Vector2 arrowCorner3 = new Vector2(x2 + (thickness / 3) * (float) Math.cos(angle + arrowHeadRotation), y2 + (thickness / 3) * (float) Math.sin(angle + arrowHeadRotation));
Vector2 arrowCorner4 = new Vector2(x2 + (thickness / 3) * (float) Math.cos(angle - arrowHeadRotation), y2 + (thickness / 3) * (float) Math.sin(angle - arrowHeadRotation));
Vector2 arrowCorner4 = new Vector2(x2 + (thickness / 3) * (float) Math.cos(angle - arrowHeadRotation), y2 + (thickness / 3) * (float) Math.sin(angle - arrowHeadRotation));*/
if (thickness > 1) {
Gdx.gl.glLineWidth(thickness);

View File

@@ -30,7 +30,8 @@ public class AssetsDownloader {
public static void checkForUpdates(final SplashScreen splashScreen) {
if (Gdx.app.getType() == ApplicationType.Desktop && SHARE_DESKTOP_ASSETS) { return; }
final boolean isSnapshots = Forge.CURRENT_VERSION.contains("SNAPSHOT");
final String versionString = Forge.getDeviceAdapter().getVersionString();
final boolean isSnapshots = versionString.contains("SNAPSHOT");
final String snapsURL = "https://downloads.cardforge.org/dailysnapshots/";
final String releaseURL = "https://releases.cardforge.org/forge/forge-gui-android/";
final String versionText = isSnapshots ? snapsURL + "version.txt" : releaseURL + "version.txt";
@@ -45,11 +46,11 @@ public class AssetsDownloader {
String version = FileUtil.readFileToString(versionUrl);
String filename = "forge-android-" + version + "-signed-aligned.apk";
String apkURL = isSnapshots ? snapsURL + filename : releaseURL + version + "/" + filename;
if (!StringUtils.isEmpty(version) && !Forge.CURRENT_VERSION.equals(version)) {
if (!StringUtils.isEmpty(version) && !versionString.equals(version)) {
splashScreen.prepareForDialogs();
message = "A new version of Forge is available (" + version + ").\n" +
"You are currently on an older version (" + Forge.CURRENT_VERSION + ").\n\n" +
"You are currently on an older version (" + versionString + ").\n\n" +
"Would you like to update to the new version now?";
if (!Forge.getDeviceAdapter().isConnectedToWifi()) {
message += " If so, you may want to connect to wifi first. The download is around 12MB.";
@@ -85,7 +86,7 @@ public class AssetsDownloader {
return;
}
}
else if (Forge.CURRENT_VERSION.equals(FileUtil.readFileToString(versionFile)) && FSkin.getSkinDir() != null) {
else if (versionString.equals(FileUtil.readFileToString(versionFile)) && FSkin.getSkinDir() != null) {
return; //if version matches what had been previously saved and FSkin isn't requesting assets download, no need to download assets
}
@@ -143,7 +144,7 @@ public class AssetsDownloader {
//allow deletion on Android 10 or if using app-specific directory
boolean allowDeletion = Forge.androidVersion < 30 || GuiBase.isUsingAppDirectory();
String assetURL = isSnapshots ? snapsURL + "assets.zip" : releaseURL + Forge.CURRENT_VERSION + "/" + "assets.zip";
String assetURL = isSnapshots ? snapsURL + "assets.zip" : releaseURL + versionString + "/" + "assets.zip";
new GuiDownloadZipService("", "resource files", assetURL,
ForgeConstants.ASSETS_DIR, ForgeConstants.RES_DIR, splashScreen.getProgressBar(), allowDeletion).downloadAndUnzip();
@@ -158,7 +159,7 @@ public class AssetsDownloader {
//save version string to file once assets finish downloading
//so they don't need to be re-downloaded until you upgrade again
FileUtil.writeFile(versionFile, Forge.CURRENT_VERSION);
FileUtil.writeFile(versionFile, versionString);
//add restart after assets update
String msg = allowDeletion ? "Resource update finished..." : "Forge misses some files for deletion.\nIf you encounter issues, try deleting the Forge/res folder and/or deleting Forge/cache/fonts folder and try to download and update the assets.";

View File

@@ -128,6 +128,17 @@ public class FSkin {
//reset hd buttons/icons
Forge.hdbuttons = false;
Forge.hdstart = false;
// TODO: the "v2" string should be a property of the default skin.
FileHandle v2File = Gdx.files.absolute(ForgeConstants.FONTS_DIR + "v2");
if (v2File == null || !v2File.exists()) {
//delete cached fonts
FSkinFont.deleteCachedFiles();
try {
v2File.file().createNewFile();
} catch (Exception e) {
e.printStackTrace();
}
}
//ensure skins directory exists
final FileHandle dir = Gdx.files.absolute(ForgeConstants.CACHE_SKINS_DIR);
@@ -164,7 +175,9 @@ public class FSkin {
//load theme logo while changing skins
Forge.getAssets().loadTexture(getSkinFile("hd_logo.png"));
Forge.getAssets().loadTexture(getDefaultSkinFile("adv_logo.png"), new TextureLoader.TextureParameter());
Forge.getAssets().loadTexture(getDefaultSkinFile("cover.png"));
Forge.getAssets().loadTexture(getDefaultSkinFile("overlay_alpha.png"));
Forge.getAssets().loadTexture(getDefaultSkinFile("spiral.png"));
Forge.getAssets().loadTexture(getDefaultSkinFile("splatter.png"));
if (splashScreen != null) {

View File

@@ -219,9 +219,10 @@ public enum FSkinImage implements FSkinImageInterface {
UNKNOWN (FSkinProp.ICO_UNKNOWN),
LOGO (FSkinProp.ICO_LOGO),
CARDART (FSkinProp.ICO_CARDART),
FLIPCARD (FSkinProp.ICO_FLIPCARD),
HDFLIPCARD (FSkinProp.ICO_HDFLIPCARD),
HDFLIPCARD (FSkinProp.ICO_HDFLIPCARD),
FAVICON (FSkinProp.ICO_FAVICON),
LOCK (FSkinProp.ICO_LOCK),
@@ -313,15 +314,15 @@ public enum FSkinImage implements FSkinImageInterface {
HDBTN_DOWN_LEFT (FSkinProp.IMG_HDBTN_DOWN_LEFT),
HDBTN_DOWN_CENTER (FSkinProp.IMG_HDBTN_DOWN_CENTER),
HDBTN_DOWN_RIGHT (FSkinProp.IMG_HDBTN_DOWN_RIGHT),
HDBTN_FOCUS_LEFT (FSkinProp.IMG_HDBTN_FOCUS_LEFT),
HDBTN_FOCUS_CENTER (FSkinProp.IMG_HDBTN_FOCUS_CENTER),
HDBTN_FOCUS_RIGHT (FSkinProp.IMG_HDBTN_FOCUS_RIGHT),
HDBTN_TOGGLE_LEFT (FSkinProp.IMG_HDBTN_TOGGLE_LEFT),
HDBTN_TOGGLE_CENTER (FSkinProp.IMG_HDBTN_TOGGLE_CENTER),
HDBTN_TOGGLE_RIGHT (FSkinProp.IMG_HDBTN_TOGGLE_RIGHT),
HDBTN_DISABLED_LEFT (FSkinProp.IMG_HDBTN_DISABLED_LEFT),
HDBTN_DISABLED_CENTER (FSkinProp.IMG_HDBTN_DISABLED_CENTER),
HDBTN_DISABLED_RIGHT (FSkinProp.IMG_HDBTN_DISABLED_RIGHT),
HDBTN_FOCUS_LEFT (FSkinProp.IMG_HDBTN_FOCUS_LEFT),
HDBTN_FOCUS_CENTER (FSkinProp.IMG_HDBTN_FOCUS_CENTER),
HDBTN_FOCUS_RIGHT (FSkinProp.IMG_HDBTN_FOCUS_RIGHT),
HDBTN_TOGGLE_LEFT (FSkinProp.IMG_HDBTN_TOGGLE_LEFT),
HDBTN_TOGGLE_CENTER (FSkinProp.IMG_HDBTN_TOGGLE_CENTER),
HDBTN_TOGGLE_RIGHT (FSkinProp.IMG_HDBTN_TOGGLE_RIGHT),
HDBTN_DISABLED_LEFT (FSkinProp.IMG_HDBTN_DISABLED_LEFT),
HDBTN_DISABLED_CENTER (FSkinProp.IMG_HDBTN_DISABLED_CENTER),
HDBTN_DISABLED_RIGHT (FSkinProp.IMG_HDBTN_DISABLED_RIGHT),
//Foils
FOIL_01 (FSkinProp.FOIL_01),

View File

@@ -156,19 +156,20 @@ public class CardImageRenderer {
}
//space for artist
textBoxHeight -= 2 * PT_FONT.getCapHeight();
PaperCard paperCard = ImageUtil.getPaperCardFromImageKey(state.getImageKey());
PaperCard paperCard = null;
try {
paperCard = ImageUtil.getPaperCardFromImageKey(state.getImageKey());
} catch (Exception e) {}
String artist = "WOTC";
if (paperCard != null && !paperCard.getArtist().isEmpty())
artist = paperCard.getArtist();
float minTextBoxHeight = 2 * headerHeight;
if (textBoxHeight < minTextBoxHeight) {
if (textBoxHeight < minTextBoxHeight) {
artHeight -= (minTextBoxHeight - textBoxHeight); //subtract from art height if text box not big enough otherwise
textBoxHeight = minTextBoxHeight;
if (artHeight < 0) {
textBoxHeight += artHeight;
artHeight = 0;
}
artHeight -= (minTextBoxHeight - textBoxHeight); //subtract from art height if text box not big enough otherwise
textBoxHeight = minTextBoxHeight;
if (artHeight < 0) {
textBoxHeight += artHeight;
artHeight = 0;
}
}
@@ -302,8 +303,8 @@ public class CardImageRenderer {
private static final FBufferedImage stretchedArt;
static {
final float logoWidth = FSkinImage.LOGO.getWidth();
final float logoHeight = FSkinImage.LOGO.getHeight();
final float logoWidth = FSkinImage.CARDART.getWidth();
final float logoHeight = FSkinImage.CARDART.getHeight();
float h = logoHeight * 1.1f;
float w = h * CardRenderer.CARD_ART_RATIO;
forgeArt = new FBufferedImage(w, h) {
@@ -311,7 +312,7 @@ public class CardImageRenderer {
protected void draw(Graphics g, float w, float h) {
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, 0, 0, w, h);
g.fillRect(FScreen.getTextureOverlayColor(), 0, 0, w, h);
g.drawImage(FSkinImage.LOGO, (w - logoWidth) / 2, (h - logoHeight) / 2, logoWidth, logoHeight);
g.drawImage(FSkinImage.CARDART, (w - logoWidth) / 2, (h - logoHeight) / 2, logoWidth, logoHeight);
}
};
stretchedArt = new FBufferedImage(w, h) {
@@ -319,20 +320,24 @@ public class CardImageRenderer {
protected void draw(Graphics g, float w, float h) {
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, 0, 0, w, h);
g.fillRect(FScreen.getTextureOverlayColor(), 0, 0, w, h);
g.drawImage(FSkinImage.LOGO, (w - logoWidth) / 2, ((h - logoHeight) / 2) + h / 3.5f, logoWidth, logoHeight / 3);
int newW = Math.round((h * (logoWidth / logoHeight)) * 1.5f);
int newH = Math.round(logoHeight / 2);
g.drawImage(FSkinImage.CARDART, (w - newW) /2, (h - newH) / 2, newW, newH);
}
};
}
private static void drawArt(CardView cv, Graphics g, float x, float y, float w, float h, boolean altState, boolean isFaceDown) {
boolean isSaga = cv.getCurrentState().getType().hasSubtype("Saga");
boolean isClass = cv.getCurrentState().getType().hasSubtype("Class") || cv.getCurrentState().getType().hasSubtype("Case");
boolean isDungeon = cv.getCurrentState().getType().isDungeon();
boolean useStretchedArt = cv.getCurrentState().getType().hasSubtype("Saga")
|| cv.getCurrentState().getType().hasSubtype("Class")
|| cv.getCurrentState().getType().hasSubtype("Case")
|| cv.getCurrentState().getType().isDungeon();
ColorSet colorSet = cv.getCurrentState().getColors();
if (altState && cv.hasAlternateState()) {
isSaga = cv.getAlternateState().getType().hasSubtype("Saga");
isClass = cv.getAlternateState().getType().hasSubtype("Class") || cv.getAlternateState().getType().hasSubtype("Case");
isDungeon = cv.getAlternateState().getType().isDungeon();
useStretchedArt = cv.getAlternateState().getType().hasSubtype("Saga")
|| cv.getAlternateState().getType().hasSubtype("Class")
|| cv.getAlternateState().getType().hasSubtype("Case")
|| cv.getAlternateState().getType().isDungeon();
colorSet = cv.getAlternateState().getColors();
}
if (cv == null) {
@@ -344,7 +349,7 @@ public class CardImageRenderer {
}
}
//fallback
if (isSaga || isClass || isDungeon) {
if (useStretchedArt) {
g.drawImage(stretchedArt, x, y, w, h);
} else {
g.drawImage(forgeArt, x, y, w, h);
@@ -359,7 +364,7 @@ public class CardImageRenderer {
|| cv.getCurrentState().getImageKey().equals(ImageKeys.getTokenKey(ImageKeys.FORETELL_IMAGE)));
if (cardArt != null) {
if (isHidden && !altState) {
if (isSaga || isClass || isDungeon) {
if (useStretchedArt) {
g.drawImage(stretchedArt, x, y, w, h);
} else {
g.drawImage(forgeArt, x, y, w, h);
@@ -391,14 +396,14 @@ public class CardImageRenderer {
}
}
} else {
if (isSaga || isClass || isDungeon) {
if (useStretchedArt) {
g.drawImage(stretchedArt, x, y, w, h);
} else {
g.drawImage(forgeArt, x, y, w, h);
}
}
} else {
if (isSaga || isClass || isDungeon) {
if (useStretchedArt) {
g.drawImage(stretchedArt, x, y, w, h);
} else {
g.drawImage(forgeArt, x, y, w, h);

View File

@@ -59,6 +59,8 @@ import forge.model.FModel;
import forge.screens.match.MatchController;
import forge.toolbox.FList;
import static forge.assets.FSkin.getDefaultSkinFile;
public class CardRenderer {
public enum CardStackPosition {
Top,
@@ -818,7 +820,7 @@ public class CardRenderer {
g.setAlphaComposite(0.6f);
}
if (onbattlefield && onTop) {
drawAbilityIcons(g, card, cx, cy, cw, cx + ((cw * 2) / 2.3f), cy, cw / 5.5f, cw / 5.7f, showAbilityIcons(card));
drawAbilityIcons(g, card, cx, cy, cw, ch, cx + ((cw * 2) / 2.3f), cy, cw / 5.5f, cw / 5.7f, showAbilityIcons(card));
} else if (canShow && !onbattlefield && showAbilityIcons(card)) {
//draw indicator for flash or can be cast at instant speed, enabled if show ability icons is enabled
String keywordKey = card.getCurrentState().getKeywordKey();
@@ -873,7 +875,7 @@ public class CardRenderer {
g.setAlphaComposite(oldAlpha);
}
public static void drawAbilityIcons(Graphics g, CardView card, float cx, float cy, float cw, float abiX, float abiY, float abiScale, float abiSpace, boolean showAbilityIcons) {
public static void drawAbilityIcons(Graphics g, CardView card, float cx, float cy, float cw, float ch, float abiX, float abiY, float abiScale, float abiSpace, boolean showAbilityIcons) {
float abiCount = 0;
//show token indicator as status
if (card.isToken()) {
@@ -882,9 +884,19 @@ public class CardRenderer {
abiCount += 1;
}
if (card.isSick()) {
CardFaceSymbols.drawSymbol("summonsick", g, abiX, abiY, cw / 4.7f, cw / 4.7f);
abiY += abiSpace + 1.7f;
abiCount += 1;
Texture spiral = Forge.getAssets().getTexture(getDefaultSkinFile("spiral.png"), false);
if (spiral != null) {
float newX = card.isTapped() ? cx + cw / 4.5f : cx;
float newY = card.isTapped() ? cy + cw / 4.75f : cy;
g.startRotateTransform(newX + cw / 2f, newY + ch / 2, -(Forge.deltaTime * 16f));
g.drawImage(spiral, newX, newY, cw, ch);
g.endTransform();
} else {
//old indicator
CardFaceSymbols.drawSymbol("summonsick", g, abiX, abiY, cw / 4.7f, cw / 4.7f);
abiY += abiSpace + 1.7f;
abiCount += 1;
}
}
if (card.isPhasedOut()) {
CardFaceSymbols.drawSymbol("phasing", g, abiX, abiY, cw / 4.7f, cw / 4.7f);

View File

@@ -38,6 +38,8 @@ import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.stream.IntStream;
import static forge.assets.FSkin.getDefaultSkinFile;
public class ImageView<T extends InventoryItem> extends ItemView<T> {
private static final float PADDING = Utils.scale(5);
private static final float PILE_SPACING_Y = 0.1f;
@@ -1101,6 +1103,8 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
TextureRegion tr = ImageCache.croppedBorderImage(dpImg);
g.drawImage(tr, x + (w - w * scale) / 2, y + (h - h * scale) / 1.5f, w * scale, h * scale);
}
//draw plastic effect overlay.
g.drawImage(Forge.getAssets().getTexture(getDefaultSkinFile("cover.png")), x + (w - w * scale) / 2, y + (h - h * scale) / 1.5f, w * scale, h * scale);
}
//fake labelname shadow
g.drawText(item.getName(), GROUP_HEADER_FONT, Color.BLACK, (x + PADDING) - 1f, (y + PADDING * 2) + 1f, w - 2 * PADDING, h - 2 * PADDING, true, Align.center, false);
@@ -1123,8 +1127,18 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
}
}
} else {
//generic box
g.drawImage(FSkin.getDeckbox().get(2), FSkin.getDeckbox().get(2), x, y - (h * 0.25f), w, h, Color.GREEN, selected);
if (itemManager.getConfig() == ItemManagerConfig.STRING_ONLY) {
//draw generic box for stringOnly config
g.drawImage(FSkin.getDeckbox().get(2), FSkin.getDeckbox().get(2), x, y - (h * 0.25f), w, h, Color.GREEN, selected);
} else {
//draw missing box display if not avail or loading...
g.drawImage(FSkin.getDeckbox().get(0), FSkin.getDeckbox().get(0), x, y, w, h, Color.GREEN, selected);
//temporary fill image
g.fillRect(Color.BLACK, x + (w - w * scale) / 2, y + (h - h * scale) / 1.5f, w * scale, h * scale);
//draw plastic effect overlay.
g.drawImage(Forge.getAssets().getTexture(getDefaultSkinFile("cover.png")), x + (w - w * scale) / 2, y + (h - h * scale) / 1.5f, w * scale, h * scale);
}
}
if (deckColor != null) {
//deck color identity

View File

@@ -63,6 +63,7 @@ public abstract class FScreen extends FContainer {
}
public void onActivate() {
Forge.startContinuousRendering();
}
public void onSwitchAway(Callback<Boolean> canSwitchCallback) {

View File

@@ -11,6 +11,7 @@ import forge.animation.ForgeAnimation;
import forge.assets.FSkin;
import forge.assets.FSkinColor;
import forge.assets.FSkinFont;
import forge.assets.FSkinImage;
import forge.assets.FSkinTexture;
import forge.toolbox.FButton;
import forge.toolbox.FContainer;
@@ -137,7 +138,7 @@ public class SplashScreen extends FContainer {
}
float hmod = Forge.isLandscapeMode() ? 1f : 1.3f;
float ymod = 2.6f;
g.drawImage(splashTexture, Forge.getScreenWidth()/2 - (w*percentage*hmod)/2 , Forge.getScreenHeight()/2 - (h*percentage*hmod)/ymod, (w*percentage)*hmod, (h*percentage)*hmod);
g.drawImage(splashTexture, Forge.getScreenWidth()/2f - (w*percentage*hmod)/2 , Forge.getScreenHeight()/2f - (h*percentage*hmod)/ymod, (w*percentage)*hmod, (h*percentage)*hmod);
y += h * 295f / 450f;
if (disclaimerFont == null) {
@@ -153,7 +154,7 @@ public class SplashScreen extends FContainer {
float pbHeight = 57f / 450f * h;
y += 78f / 450f * h;
float w2 = Forge.isLandscapeMode() ? Forge.getScreenWidth() / 2 : Forge.getScreenHeight() / 2;
float w2 = Forge.isLandscapeMode() ? Forge.getScreenWidth() / 2f : Forge.getScreenHeight() / 2f;
float h2 = 57f / 450f * (w2/2);
String version = "v. " + Forge.CURRENT_VERSION;
@@ -280,7 +281,7 @@ public class SplashScreen extends FContainer {
float xmod = Forge.getScreenHeight() > 1000 ? 1.5f : Forge.getScreenHeight() > 800 ? 1.3f : 1f;
g.drawImage(FSkin.getLogo(), getWidth() / 2 - (FSkin.getLogo().getWidth() * xmod) / 2, getHeight() / 2 - (FSkin.getLogo().getHeight() * xmod) / 1.5f, FSkin.getLogo().getWidth() * xmod, FSkin.getLogo().getHeight() * xmod);
} else {
g.drawImage(splashTexture, x, y, w, h);
g.drawImage(FSkinImage.LOGO, getWidth() / 2 - (FSkinImage.LOGO.getWidth() * 2f) / 2, getHeight() / 2 - (FSkinImage.LOGO.getHeight() * 2f) / 1.3f, FSkinImage.LOGO.getWidth() * 2f, FSkinImage.LOGO.getHeight() * 2f);
}
y += h * 295f / 450f;
float padding = 20f / 450f * w;

View File

@@ -479,7 +479,7 @@ public class MatchScreen extends FScreen {
//draw arrows for combat
final CombatView combat = game.getCombat();
for (CardView c : cardsonBattlefield) {
TargetingOverlay.assembleArrows(g, c, endpoints, combat, is4Player() || is3Player() ? playerViewSet : null);
TargetingOverlay.assembleArrows(g, c, endpoints, combat, playerViewSet);
}
} catch (Exception e) {
}