Merge branch 'master' into AI_ATTACK_TIMEOUT

This commit is contained in:
kevlahnota
2024-11-19 05:49:27 +08:00
committed by GitHub
15 changed files with 52 additions and 55 deletions

View File

@@ -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

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="NormalTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen">
<item name="android:windowNoTitle">true</item>
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
<item name="android:navigationBarColor">#131313</item>
</style>
</resources>

View File

@@ -7,5 +7,15 @@
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
</style>
<style name="NormalTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen">
<item name="android:windowNoTitle">true</item>
<!-- windowOptOutEdgeToEdgeEnforcement -> Flag indicating whether this window would opt-out the
edge-to-edge enforcement. If this is false, the edge-to-edge enforcement will be applied to the window if it
belongs to an app targeting Android 15 and above. If this is true, the edge-to-edge enforcement
won't be applied. However, this attribute will be deprecated and disabled in a future SDK level. -->
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
<item name="android:navigationBarColor">#131313</item>
</style>
</resources>

View File

@@ -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);
}

View File

@@ -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">
</activity>
<meta-data android:name="io.sentry.dsn" android:value="https://a0b8dbad9b8a49cfa51bf65d462e8dae:b3f27d7461224cb8836eb5c6050c666c@sentry.cardforge.org/2?buffer.enabled=false" />

View File

@@ -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);

View File

@@ -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

View File

@@ -149,16 +149,9 @@ public abstract class ItemManager<T extends InventoryItem> 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;
}
btnView.setIcon(currentView.getIcon());
//build display

View File

@@ -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<T extends InventoryItem> extends ItemView<T> {
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<T extends InventoryItem> extends ItemView<T> {
}
}
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<T extends InventoryItem> extends ItemView<T> {
}
}
// 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);

View File

@@ -615,7 +615,13 @@ public class VPlayerPanel extends FContainer {
private final VDisplayArea displayArea;
private InfoTab(FSkinImageInterface icon0, VDisplayArea displayArea0) {
// 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;
}

View File

@@ -44,7 +44,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.20</version>
<version>1.4.21</version>
<exclusions>
<exclusion>
<groupId>xmlpull</groupId>
@@ -55,7 +55,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.114.Final</version>
<version>4.1.115.Final</version>
<scope>compile</scope>
</dependency>
<dependency>

View File

@@ -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

View File

@@ -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.

View File

@@ -1,5 +1,5 @@
Name:Rune-Sealed Wall
ManaCost:1 U
ManaCost:2 U
Types:Artifact Creature Wall
PT:0/6
K:Defender

View File

@@ -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) {