mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-04 07:17:19 +07:00
Display document import errors on iOS
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 18 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 24 KiB |
Binary file not shown.
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 6.1 KiB |
@ -342,7 +342,7 @@ public class ContentParser{
|
||||
init();
|
||||
}
|
||||
|
||||
//add comments starting with ##, but ignore links
|
||||
//add comments starting with //, but ignore links
|
||||
json = json.replace("http://", "http:~~").replace("https://", "https:~~").replaceAll("//.*?\n","\n").replace("http:~~", "http://").replace("https:~~", "https://");
|
||||
|
||||
JsonValue value = parser.fromJson(null, json);
|
||||
|
@ -61,10 +61,14 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
||||
|
||||
try{
|
||||
controller.importDocument(documentURLs.get(0), new NSURL(getDocumentsDirectory() + "/document"), UIDocumentBrowserImportMode.Copy, (url, error) -> {
|
||||
try{
|
||||
cons.get(Core.files.absolute(url.getPath()));
|
||||
}catch(Throwable t){
|
||||
ui.showException(t);
|
||||
if(error != null){
|
||||
ui.showErrorMessage("Import error.\n" + error.getLocalizedFailureReason() + "\n" + error.getLocalizedDescription());
|
||||
}else{
|
||||
try{
|
||||
cons.get(Core.files.absolute(url.getPath()));
|
||||
}catch(Throwable t){
|
||||
ui.showException(t);
|
||||
}
|
||||
}
|
||||
});
|
||||
}catch(Throwable t){
|
||||
|
Reference in New Issue
Block a user