[Android] add option to use obb directory as assets directory for Forge

This commit is contained in:
Anthony Calosa
2021-04-23 06:45:35 +08:00
parent fc9f81c5c9
commit 1929b75e34

View File

@@ -215,7 +215,8 @@ public class Main extends AndroidApplication {
+"LibGDX "+ Version.VERSION+"\n"+"Can't access external storage"); +"LibGDX "+ Version.VERSION+"\n"+"Can't access external storage");
return; return;
} }
String assetsDir = Environment.getExternalStorageDirectory() + "/Forge/"; String obbforge = Environment.getExternalStorageDirectory() + "/obbforge"; //if obbforge file exists in Phone Storage, use app-specific Obb directory as path
String assetsDir = FileUtil.doesFileExist(obbforge) ? getContext().getObbDir()+"/Forge/" : Environment.getExternalStorageDirectory()+"/Forge/";
if (!FileUtil.ensureDirectoryExists(assetsDir)) { if (!FileUtil.ensureDirectoryExists(assetsDir)) {
//fake init for error message //fake init for error message
//set current orientation //set current orientation