mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-04-21 04:50:59 -07:00
a revelation
This commit is contained in:
commit
bbf87df373
19 changed files with 355 additions and 280 deletions
|
|
@ -146,6 +146,30 @@ public class AndroidLauncher extends AndroidApplication{
|
|||
hideStatusBar = true;
|
||||
}});
|
||||
checkFiles(getIntent());
|
||||
|
||||
//new external folder
|
||||
Fi data = Core.files.absolute(getContext().getExternalFilesDir(null).getAbsolutePath());
|
||||
|
||||
//moved to internal storage if there's no file indicating that it moved
|
||||
if(!Core.files.local("files_moved").exists()){
|
||||
Log.info("Moving files to external storage...");
|
||||
|
||||
try{
|
||||
//current local storage folder
|
||||
Fi src = Core.files.absolute(Core.files.getLocalStoragePath());
|
||||
for(Fi fi : src.list()){
|
||||
fi.copyTo(data.child(fi.name()));
|
||||
}
|
||||
//create marker
|
||||
Core.files.local("files_moved").writeString("files moved to " + data);
|
||||
Log.info("Files moved.");
|
||||
}catch(Throwable t){
|
||||
Log.err("Failed to move files!");
|
||||
t.printStackTrace();
|
||||
}
|
||||
}else{
|
||||
Core.settings.setDataDirectory(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue