Merge branch 'master' into 'master'

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

See merge request core-developers/forge!4579
This commit is contained in:
Anthony Calosa
2021-04-22 23:14:25 +00:00

View File

@@ -215,7 +215,8 @@ public class Main extends AndroidApplication {
+"LibGDX "+ Version.VERSION+"\n"+"Can't access external storage");
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)) {
//fake init for error message
//set current orientation