Skip to content

Commit

Permalink
delete version.txt if res folder is incomplete to allow redownload
Browse files Browse the repository at this point in the history
  • Loading branch information
kevlahnota authored and tehdiplomat committed Oct 21, 2024
1 parent 993578d commit 21a738e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions forge-gui-mobile/src/forge/assets/AssetsDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.net.URL;
import java.util.List;

import com.badlogic.gdx.files.FileHandle;
import forge.gui.GuiBase;
import org.apache.commons.lang3.StringUtils;

Expand Down Expand Up @@ -75,6 +76,19 @@ public static void checkForUpdates(final SplashScreen splashScreen) {
}

//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");
if (!versionFile.exists()) {
try {
Expand Down

0 comments on commit 21a738e

Please sign in to comment.