update version code, remove redundant CURRENT_VERSION

This commit is contained in:
Anthony Calosa
2024-10-21 15:01:39 +08:00
parent ece5772217
commit ca5b0683d1
8 changed files with 9 additions and 12 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

View File

@@ -288,7 +288,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) {

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

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

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

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