(application, path)
| 490 | system.openFile({ prompt:"Open File", path:system.documentsDirectory }, path => { if (path) application.defer("doOpenFileCallback", new String(path)); }); |
| 491 | } |
| 492 | doOpenFileCallback(application, path) { |
| 493 | let extension = (system.platform == "win") ? ".dll" : ".so"; |
| 494 | if (path.endsWith(extension)) { |
| 495 | this.quitScreen(); |
| 496 | const devices = this.devices; |
| 497 | if (devices.length > 0) { |
| 498 | let index = devices.findIndex(device => device.applicationFilter.test(path)); |
| 499 | if (index < 0) index = 0; |
| 500 | if (index != this.deviceIndex) |
| 501 | this.selectDevice(application, index); |
| 502 | } |
| 503 | this.libraryPath = path; |
| 504 | this.launchScreen(); |
| 505 | } |
| 506 | if (path.endsWith(".xsa")) { |
| 507 | this.quitScreen(); |
| 508 | this.archivePath = path; |
| 509 | const directory = system.getPathDirectory(path); |
| 510 | path = system.buildPath(directory, "mc.ffi", extension.slice(1)); |
| 511 | if (system.fileExists(path)) |
| 512 | this.ffiPath = path; |
| 513 | this.launchScreen(); |
| 514 | } |
| 515 | } |
| 516 | doReloadFile() { |
| 517 | this.quitScreen(); |
| 518 | this.launchScreen(); |
no test coverage detected