diff --git a/.github/workflows/snapshot-both-pc-android.yml b/.github/workflows/snapshot-both-pc-android.yml index 46b2cf6ceb3..6191c8045cc 100644 --- a/.github/workflows/snapshot-both-pc-android.yml +++ b/.github/workflows/snapshot-both-pc-android.yml @@ -117,6 +117,7 @@ jobs: password: ${{ secrets.FTP_PASSWORD }} local-dir: izpack/ server-dir: downloads/dailysnapshots/ + state-name: .ftp-deploy-both-sync-state.json exclude: | *.pom *.repositories diff --git a/forge-gui-android/res/values-v35/styles.xml b/forge-gui-android/res/values-v35/styles.xml new file mode 100644 index 00000000000..dde42e65871 --- /dev/null +++ b/forge-gui-android/res/values-v35/styles.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/forge-gui-android/res/values/styles.xml b/forge-gui-android/res/values/styles.xml index 90ec268463f..65ccef592b7 100644 --- a/forge-gui-android/res/values/styles.xml +++ b/forge-gui-android/res/values/styles.xml @@ -7,5 +7,15 @@ true true false + true + + \ No newline at end of file diff --git a/forge-gui-android/src/forge/app/Main.java b/forge-gui-android/src/forge/app/Main.java index ad8027f2de3..242625adc0e 100644 --- a/forge-gui-android/src/forge/app/Main.java +++ b/forge-gui-android/src/forge/app/Main.java @@ -279,8 +279,8 @@ public class Main extends AndroidApplication { row2.addView(button); row2.setGravity(Gravity.CENTER); - TL.addView(row, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT)); - TL.addView(row2, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT)); + TL.addView(row, new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); + TL.addView(row2, new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); TL.setGravity(Gravity.CENTER); TL.setOnClickListener(v -> adapter.restart()); crossfade(TL, previousView); @@ -377,9 +377,9 @@ public class Main extends AndroidApplication { buttonRow.addView(button); buttonRow.setGravity(Gravity.CENTER); - TL.addView(messageRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT)); - TL.addView(checkboxRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT)); - TL.addView(buttonRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT)); + TL.addView(messageRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); + TL.addView(checkboxRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); + TL.addView(buttonRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); TL.setGravity(Gravity.CENTER); crossfade(TL, forgeLogo); } diff --git a/forge-gui-android/src/main/AndroidManifest.xml b/forge-gui-android/src/main/AndroidManifest.xml index d7c65c78e87..d7cd2a7e9cb 100644 --- a/forge-gui-android/src/main/AndroidManifest.xml +++ b/forge-gui-android/src/main/AndroidManifest.xml @@ -58,7 +58,7 @@ android:label="@string/app_name" android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:launchMode="singleInstance" - android:theme="@android:style/Theme.NoTitleBar.Fullscreen" + android:theme="@style/NormalTheme" android:exported="false"> diff --git a/forge-gui-mobile-dev/src/forge/app/Main.java b/forge-gui-mobile-dev/src/forge/app/Main.java index a8e9c424299..8714712af23 100644 --- a/forge-gui-mobile-dev/src/forge/app/Main.java +++ b/forge-gui-mobile-dev/src/forge/app/Main.java @@ -96,6 +96,9 @@ public class Main { @Override public void closeSplashScreen() { + // FIXME: on Linux system it can't close splashscreen image or crash with SIGSEGV? How come it works on other OS? + if (OperatingSystem.isUnix() || OperatingSystem.isSolaris()) + return; //could throw exception.. try { Optional.ofNullable(SplashScreen.getSplashScreen()).ifPresent(SplashScreen::close); diff --git a/forge-gui-mobile/src/forge/Forge.java b/forge-gui-mobile/src/forge/Forge.java index 669008d9155..7dafac0f1e7 100644 --- a/forge-gui-mobile/src/forge/Forge.java +++ b/forge-gui-mobile/src/forge/Forge.java @@ -159,6 +159,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); @@ -257,8 +258,6 @@ public class Forge implements ApplicationListener { /* call preloadExtendedArt here, if we put it above we will * * get error: No OpenGL context found in the current thread. */ preloadExtendedArt(); - // should be after create method but try to close this at a later time. - getDeviceAdapter().closeSplashScreen(); }); }; //see if app or assets need updating diff --git a/forge-gui-mobile/src/forge/itemmanager/ItemManager.java b/forge-gui-mobile/src/forge/itemmanager/ItemManager.java index 566b33d7713..221411de0ae 100644 --- a/forge-gui-mobile/src/forge/itemmanager/ItemManager.java +++ b/forge-gui-mobile/src/forge/itemmanager/ItemManager.java @@ -149,16 +149,9 @@ public abstract class ItemManager extends FContainer im listView = new ItemListView<>(this, model); imageView = createImageView(model); - if (Forge.isMobileAdventureMode) { - // reversed default - views.add(imageView); - views.add(listView); - currentView = imageView; - } else { - views.add(listView); - views.add(imageView); - currentView = listView; - } + views.add(listView); + views.add(imageView); + currentView = listView; btnView.setIcon(currentView.getIcon()); //build display diff --git a/forge-gui-mobile/src/forge/itemmanager/views/ImageView.java b/forge-gui-mobile/src/forge/itemmanager/views/ImageView.java index 1c6d0d26b2d..1dc7f7bb5d2 100644 --- a/forge-gui-mobile/src/forge/itemmanager/views/ImageView.java +++ b/forge-gui-mobile/src/forge/itemmanager/views/ImageView.java @@ -36,6 +36,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TreeMap; +import java.util.stream.Collectors; import java.util.stream.IntStream; import static forge.assets.FSkin.getDefaultSkinFile; @@ -1030,7 +1031,7 @@ public class ImageView extends ItemView { private boolean selected, deckSelectMode, showRanking; private final float IMAGE_SIZE = CardRenderer.MANA_SYMBOL_SIZE; private DeckProxy deckProxy = null; - private StringBuffer colorID = new StringBuffer(); + private String colorID = null; private FImageComplex deckCover = null; private Texture dpImg = null; //private TextureRegion tr; @@ -1058,18 +1059,7 @@ public class ImageView extends ItemView { } } if (((PaperCard) item).getColorID() != null) { - for (String s : ((PaperCard) item).getColorID()) { - if ("white".equalsIgnoreCase(s)) - colorID.append("{W}"); - if ("green".equalsIgnoreCase(s)) - colorID.append("{G}"); - if ("red".equalsIgnoreCase(s)) - colorID.append("{R}"); - if ("blue".equalsIgnoreCase(s)) - colorID.append("{U}"); - if ("black".equalsIgnoreCase(s)) - colorID.append("{B}"); - } + colorID = ((PaperCard) item).getColorID().stream().map(MagicColor::toSymbol).collect(Collectors.joining()); } } } @@ -1153,8 +1143,8 @@ public class ImageView extends ItemView { } } // spire colors - if (!colorID.isEmpty()) { - textRenderer.drawText(g, colorID.toString(), FSkinFont.forHeight(w / 5), Color.WHITE, x, y + h / 4, w, h, y, h, false, Align.center, true); + if (colorID != null && !colorID.isEmpty()) { + textRenderer.drawText(g, colorID, FSkinFont.forHeight(w / 5), Color.WHITE, x, y + h / 4, w, h, y, h, false, Align.center, true); } } else if (item instanceof ConquestCommander) { CardRenderer.drawCard(g, ((ConquestCommander) item).getCard(), x, y, w, h, pos); diff --git a/forge-gui-mobile/src/forge/screens/match/views/VPlayerPanel.java b/forge-gui-mobile/src/forge/screens/match/views/VPlayerPanel.java index 108e251af07..c8e8ea99c49 100644 --- a/forge-gui-mobile/src/forge/screens/match/views/VPlayerPanel.java +++ b/forge-gui-mobile/src/forge/screens/match/views/VPlayerPanel.java @@ -615,7 +615,13 @@ public class VPlayerPanel extends FContainer { private final VDisplayArea displayArea; private InfoTab(FSkinImageInterface icon0, VDisplayArea displayArea0) { - icon = icon0; + // missing or invalid player infotab icon probably old theme or custom theme. + if (icon0 == null) { + System.err.println("Missing/Invalid VPlayerPanel icon for: " + displayArea0 + " , defaulting to blank icon. Check your theme/skin layout."); + icon = FSkinImage.BLANK; + } else { + icon = icon0; + } displayArea = displayArea0; } diff --git a/forge-gui/pom.xml b/forge-gui/pom.xml index 2feebeda020..ba97aab0114 100644 --- a/forge-gui/pom.xml +++ b/forge-gui/pom.xml @@ -44,7 +44,7 @@ com.thoughtworks.xstream xstream - 1.4.20 + 1.4.21 xmlpull @@ -55,7 +55,7 @@ io.netty netty-all - 4.1.114.Final + 4.1.115.Final compile diff --git a/forge-gui/res/cardsfolder/a/arahbo_the_first_fang.txt b/forge-gui/res/cardsfolder/a/arahbo_the_first_fang.txt index 43169a5907e..4432e8c3267 100644 --- a/forge-gui/res/cardsfolder/a/arahbo_the_first_fang.txt +++ b/forge-gui/res/cardsfolder/a/arahbo_the_first_fang.txt @@ -3,7 +3,7 @@ ManaCost:2 W Types:Legendary Creature Cat Avatar PT:2/2 S:Mode$ Continuous | Affected$ Cat.Other+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Other Cats you control get +1/+1. -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self,Cat.nonToken+Other | Execute$ TrigToken | TriggerDescription$ Whenever NICKNAME or another nontoken Cat you control enters, create a 1/1 white Cat creature token. +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self,Cat.nonToken+Other+YouCtrl | Execute$ TrigToken | TriggerDescription$ Whenever NICKNAME or another nontoken Cat you control enters, create a 1/1 white Cat creature token. SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ w_1_1_cat DeckHas:Ability$Token DeckHints:Type$Cat diff --git a/forge-gui/res/cardsfolder/c/cephalid_inkmage.txt b/forge-gui/res/cardsfolder/c/cephalid_inkmage.txt index 834f43c11cb..f5784419be2 100644 --- a/forge-gui/res/cardsfolder/c/cephalid_inkmage.txt +++ b/forge-gui/res/cardsfolder/c/cephalid_inkmage.txt @@ -4,6 +4,6 @@ Types:Creature Octopus Wizard PT:2/2 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigSurveil | TriggerDescription$ When this creature enters, surveil 3. (Look at the top three cards of your library, then put any number of them into your graveyard and the rest on top of your library in any order.) SVar:TrigSurveil:DB$ Surveil | Amount$ 3 -S:Mode$ CantBlockBy | ValidAttacker$ Card.Self | Threshold$ True | Description$ Threshold — This creature can't be blocked as long as there are seven or more cards in your graveyard. +S:Mode$ CantBlockBy | ValidAttacker$ Card.Self | Condition$ Threshold | Description$ Threshold — This creature can't be blocked as long as there are seven or more cards in your graveyard. DeckHas:Ability$Surveil|Graveyard -Oracle:When this creature enters, surveil 3. (Look at the top three cards of your library, then put any number of them into your graveyard and the rest on top of your library in any order.)\nThreshold — This creature can't be blocked as long as there are seven or more cards in your graveyard. \ No newline at end of file +Oracle:When this creature enters, surveil 3. (Look at the top three cards of your library, then put any number of them into your graveyard and the rest on top of your library in any order.)\nThreshold — This creature can't be blocked as long as there are seven or more cards in your graveyard. diff --git a/forge-gui/res/cardsfolder/r/rune_sealed_wall.txt b/forge-gui/res/cardsfolder/r/rune_sealed_wall.txt index 42f78ee11f4..a8c51611bbc 100644 --- a/forge-gui/res/cardsfolder/r/rune_sealed_wall.txt +++ b/forge-gui/res/cardsfolder/r/rune_sealed_wall.txt @@ -1,7 +1,7 @@ Name:Rune-Sealed Wall -ManaCost:1 U +ManaCost:2 U Types:Artifact Creature Wall PT:0/6 K:Defender A:AB$ Surveil | Cost$ T | Amount$ 1 | SpellDescription$ Surveil 1. (Look at the top card of your library. You may put that card into your graveyard.) -Oracle:Defender\n{T}: Surveil 1. (Look at the top card of your library. You may put that card into your graveyard.) \ No newline at end of file +Oracle:Defender\n{T}: Surveil 1. (Look at the top card of your library. You may put that card into your graveyard.) diff --git a/forge-gui/src/main/java/forge/gui/card/CardDetailUtil.java b/forge-gui/src/main/java/forge/gui/card/CardDetailUtil.java index 76cc1c0dcdc..d37fd9a31a4 100644 --- a/forge-gui/src/main/java/forge/gui/card/CardDetailUtil.java +++ b/forge-gui/src/main/java/forge/gui/card/CardDetailUtil.java @@ -129,20 +129,7 @@ public class CardDetailUtil { } public static String getCurrentColors(final CardStateView c) { - ColorSet curColors = c.getColors(); - String strCurColors = ""; - - if (curColors.hasWhite()) { strCurColors += "{W}"; } - if (curColors.hasBlue()) { strCurColors += "{U}"; } - if (curColors.hasBlack()) { strCurColors += "{B}"; } - if (curColors.hasRed()) { strCurColors += "{R}"; } - if (curColors.hasGreen()) { strCurColors += "{G}"; } - - if (strCurColors.isEmpty()) { - strCurColors = "{C}"; - } - - return strCurColors; + return c.getColors().toEnumSet().stream().map(MagicColor.Color::getSymbol).collect(Collectors.joining()); } public static DetailColors getRarityColor(final CardRarity rarity) {