mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-05 15:58:14 +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();
|
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://");
|
json = json.replace("http://", "http:~~").replace("https://", "https:~~").replaceAll("//.*?\n","\n").replace("http:~~", "http://").replace("https:~~", "https://");
|
||||||
|
|
||||||
JsonValue value = parser.fromJson(null, json);
|
JsonValue value = parser.fromJson(null, json);
|
||||||
|
@ -61,11 +61,15 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
controller.importDocument(documentURLs.get(0), new NSURL(getDocumentsDirectory() + "/document"), UIDocumentBrowserImportMode.Copy, (url, error) -> {
|
controller.importDocument(documentURLs.get(0), new NSURL(getDocumentsDirectory() + "/document"), UIDocumentBrowserImportMode.Copy, (url, error) -> {
|
||||||
|
if(error != null){
|
||||||
|
ui.showErrorMessage("Import error.\n" + error.getLocalizedFailureReason() + "\n" + error.getLocalizedDescription());
|
||||||
|
}else{
|
||||||
try{
|
try{
|
||||||
cons.get(Core.files.absolute(url.getPath()));
|
cons.get(Core.files.absolute(url.getPath()));
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
ui.showException(t);
|
ui.showException(t);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
ui.showException(t);
|
ui.showException(t);
|
||||||
|
Reference in New Issue
Block a user