Merge branch 'master' into master

This commit is contained in:
CollinJ
2024-10-22 10:12:12 -07:00
committed by GitHub
31 changed files with 228 additions and 157 deletions

View File

@@ -89,7 +89,7 @@ jobs:
- name: Build/Install/Publish to GitHub Packages Apache Maven - name: Build/Install/Publish to GitHub Packages Apache Maven
run: | run: |
export _JAVA_OPTIONS="-Xmx2g" export _JAVA_OPTIONS="-Xmx2g"
d=$(date +%m-%d) d=$(date +%m.%d)
# Replace date in forge-gui-mobile/src/forge/Forge.java # Replace date in forge-gui-mobile/src/forge/Forge.java
# sed -i -e "s/-SNAPSHOT/-SNAPSHOT-${d}/g" forge-gui-mobile/src/forge/Forge.java # sed -i -e "s/-SNAPSHOT/-SNAPSHOT-${d}/g" forge-gui-mobile/src/forge/Forge.java
mvn -U -B -P android-release-build install -e -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=35.0.0 -Dmaven.test.skip=true mvn -U -B -P android-release-build install -e -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=35.0.0 -Dmaven.test.skip=true
@@ -105,7 +105,7 @@ jobs:
version=$(echo "$apk_file" | grep -oP 'forge-android-\K\d+\.\d+\.\d+-SNAPSHOT' | sed 's/-signed-aligned.apk//') version=$(echo "$apk_file" | grep -oP 'forge-android-\K\d+\.\d+\.\d+-SNAPSHOT' | sed 's/-signed-aligned.apk//')
echo "APK File: $apk_file" echo "APK File: $apk_file"
echo "Version: $version" echo "Version: $version"
mv *.apk "forge-android-$version-$d-signed-aligned.apk" # mv *.apk "forge-android-$version-$d-signed-aligned.apk"
echo "$version-$d" > version.txt echo "$version-$d" > version.txt
else else

View File

@@ -59,9 +59,23 @@ jobs:
# If this works just gotta figure out how to append datetime # If this works just gotta figure out how to append datetime
mv /home/runner/.m2/repository/forge/forge-installer/*/*.jar izpack/ mv /home/runner/.m2/repository/forge/forge-installer/*/*.jar izpack/
cd izpack cd izpack
out="$(basename -s .jar *)" d=$(date +%m.%d)
d=$(date +%m-%d) ls
mv "${out}.jar" "${out}-${d}.jar" # rename files
jar_file=$(find . -maxdepth 1 -type f -name '*.jar' -print -quit)
if [ -n "$jar_file" ]; then
outj="$(basename -s .jar *)"
mv "${outj}.jar" "${outj}-${d}.jar"
else
echo "No .jar files found in the specified folder."
fi
bz2_file=$(find . -maxdepth 1 -type f -name '*.bz2' -print -quit)
if [ -n "$bz2_file" ]; then
outb="$(basename -s .tar.bz2 *)"
mv "${outb}.tar.bz2" "${outb}-${d}.tar.bz2"
else
echo "No .bz2 files found in the specified folder."
fi
- name: 📂 Sync files - name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.4 uses: SamKirkland/FTP-Deploy-Action@v4.3.4

View File

@@ -1,6 +1,7 @@
package forge.ai.ability; package forge.ai.ability;
import forge.ai.AiAttackController; import forge.ai.AiAttackController;
import forge.ai.ComputerUtilCost;
import forge.ai.SpellAbilityAi; import forge.ai.SpellAbilityAi;
import forge.ai.SpellApiToAi; import forge.ai.SpellApiToAi;
import forge.game.card.Card; import forge.game.card.Card;
@@ -66,6 +67,14 @@ public class PeekAndRevealAi extends SpellAbilityAi {
return false; return false;
} }
if ("X".equals(sa.getParam("PeekAmount")) && sa.getSVar("X").equals("Count$xPaid")) {
int xPay = ComputerUtilCost.getMaxXValue(sa, aiPlayer, sa.isTrigger());
if (xPay == 0) {
return false;
}
sa.getRootAbility().setXManaCostPaid(xPay);
}
return true; return true;
} }

View File

@@ -42,7 +42,7 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
private List<ManaCostShard> shards; private List<ManaCostShard> shards;
private final int genericCost; private final int genericCost;
private boolean hasNoCost = true; // lands cost private final boolean hasNoCost; // lands cost
private String stringValue; // precalculated for toString; private String stringValue; // precalculated for toString;
private Float compareWeight = null; private Float compareWeight = null;
@@ -93,14 +93,14 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
public ManaCost(final IParserManaCost parser) { public ManaCost(final IParserManaCost parser) {
final List<ManaCostShard> shardsTemp = Lists.newArrayList(); final List<ManaCostShard> shardsTemp = Lists.newArrayList();
while (parser.hasNext()) { while (parser.hasNext()) {
this.hasNoCost = false;
final ManaCostShard shard = parser.next(); final ManaCostShard shard = parser.next();
if (shard != null && shard != ManaCostShard.GENERIC) { if (shard != null && shard != ManaCostShard.GENERIC) {
shardsTemp.add(shard); shardsTemp.add(shard);
} // null is OK - that was generic mana } // null is OK - that was generic mana
} }
this.genericCost = parser.getTotalGenericCost(); // collect generic mana int generic = parser.getTotalGenericCost(); // collect generic mana here
// here this.hasNoCost = generic == -1;
this.genericCost = generic == -1 ? 0 : generic;
sealClass(shardsTemp); sealClass(shardsTemp);
} }

View File

@@ -1,6 +1,6 @@
package forge.card.mana; package forge.card.mana;
import org.apache.commons.lang3.StringUtils; import com.google.common.primitives.Ints;
/** /**
@@ -54,7 +54,7 @@ public class ManaCostParser implements IParserManaCost {
*/ */
@Override @Override
public final boolean hasNext() { public final boolean hasNext() {
return this.nextToken < this.cost.length && !this.cost[this.nextToken].equals("-1"); return this.nextToken < this.cost.length;
} }
/* /*
@@ -65,8 +65,10 @@ public class ManaCostParser implements IParserManaCost {
@Override @Override
public final ManaCostShard next() { public final ManaCostShard next() {
final String unparsed = this.cost[this.nextToken++]; final String unparsed = this.cost[this.nextToken++];
if (StringUtils.isNumeric(unparsed)) { // consider negation sign
this.genericCost += Integer.parseInt(unparsed); Integer i = Ints.tryParse(unparsed);
if (i != null) {
this.genericCost += i;
return null; return null;
} }

View File

@@ -97,7 +97,10 @@ public class ManaCostBeingPaid {
@Override @Override
public int getTotalGenericCost() { public int getTotalGenericCost() {
ShardCount c = unpaidShards.get(ManaCostShard.GENERIC); ShardCount c = unpaidShards.get(ManaCostShard.GENERIC);
return c == null ? 0 : c.totalCount; if (c == null) {
return unpaidShards.isEmpty() ? -1 : 0;
}
return c.totalCount;
} }
} }

View File

@@ -215,7 +215,12 @@ public class Main extends ForgeAndroidApplication {
TextView text = new TextView(this); TextView text = new TextView(this);
text.setGravity(Gravity.LEFT); text.setGravity(Gravity.LEFT);
text.setTypeface(Typeface.SERIF); text.setTypeface(Typeface.SERIF);
String SP = Build.VERSION.SDK_INT > Build.VERSION_CODES.Q ? "Files & Media" : "Storage Permission"; String SP = "Storage Permission";
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
SP = "Photos and Videos, Music and Audio Permissions";
} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
SP = "Files & Media Permissions";
}
String title = "Forge needs " + SP + " to run properly...\n" + String title = "Forge needs " + SP + " to run properly...\n" +
"Follow these simple steps:\n\n"; "Follow these simple steps:\n\n";
@@ -288,7 +293,7 @@ public class Main extends ForgeAndroidApplication {
private void loadGame(final String title, final String steps, boolean isLandscape, AndroidAdapter adapter, boolean permissiongranted, int totalRAM, boolean isTabletDevice, AndroidApplicationConfiguration config, boolean exception, String msg) { private void loadGame(final String title, final String steps, boolean isLandscape, AndroidAdapter adapter, boolean permissiongranted, int totalRAM, boolean isTabletDevice, AndroidApplicationConfiguration config, boolean exception, String msg) {
try { try {
forgeLogo = findViewById(getResources().getIdentifier("logo_id", "id", getPackageName())); forgeLogo = findViewById(getResources().getIdentifier("logo_id", "id", getPackageName()));
forgeView = initializeForView(Forge.getApp(getAndroidClipboard(), adapter, ASSETS_DIR, false, !isLandscape, totalRAM, isTabletDevice, Build.VERSION.SDK_INT, Build.VERSION.RELEASE, getDeviceName(), versionString), config); forgeView = initializeForView(Forge.getApp(getAndroidClipboard(), adapter, ASSETS_DIR, false, !isLandscape, totalRAM, isTabletDevice, Build.VERSION.SDK_INT, Build.VERSION.RELEASE, getDeviceName()), config);
getAnimator(ObjectAnimator.ofFloat(forgeLogo, "alpha", 0f, 1f).setDuration(1800), null, new AnimatorListenerAdapter() { getAnimator(ObjectAnimator.ofFloat(forgeLogo, "alpha", 0f, 1f).setDuration(1800), null, new AnimatorListenerAdapter() {
@Override @Override
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
@@ -407,8 +412,14 @@ public class Main extends ForgeAndroidApplication {
int pid = android.os.Process.myPid(); int pid = android.os.Process.myPid();
int uid = android.os.Process.myUid(); int uid = android.os.Process.myUid();
try { try {
int result = getBaseContext().checkPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE, pid, uid); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
return result == PackageManager.PERMISSION_GRANTED; if (getBaseContext().checkPermission(android.Manifest.permission.READ_MEDIA_IMAGES, pid, uid) == PackageManager.PERMISSION_GRANTED)
if (getBaseContext().checkPermission(android.Manifest.permission.READ_MEDIA_AUDIO, pid, uid) == PackageManager.PERMISSION_GRANTED)
return getBaseContext().checkPermission(android.Manifest.permission.READ_MEDIA_VIDEO, pid, uid) == PackageManager.PERMISSION_GRANTED;
return false;
} else {
return getBaseContext().checkPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE, pid, uid) == PackageManager.PERMISSION_GRANTED;
}
} catch (NullPointerException e) { } catch (NullPointerException e) {
return false; return false;
} }
@@ -495,9 +506,12 @@ public class Main extends ForgeAndroidApplication {
@Override @Override
public boolean hasContents() { public boolean hasContents() {
if (cm.getPrimaryClip().getItemCount() > 0) { ClipData clipData = cm.getPrimaryClip();
if (clipData == null)
return false;
if (clipData.getItemCount() > 0) {
try { try {
return cm.getPrimaryClip().getItemAt(0).coerceToText(getContext()).length() > 0; return clipData.getItemAt(0).coerceToText(getContext()).length() > 0;
} catch (Exception ex) { } catch (Exception ex) {
return false; return false;
} }
@@ -507,9 +521,12 @@ public class Main extends ForgeAndroidApplication {
@Override @Override
public String getContents() { public String getContents() {
if (cm.getPrimaryClip().getItemCount() > 0) { ClipData clipData = cm.getPrimaryClip();
if (clipData == null)
return "";
if (clipData.getItemCount() > 0) {
try { try {
String text = cm.getPrimaryClip().getItemAt(0).coerceToText(getContext()).toString(); String text = clipData.getItemAt(0).coerceToText(getContext()).toString();
return Normalizer.normalize(text, Normalizer.Form.NFD); return Normalizer.normalize(text, Normalizer.Form.NFD);
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();

View File

@@ -5,8 +5,22 @@
<uses-sdk <uses-sdk
android:minSdkVersion="26" android:minSdkVersion="26"
android:targetSdkVersion="35" /> android:targetSdkVersion="35" />
<!-- When your app targets Android 11 or higher and it declares the MANAGE_EXTERNAL_STORAGE permission,
Android Studio shows the lint warning. This warning reminds you that the Google Play store has a policy
that limits usage of the permission. -->
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<!-- Required only if your app needs to access images or photos
that other apps created. -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<!-- Required only if your app needs to access videos
that other apps created. -->
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<!-- Required only if your app needs to access audio files
that other apps created. -->
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <!-- This one needs Android Runtime Permission for Android 6+ --> <!-- This one needs Android Runtime Permission for Android 6+ -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.VIBRATE"/>

View File

@@ -85,6 +85,9 @@
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest> </manifest>
<manifestEntries>
<Add-Opens>java.desktop/java.beans java.desktop/javax.swing.border java.desktop/javax.swing.event java.desktop/sun.swing java.desktop/java.awt.image java.desktop/java.awt.color java.desktop/sun.awt.image java.desktop/javax.swing java.desktop/java.awt java.base/java.util java.base/java.lang java.base/java.lang.reflect java.base/java.text java.desktop/java.awt.font java.base/jdk.internal.misc java.base/sun.nio.ch java.base/java.nio java.base/java.math java.base/java.util.concurrent java.base/java.net</Add-Opens>
</manifestEntries>
</archive> </archive>
</configuration> </configuration>
</plugin> </plugin>
@@ -127,9 +130,12 @@
</descriptorRefs> </descriptorRefs>
<archive> <archive>
<manifest> <manifest>
<mainClass>forge.view.Main</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest> </manifest>
<manifestEntries>
<Add-Opens>java.desktop/java.beans java.desktop/javax.swing.border java.desktop/javax.swing.event java.desktop/sun.swing java.desktop/java.awt.image java.desktop/java.awt.color java.desktop/sun.awt.image java.desktop/javax.swing java.desktop/java.awt java.base/java.util java.base/java.lang java.base/java.lang.reflect java.base/java.text java.desktop/java.awt.font java.base/jdk.internal.misc java.base/sun.nio.ch java.base/java.nio java.base/java.math java.base/java.util.concurrent java.base/java.net</Add-Opens>
<Main-Class>forge.view.Main</Main-Class>
</manifestEntries>
</archive> </archive>
</configuration> </configuration>
<executions> <executions>

View File

@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
@@ -23,17 +23,8 @@ import forge.error.ExceptionHandler;
import forge.gui.GuiBase; import forge.gui.GuiBase;
import forge.gui.card.CardReaderExperiments; import forge.gui.card.CardReaderExperiments;
import forge.util.BuildInfo; import forge.util.BuildInfo;
import forge.util.JVMOptions;
import io.sentry.Sentry; import io.sentry.Sentry;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.ArrayList;
import java.util.List;
/** /**
* Main class for Forge's swing application view. * Main class for Forge's swing application view.
*/ */
@@ -42,37 +33,6 @@ public final class Main {
* Main entry point for Forge * Main entry point for Forge
*/ */
public static void main(final String[] args) { public static void main(final String[] args) {
String javaVersion = System.getProperty("java.version");
checkJVMArgs(javaVersion, args);
}
static void checkJVMArgs(String javaVersion, String[] args) {
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
List<String> arguments = runtimeMxBean.getInputArguments();
List<Object> options = new ArrayList<>();
JButton ok = new JButton("OK");
options.add(ok);
JVMOptions.getStringBuilder().append("Java Version: ").append(javaVersion).append("\nArguments: \n");
for (String a : arguments) {
if (a.startsWith("-agent") || a.startsWith("-javaagent"))
continue;
JVMOptions.getStringBuilder().append(a).append("\n");
}
JOptionPane pane = new JOptionPane(JVMOptions.getStringBuilder(), JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, options.toArray());
JDialog dlg = pane.createDialog(JOptionPane.getRootFrame(), "Error");
ok.addActionListener(e -> {
dlg.setVisible(false);
System.exit(0);
});
dlg.setResizable(false);
if (!JVMOptions.checkRuntime(arguments)) {
dlg.setVisible(true);
} else {
start(args);
}
}
static void start(final String[] args) {
Sentry.init(options -> { Sentry.init(options -> {
options.setEnableExternalConfiguration(true); options.setEnableExternalConfiguration(true);
options.setRelease(BuildInfo.getVersionString()); options.setRelease(BuildInfo.getVersionString());
@@ -88,7 +48,7 @@ public final class Main {
//Turn off the Java 2D system's use of Direct3D to improve rendering speed (particularly when Full Screen) //Turn off the Java 2D system's use of Direct3D to improve rendering speed (particularly when Full Screen)
System.setProperty("sun.java2d.d3d", "false"); System.setProperty("sun.java2d.d3d", "false");
//Turn on OpenGl acceleration to improve performance //Turn on OpenGl acceleration to improve performance
//System.setProperty("sun.java2d.opengl", "True"); //System.setProperty("sun.java2d.opengl", "True");
@@ -110,7 +70,7 @@ public final class Main {
// command line startup here // command line startup here
String mode = args[0].toLowerCase(); String mode = args[0].toLowerCase();
switch(mode) { switch (mode) {
case "sim": case "sim":
SimulateMatch.simulate(args); SimulateMatch.simulate(args);
break; break;
@@ -130,8 +90,9 @@ public final class Main {
System.exit(0); System.exit(0);
} }
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Override @Override
protected void finalize() throws Throwable { protected void finalize() throws Throwable {
try { try {
ExceptionHandler.unregisterErrorHandling(); ExceptionHandler.unregisterErrorHandling();
@@ -141,5 +102,6 @@ public final class Main {
} }
// disallow instantiation // disallow instantiation
private Main() { } private Main() {
}
} }

View File

@@ -28,7 +28,7 @@ public class Main extends IOSApplication.Delegate {
final IOSApplicationConfiguration config = new IOSApplicationConfiguration(); final IOSApplicationConfiguration config = new IOSApplicationConfiguration();
config.useAccelerometer = false; config.useAccelerometer = false;
config.useCompass = false; config.useCompass = false;
final ApplicationListener app = Forge.getApp(new IOSClipboard(), new IOSAdapter(), assetsDir, false, false, 0, false, 0, "", "", "0.0"); final ApplicationListener app = Forge.getApp(new IOSClipboard(), new IOSAdapter(), assetsDir, false, false, 0, false, 0, "", "");
final IOSApplication iosApp = new IOSApplication(app, config); final IOSApplication iosApp = new IOSApplication(app, config);
return iosApp; return iosApp;
} }

View File

@@ -109,7 +109,7 @@
</executions> </executions>
<configuration> <configuration>
<basedir>${basedir}/${configSourceDirectory}</basedir> <basedir>${basedir}/${configSourceDirectory}</basedir>
<filesToInclude>forge-adventure.sh, forge-adventure-mac.sh, forge-adventure.command, forge-adventure.cmd</filesToInclude> <filesToInclude>forge-adventure.sh, forge-adventure.command, forge-adventure.cmd</filesToInclude>
<outputBasedir>${project.build.directory}</outputBasedir> <outputBasedir>${project.build.directory}</outputBasedir>
<outputDir>.</outputDir> <outputDir>.</outputDir>
<regex>false</regex> <regex>false</regex>
@@ -134,10 +134,11 @@
</descriptorRefs> </descriptorRefs>
<archive> <archive>
<manifest> <manifest>
<mainClass>forge.app.Main</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest> </manifest>
<manifestEntries> <manifestEntries>
<Add-Opens>java.desktop/java.beans java.desktop/javax.swing.border java.desktop/javax.swing.event java.desktop/sun.swing java.desktop/java.awt.image java.desktop/java.awt.color java.desktop/sun.awt.image java.desktop/javax.swing java.desktop/java.awt java.base/java.util java.base/java.lang java.base/java.lang.reflect java.base/java.text java.desktop/java.awt.font java.base/jdk.internal.misc java.base/sun.nio.ch java.base/java.nio java.base/java.math java.base/java.util.concurrent java.base/java.net</Add-Opens>
<Main-Class>forge.app.Main</Main-Class>
<SplashScreen-Image>splash/logo.gif</SplashScreen-Image> <SplashScreen-Image>splash/logo.gif</SplashScreen-Image>
</manifestEntries> </manifestEntries>
</archive> </archive>

View File

@@ -48,7 +48,7 @@ public class GameLauncher {
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration(); Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
config.setResizable(false); config.setResizable(false);
ApplicationListener start = Forge.getApp(new Lwjgl3Clipboard(), new Main.DesktopAdapter(switchOrientationFile),//todo get totalRAM && isTabletDevice ApplicationListener start = Forge.getApp(new Lwjgl3Clipboard(), new Main.DesktopAdapter(switchOrientationFile),//todo get totalRAM && isTabletDevice
desktopMode ? desktopModeAssetsDir : assetsDir, false, false, 0, false, 0, "", "", versionString); desktopMode ? desktopModeAssetsDir : assetsDir, false, false, 0, false, 0, "", "");
if (Config.instance().getSettingData().fullScreen) { if (Config.instance().getSettingData().fullScreen) {
config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode()); config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode());
config.setAutoIconify(true); config.setAutoIconify(true);

View File

@@ -4,7 +4,6 @@ import com.badlogic.gdx.Gdx;
import forge.interfaces.IDeviceAdapter; import forge.interfaces.IDeviceAdapter;
import forge.util.BuildInfo; import forge.util.BuildInfo;
import forge.util.FileUtil; import forge.util.FileUtil;
import forge.util.JVMOptions;
import forge.util.OperatingSystem; import forge.util.OperatingSystem;
import forge.util.RestartUtil; import forge.util.RestartUtil;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
@@ -17,30 +16,12 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
public class Main { public class Main {
private static final String versionString = BuildInfo.getVersionString(); private static final String versionString = BuildInfo.getVersionString();
public static void main(String[] args) { public static void main(String[] args) {
checkJVMArgs(System.getProperty("java.version")); new GameLauncher(versionString);
}
static void checkJVMArgs(String javaVersion) {
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
List<String> arguments = runtimeMxBean.getInputArguments();
JVMOptions.getStringBuilder().append("Java Version: ").append(javaVersion).append("\nArguments: \n");
for (String a : arguments) {
if (a.startsWith("-agent") || a.startsWith("-javaagent"))
continue;
JVMOptions.getStringBuilder().append(a).append("\n");
}
if (!JVMOptions.checkRuntime(arguments)) {
new DialogWindow("Error", JVMOptions.getStringBuilder().toString());
} else
new GameLauncher(versionString);
} }
public static class DesktopAdapter implements IDeviceAdapter { public static class DesktopAdapter implements IDeviceAdapter {

View File

@@ -1,3 +0,0 @@
#!/bin/sh
cd $(dirname "${0}")
java -XstartOnFirstThread -Xmx4096m $mandatory.java.args$ -jar $project.build.finalName$

View File

@@ -54,8 +54,6 @@ import java.nio.file.Paths;
import java.util.*; import java.util.*;
public class Forge implements ApplicationListener { public class Forge implements ApplicationListener {
public static String CURRENT_VERSION = "0.0";
private static ApplicationListener app = null; private static ApplicationListener app = null;
static Scene currentScene = null; static Scene currentScene = null;
static Array<Scene> lastScene = new Array<>(); static Array<Scene> lastScene = new Array<>();
@@ -127,11 +125,10 @@ public class Forge implements ApplicationListener {
public static boolean createNewAdventureMap = false; public static boolean createNewAdventureMap = false;
private static Localizer localizer; private static Localizer localizer;
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) { public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean propertyConfig, boolean androidOrientation, int totalRAM, boolean isTablet, int AndroidAPI, String AndroidRelease, String deviceName) {
if (app == null) { if (app == null) {
app = new Forge(); app = new Forge();
if (GuiBase.getInterface() == null) { if (GuiBase.getInterface() == null) {
CURRENT_VERSION = versionString;
clipboard = clipboard0; clipboard = clipboard0;
deviceAdapter = deviceAdapter0; deviceAdapter = deviceAdapter0;
GuiBase.setUsingAppDirectory(assetDir0.contains("forge.app")); //obb directory on android uses the package name as entrypoint GuiBase.setUsingAppDirectory(assetDir0.contains("forge.app")); //obb directory on android uses the package name as entrypoint

View File

@@ -54,7 +54,7 @@ public class GuiMobile implements IGuiBase {
@Override @Override
public String getCurrentVersion() { public String getCurrentVersion() {
return Forge.CURRENT_VERSION; return Forge.getDeviceAdapter().getVersionString();
} }
@Override @Override

View File

@@ -27,7 +27,7 @@ public class StartScene extends UIScene {
private static StartScene object; private static StartScene object;
Dialog exitDialog, backupDialog, zipDialog, unzipDialog; Dialog exitDialog, backupDialog, zipDialog, unzipDialog;
TextraButton saveButton, resumeButton, continueButton; TextraButton saveButton, resumeButton, continueButton;
TypingLabel version = Controls.newTypingLabel("{GRADIENT}[%80]" + Forge.CURRENT_VERSION + "{ENDGRADIENT}"); TypingLabel version = Controls.newTypingLabel("{GRADIENT}[%80]v." + Forge.getDeviceAdapter().getVersionString() + "{ENDGRADIENT}");
public StartScene() { public StartScene() {

View File

@@ -5,6 +5,7 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.List; import java.util.List;
import com.badlogic.gdx.files.FileHandle;
import forge.gui.GuiBase; import forge.gui.GuiBase;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -75,6 +76,19 @@ public class AssetsDownloader {
} }
//see if assets need updating //see if assets need updating
if (GuiBase.isAndroid()) {
FileHandle resDir = Gdx.files.absolute(ForgeConstants.RES_DIR);
FileHandle assetsDir = Gdx.files.absolute(ForgeConstants.ASSETS_DIR);
FileHandle advBG = Gdx.files.absolute(ForgeConstants.DEFAULT_SKINS_DIR).child(ForgeConstants.ADV_TEXTURE_BG_FILE);
if (!advBG.exists()) {
FileHandle deleteVersion = assetsDir.child("version.txt");
if (deleteVersion.exists())
deleteVersion.delete();
FileHandle deleteBuild = resDir.child("build.txt");
if (deleteBuild.exists())
deleteBuild.delete();
}
}
File versionFile = new File(ForgeConstants.ASSETS_DIR + "version.txt"); File versionFile = new File(ForgeConstants.ASSETS_DIR + "version.txt");
if (!versionFile.exists()) { if (!versionFile.exists()) {
try { try {

View File

@@ -815,13 +815,12 @@ public class CardRenderer {
g.drawRect(BORDER_THICKNESS, Color.MAGENTA, cx, cy, cw, ch); g.drawRect(BORDER_THICKNESS, Color.MAGENTA, cx, cy, cw, ch);
} }
//Ability Icons //Ability Icons
boolean onbattlefield = ZoneType.Battlefield.equals(card.getZone());
if (unselectable) { if (unselectable) {
g.setAlphaComposite(0.6f); g.setAlphaComposite(0.6f);
} }
if (onbattlefield && onTop) { if (ZoneType.Battlefield.equals(card.getZone()) && onTop) {
drawAbilityIcons(g, card, cx, cy, cw, ch, 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)) { } else if (canShow && !ZoneType.Battlefield.equals(card.getZone()) && showAbilityIcons(card)) {
//draw indicator for flash or can be cast at instant speed, enabled if show ability icons is enabled //draw indicator for flash or can be cast at instant speed, enabled if show ability icons is enabled
String keywordKey = card.getCurrentState().getKeywordKey(); String keywordKey = card.getCurrentState().getKeywordKey();
String abilityText = card.getCurrentState().getAbilityText(); String abilityText = card.getCurrentState().getAbilityText();

View File

@@ -157,7 +157,7 @@ public class SplashScreen extends FContainer {
float w2 = Forge.isLandscapeMode() ? Forge.getScreenWidth() / 2f : Forge.getScreenHeight() / 2f; float w2 = Forge.isLandscapeMode() ? Forge.getScreenWidth() / 2f : Forge.getScreenHeight() / 2f;
float h2 = 57f / 450f * (w2/2); float h2 = 57f / 450f * (w2/2);
String version = "v. " + Forge.CURRENT_VERSION; String version = "v." + Forge.getDeviceAdapter().getVersionString();
g.drawText(version, disclaimerFont, FProgressBar.SEL_FORE_COLOR, x, getHeight() - disclaimerHeight, w, disclaimerHeight, false, Align.center, true); g.drawText(version, disclaimerFont, FProgressBar.SEL_FORE_COLOR, x, getHeight() - disclaimerHeight, w, disclaimerHeight, false, Align.center, true);
progressBar.setBounds((Forge.getScreenWidth() - w2)/2, Forge.getScreenHeight() - h2 * 2f, w2, h2); progressBar.setBounds((Forge.getScreenWidth() - w2)/2, Forge.getScreenHeight() - h2 * 2f, w2, h2);
g.draw(progressBar); g.draw(progressBar);
@@ -381,7 +381,7 @@ public class SplashScreen extends FContainer {
progressBar.setBounds(x + padding, y, w - 2 * padding, pbHeight); progressBar.setBounds(x + padding, y, w - 2 * padding, pbHeight);
g.draw(progressBar); g.draw(progressBar);
String version = "v. " + Forge.CURRENT_VERSION; String version = "v." + Forge.getDeviceAdapter().getVersionString();
g.drawText(version, disclaimerFont, FProgressBar.SEL_FORE_COLOR, x, getHeight() - disclaimerHeight, w, disclaimerHeight, false, Align.center, true); g.drawText(version, disclaimerFont, FProgressBar.SEL_FORE_COLOR, x, getHeight() - disclaimerHeight, w, disclaimerHeight, false, Align.center, true);
} }
} }

View File

@@ -52,7 +52,11 @@ public class AudioClip implements IAudioClip {
catch (InterruptedException ex) { catch (InterruptedException ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
clip.play(value); try {
clip.play(value);
} catch (Exception e) {
e.printStackTrace();
}
} }
public final void loop() { public final void loop() {
@@ -65,13 +69,21 @@ public class AudioClip implements IAudioClip {
catch (InterruptedException ex) { catch (InterruptedException ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
clip.loop(); try {
clip.loop();
} catch (Exception e) {
e.printStackTrace();
}
} }
@Override @Override
public void dispose() { public void dispose() {
if (clip != null) { if (clip != null) {
clip.dispose(); try {
clip.dispose();
} catch (Exception e) {
e.printStackTrace();
}
clip = null; clip = null;
} }
} }
@@ -80,7 +92,11 @@ public class AudioClip implements IAudioClip {
if (clip == null) { if (clip == null) {
return; return;
} }
clip.stop(); try {
clip.stop();
} catch (Exception e) {
e.printStackTrace();
}
} }
public final boolean isDone() { public final boolean isDone() {

View File

@@ -13,7 +13,7 @@ ALTERNATE
Name:Staff Room Name:Staff Room
ManaCost:2 G ManaCost:2 G
Types:Enchantment Room Types:Enchantment Room
T:Mode$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTgts$ Player | CombatDamage$ True | TriggerZones$ Battlefield | Execute$ TrigChoose | TriggerDescription$ Whenever a creature you control deals combat damage to a player, turn that creature face up or put a +1/+1 counter on it. T:Mode$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Player | CombatDamage$ True | TriggerZones$ Battlefield | Execute$ TrigChoose | TriggerDescription$ Whenever a creature you control deals combat damage to a player, turn that creature face up or put a +1/+1 counter on it.
SVar:TrigChoose:DB$ GenericChoice | Choices$ DBPutCounter,DBTurnFaceUp SVar:TrigChoose:DB$ GenericChoice | Choices$ DBPutCounter,DBTurnFaceUp
SVar:DBTurnFaceUp:DB$ SetState | Defined$ TriggeredSourceLKICopy | Mode$ TurnFaceUp | IsPresent$ Card.canBeTurnedFaceUp+faceDown | PresentDefined$ TriggeredSourceLKICopy | SpellDescription$ Turn it face up SVar:DBTurnFaceUp:DB$ SetState | Defined$ TriggeredSourceLKICopy | Mode$ TurnFaceUp | IsPresent$ Card.canBeTurnedFaceUp+faceDown | PresentDefined$ TriggeredSourceLKICopy | SpellDescription$ Turn it face up
SVar:DBPutCounter:DB$ PutCounter | Defined$ TriggeredSourceLKICopy | CounterType$ P1P1 | CounterNum$ 1 | IsPresent$ Card.canReceiveCounters P1P1 | PresentDefined$ TriggeredSourceLKICopy | SpellDescription$ Put a +1/+1 counter on it SVar:DBPutCounter:DB$ PutCounter | Defined$ TriggeredSourceLKICopy | CounterType$ P1P1 | CounterNum$ 1 | IsPresent$ Card.canReceiveCounters P1P1 | PresentDefined$ TriggeredSourceLKICopy | SpellDescription$ Put a +1/+1 counter on it

View File

@@ -12,14 +12,23 @@ ScryfallCode=FDN
66 R Nine-Lives Familiar @Bram Sels 66 R Nine-Lives Familiar @Bram Sels
76 U Vengeful Bloodwitch @Jarel Threat 76 U Vengeful Bloodwitch @Jarel Threat
116 R Anthem of Champions @Chris Rallis 116 R Anthem of Champions @Chris Rallis
134 M Ajani, Caller of the Pride @D. Alexander Gregory
140 R Day of Judgment @Vincent Proce 140 R Day of Judgment @Vincent Proce
146 U Savannah Lions @Winona Nelson 146 U Savannah Lions @Winona Nelson
161 M Omniscience @Jason Chan 161 M Omniscience @Jason Chan
175 U Hero's Downfall @Chris Rallis 175 U Hero's Downfall @Chris Rallis
176 M Liliana, Dreadhorde General @Chris Rallis
185 U Stromkirk Bloodthief @Caroline Gariba 185 U Stromkirk Bloodthief @Caroline Gariba
227 C Llanowar Elves @Kev Walker 227 C Llanowar Elves @Kev Walker
234 M Vivien Reid @Anna Steinbauer
273 L Plains @Tingting Yeh 273 L Plains @Tingting Yeh
277 L Swamp @Rebecca Guay 277 L Swamp @Rebecca Guay
312 M Omniscience @Dominik Mayer
321 R Nine-Lives Familiar @Xabi Gaztelua
344 R Anthem of Champions @Ryan Pancoast
357 M Ajani, Caller of the Pride @Victor Adame Minguez
359 M Liliana, Dreadhorde General @Dmitry Burmak
361 M Vivien Reid @Zara Alfonso
379 M Omniscience @Dominik Mayer 379 M Omniscience @Dominik Mayer
385 R Nine-Lives Familiar @Xabi Gaztelua 385 R Nine-Lives Familiar @Xabi Gaztelua
405 R Anthem of Champions @Ryan Pancoast 405 R Anthem of Champions @Ryan Pancoast

View File

@@ -277,7 +277,6 @@ ScryfallCode=UST
[tokens] [tokens]
storm_crow storm_crow
c_2_2_homunculus
c_4_4_dragon_flying c_4_4_dragon_flying
w_2_2_cat w_2_2_cat
w_0_1_goat w_0_1_goat

View File

@@ -21,3 +21,5 @@ ScryfallCode=PW24
14 R Costly Plunder @Ben Maier 14 R Costly Plunder @Ben Maier
15 R Ravenous Squirrel @Dan Murayama Scott 15 R Ravenous Squirrel @Dan Murayama Scott
16 R Heirloom Blade @Carmen Sinek 16 R Heirloom Blade @Carmen Sinek
17 R Crippling Fear @Néstor Ossandón Leal
18 R Night's Whisper @John Severin Brassell

View File

@@ -0,0 +1,7 @@
[format]
Name:Arena Standard (2024-10-22)
Type:Archived
Subtype:Standard
Effective:2024-10-22
Sets:DMU, BRO, ONE, MOM, MAT, WOE, LCI, MKM, OTJ, BIG, BLB, DSK
Banned:Leyline of Resonance

View File

@@ -2100,7 +2100,6 @@ w_2_1_e_cleric.jpg https://downloads.cardforge.org/images/tokens/w_2_1_e_cleric.
w_2_1_e_cleric_cmm.jpg https://downloads.cardforge.org/images/tokens/w_2_1_e_cleric_cmm.jpg w_2_1_e_cleric_cmm.jpg https://downloads.cardforge.org/images/tokens/w_2_1_e_cleric_cmm.jpg
w_2_1_e_cleric_ths.jpg https://downloads.cardforge.org/images/tokens/w_2_1_e_cleric_ths.jpg w_2_1_e_cleric_ths.jpg https://downloads.cardforge.org/images/tokens/w_2_1_e_cleric_ths.jpg
w_2_2 knight_vigilance_afc.jpg https://downloads.cardforge.org/images/tokens/w_2_2_knight_vigilance_afc.jpg w_2_2 knight_vigilance_afc.jpg https://downloads.cardforge.org/images/tokens/w_2_2_knight_vigilance_afc.jpg
w_2_2_alien_rhino_who.jpg https://downloads.cardforge.org/images/tokens/w_2_2_alien_rhino_who.jpg
w_2_2_alien_who.jpg https://downloads.cardforge.org/images/tokens/w_2_2_alien_who.jpg w_2_2_alien_who.jpg https://downloads.cardforge.org/images/tokens/w_2_2_alien_who.jpg
w_2_2_astartes_warrior_vigilance_40k.jpg https://downloads.cardforge.org/images/tokens/w_2_2_astartes_warrior_vigilance_40k.jpg w_2_2_astartes_warrior_vigilance_40k.jpg https://downloads.cardforge.org/images/tokens/w_2_2_astartes_warrior_vigilance_40k.jpg
w_2_2_cat.jpg https://downloads.cardforge.org/images/tokens/w_2_2_cat.jpg w_2_2_cat.jpg https://downloads.cardforge.org/images/tokens/w_2_2_cat.jpg
@@ -2291,7 +2290,6 @@ wu_4_4_a_golem_lci.jpg https://downloads.cardforge.org/images/tokens/wu_4_4_a_go
wu_4_4_elemental_woe.jpg https://downloads.cardforge.org/images/tokens/wu_4_4_elemental_woe.jpg wu_4_4_elemental_woe.jpg https://downloads.cardforge.org/images/tokens/wu_4_4_elemental_woe.jpg
wu_4_4_sphinx_flying_vigilance.jpg https://downloads.cardforge.org/images/tokens/wu_4_4_sphinx_flying_vigilance.jpg wu_4_4_sphinx_flying_vigilance.jpg https://downloads.cardforge.org/images/tokens/wu_4_4_sphinx_flying_vigilance.jpg
wu_4_4_sphinx_flying_vigilance_rna.jpg https://downloads.cardforge.org/images/tokens/wu_4_4_sphinx_flying_vigilance_rna.jpg wu_4_4_sphinx_flying_vigilance_rna.jpg https://downloads.cardforge.org/images/tokens/wu_4_4_sphinx_flying_vigilance_rna.jpg
wubrg_2_2_citizen_war.jpg https://downloads.cardforge.org/images/tokens/wubrg_2_2_citizen_war.jpg
#Copies #Copies
@@ -2309,7 +2307,7 @@ embalm_labyrinth_guardian_akh.jpg https://downloads.cardforge.org/images/tokens/
embalm_oketra's_attendant_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_oketra%27s_attendant_akh.jpg embalm_oketra's_attendant_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_oketra%27s_attendant_akh.jpg
embalm_sacred_cat_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_sacred_cat_akh.jpg embalm_sacred_cat_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_sacred_cat_akh.jpg
embalm_tah-crop_skirmisher_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_tah-crop_skirmisher_akh.jpg embalm_tah-crop_skirmisher_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_tah-crop_skirmisher_akh.jpg
embalm_temmet,_vizier_of_naktamun_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_temmet,_vizier_of_naktamun_akh.jpg embalm_temmet_vizier_of_naktamun_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_temmet,_vizier_of_naktamun_akh.jpg
embalm_trueheart_duelist_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_trueheart_duelist_akh.jpg embalm_trueheart_duelist_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_trueheart_duelist_akh.jpg
embalm_unwavering_initiate_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_unwavering_initiate_akh.jpg embalm_unwavering_initiate_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_unwavering_initiate_akh.jpg
embalm_vizier_of_many_faces_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_vizier_of_many_faces_akh.jpg embalm_vizier_of_many_faces_akh.jpg https://downloads.cardforge.org/images/tokens/embalm_vizier_of_many_faces_akh.jpg

View File

@@ -31,7 +31,6 @@ public class JVMOptions {
sb.append("Forge failed to initialize JVM arguments.\n") sb.append("Forge failed to initialize JVM arguments.\n")
.append("Use forge.exe | forge.sh | forge.cmd for Desktop UI.\n") .append("Use forge.exe | forge.sh | forge.cmd for Desktop UI.\n")
.append("Use forge-adventure.exe | forge-adventure.sh | forge-adventure.cmd for Mobile UI.\n") .append("Use forge-adventure.exe | forge-adventure.sh | forge-adventure.cmd for Mobile UI.\n")
.append("(Use forge-adventure-mac.sh is for macOS to run properly).\n")
.append("Alternatively, add all these JVM Options in your Command line: \n"); .append("Alternatively, add all these JVM Options in your Command line: \n");
for (String arg : mandatoryArgs) for (String arg : mandatoryArgs)
sb.append(arg.replace("=", " ")).append("\n"); sb.append(arg.replace("=", " ")).append("\n");

View File

@@ -3,16 +3,16 @@
xmlns:izpack="http://izpack.org/schema/installation" xmlns:izpack="http://izpack.org/schema/installation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd"> xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">
<info> <info>
<appname>$project.build.finalName$</appname> <appname>$project.build.finalName$</appname>
<appversion>$month.date$</appversion> <appversion>$month.date$</appversion>
<url>https://card-forge.github.io/forge/</url> <url>https://card-forge.github.io/forge/</url>
<authors> <authors>
<author name="Forge Developers" email=""/> <author name="Forge Developers" email=""/>
</authors> </authors>
</info> </info>
<guiprefs height="600" resizable="no" width="800"> <guiprefs height="600" resizable="no" width="800">
<modifier key="langDisplayType" value="native"/> <modifier key="langDisplayType" value="native"/>
<modifier key="allXGap" value="0"/> <modifier key="allXGap" value="0"/>
<modifier key="allYGap" value="0"/> <modifier key="allYGap" value="0"/>
@@ -24,40 +24,59 @@
<modifier key="headingFontSize" value="1.5"/> <modifier key="headingFontSize" value="1.5"/>
<modifier key="headingBackgroundColor" value="0x00ffffff"/> <modifier key="headingBackgroundColor" value="0x00ffffff"/>
<modifier key="headingPanelCounter" value="text"/> <modifier key="headingPanelCounter" value="text"/>
</guiprefs> </guiprefs>
<locale> <locale>
<langpack iso3="eng"/> <langpack iso3="eng"/>
</locale> </locale>
<resources> <listeners>
<res id="packsLang.xml" src="eng.xml"/> <listener classname="ChmodInstallerListener" stage="install"/>
<res id="CustomLangPack.xml_eng" src="eng.xml"/> </listeners>
<resources>
<res id="packsLang.xml" src="eng.xml"/>
<res id="CustomLangPack.xml_eng" src="eng.xml"/>
<res id="HTMLInfoPanel.info" src="ReadMeForge.txt"/> <res id="HTMLInfoPanel.info" src="ReadMeForge.txt"/>
<res id="InfoPanel.info" src="ReadMeForge.txt"/> <res id="InfoPanel.info" src="ReadMeForge.txt"/>
<res id="TargetPanel.dir.windows" src="default-dir.txt"/> <res id="TargetPanel.dir.windows" src="default-dir.txt"/>
<res id="installer.langsel.img" src="ic_launcher.png"/> <res id="installer.langsel.img" src="ic_launcher.png"/>
<res id="Heading.image" src="ic_launcher.png"/> <res id="Heading.image" src="ic_launcher.png"/>
<res id="Installer.image" src="side.png"/> <res id="Installer.image" src="side.png"/>
</resources> </resources>
<variables> <variables>
<variable name="InstallerFrame.logfilePath" value="Default"/> <variable name="InstallerFrame.logfilePath" value="Default"/>
</variables> </variables>
<panels> <panels>
<panel classname="HTMLInfoPanel" id="welcome"/> <panel classname="HTMLInfoPanel" id="welcome"/>
<panel classname="TargetPanel" id="install_dir"/> <panel classname="TargetPanel" id="install_dir"/>
<panel classname="PacksPanel" id="sdk_pack_select"/> <panel classname="PacksPanel" id="sdk_pack_select"/>
<panel classname="InstallPanel" id="install"/> <panel classname="InstallPanel" id="install"/>
<panel classname="FinishPanel" id="finish"/> <panel classname="FinishPanel" id="finish"/>
</panels> </panels>
<packs> <packs>
<pack name="forge.zip" required="yes" preselected="yes" hidden="false"> <pack name="Forge pack" required="yes" preselected="yes" hidden="false">
<description>An archive that contains updated Forge application.</description> <description>An archive that contains updated Forge application.</description>
<file src="forge.zip" targetdir="$INSTALL_PATH/" override="true" unpack="true"/> <file src="$project.build.finalName$.tar.bz2" targetdir="$INSTALL_PATH/" override="true" unpack="true"/>
</pack> </pack>
</packs> <pack name="Script pack" required="yes" preselected="yes">
<description>Linux/Unix executables to install with permission if able. Grant permission manually if the installer failed to access permission.</description>
<file src="forge.sh" targetdir="$INSTALL_PATH/" override="true">
<additionaldata key="permission.file" value="775"/>
</file>
<file src="forge-adventure.sh" targetdir="$INSTALL_PATH/" override="true">
<additionaldata key="permission.file" value="775"/>
</file>
<file src="adventure-editor.sh" targetdir="$INSTALL_PATH/" override="true">
<additionaldata key="permission.file" value="775"/>
</file>
<executable stage="never" failure="ignore" keep="true">
<fileset targetdir="$INSTALL_PATH/" includes="forge.sh,forge-adventure.sh,adventure-editor.sh"/>
</executable>
</pack>
</packs>
</izpack:installation> </izpack:installation>

View File

@@ -186,7 +186,6 @@
<fileset dir="${project.build.directory}/../../adventure-editor/target" includes="adventure-editor-jar-with-dependencies.jar" /> <fileset dir="${project.build.directory}/../../adventure-editor/target" includes="adventure-editor-jar-with-dependencies.jar" />
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.exe" /> <fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.exe" />
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.sh" /> <fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.sh" />
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure-mac.sh" />
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.command" /> <fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.command" />
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.cmd" /> <fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.cmd" />
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-gui-mobile-dev-${project.version}-jar-with-dependencies.jar" /> <fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-gui-mobile-dev-${project.version}-jar-with-dependencies.jar" />
@@ -198,7 +197,6 @@
<chmod file="${project.build.directory}/${project.build.finalName}/forge.command" perm="a+rx" /> <chmod file="${project.build.directory}/${project.build.finalName}/forge.command" perm="a+rx" />
<chmod file="${project.build.directory}/${project.build.finalName}/forge.cmd" perm="a+rx" /> <chmod file="${project.build.directory}/${project.build.finalName}/forge.cmd" perm="a+rx" />
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.sh" perm="a+rx" /> <chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.sh" perm="a+rx" />
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-mac.sh" perm="a+rx" />
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.command" perm="a+rx" /> <chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.command" perm="a+rx" />
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.cmd" perm="a+rx" /> <chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.cmd" perm="a+rx" />
<chmod file="${project.build.directory}/${project.build.finalName}/adventure-editor.sh" perm="a+rx" /> <chmod file="${project.build.directory}/${project.build.finalName}/adventure-editor.sh" perm="a+rx" />
@@ -207,8 +205,16 @@
<chmod file="${project.build.directory}/${project.build.finalName}/forge.exe" perm="a+rx" /> <chmod file="${project.build.directory}/${project.build.finalName}/forge.exe" perm="a+rx" />
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.exe" perm="a+rx" /> <chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.exe" perm="a+rx" />
<chmod file="${project.build.directory}/${project.build.finalName}/adventure-editor.exe" perm="a+rx" /> <chmod file="${project.build.directory}/${project.build.finalName}/adventure-editor.exe" perm="a+rx" />
<zip destfile="${basedir}/target/forge.zip"> <copy todir="${basedir}/target">
<zipfileset filemode="755" dir="${project.build.directory}/${project.build.finalName}"> <fileset dir="${project.build.directory}/../../forge-gui-desktop/target" includes="forge.sh" />
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.sh" />
<fileset dir="${project.build.directory}/../../adventure-editor/target" includes="adventure-editor.sh" />
</copy>
<chmod file="${basedir}/target/forge.sh" perm="a+rx" />
<chmod file="${basedir}/target/forge-adventure.sh" perm="a+rx" />
<chmod file="${basedir}/target/adventure-editor.sh" perm="a+rx" />
<tar destfile="${basedir}/target/${project.build.finalName}.tar.bz2" compression="bzip2">
<tarfileset filemode="755" dir="${project.build.directory}/${project.build.finalName}">
<include name="forge.sh" /> <include name="forge.sh" />
<include name="forge.command" /> <include name="forge.command" />
<include name="forge.cmd" /> <include name="forge.cmd" />
@@ -221,8 +227,8 @@
<include name="adventure-editor.command" /> <include name="adventure-editor.command" />
<include name="adventure-editor.cmd" /> <include name="adventure-editor.cmd" />
<include name="adventure-editor.exe" /> <include name="adventure-editor.exe" />
</zipfileset> </tarfileset>
<zipfileset dir="${project.build.directory}/${project.build.finalName}"> <tarfileset dir="${project.build.directory}/${project.build.finalName}">
<include name="**" /> <include name="**" />
<exclude name="forge.sh" /> <exclude name="forge.sh" />
<exclude name="forge.command" /> <exclude name="forge.command" />
@@ -236,8 +242,8 @@
<exclude name="adventure-editor.command" /> <exclude name="adventure-editor.command" />
<exclude name="adventure-editor.cmd" /> <exclude name="adventure-editor.cmd" />
<exclude name="adventure-editor.exe" /> <exclude name="adventure-editor.exe" />
</zipfileset> </tarfileset>
</zip> </tar>
</target> </target>
</configuration> </configuration>
<goals> <goals>