Handle network paths

This commit is contained in:
luboslenco
2020-01-21 00:13:50 +01:00
parent a56bbbd33b
commit 2f2b7d24a5
2 changed files with 4 additions and 7 deletions
+3 -6
View File
@@ -120,8 +120,7 @@ class ImportArm {
for (file in project.assets) {
// Convert image path from relative to absolute
var isAbsolute = file.charAt(0) == "/" || file.charAt(1) == ":";
var abs = isAbsolute ? file : base + file;
var abs = Data.isAbsolute(file) ? file : base + file;
if (!File.exists(abs)) {
makePink(abs);
}
@@ -168,8 +167,7 @@ class ImportArm {
if (project.mesh_assets != null && project.mesh_assets.length > 0) {
var file = project.mesh_assets[0];
var isAbsolute = file.charAt(0) == "/" || file.charAt(1) == ":";
var abs = isAbsolute ? file : base + file;
var abs = Data.isAbsolute(file) ? file : base + file;
Project.meshAssets = [abs];
}
@@ -273,8 +271,7 @@ class ImportArm {
var base = Path.baseDir(path);
for (file in project.assets) {
// Convert image path from relative to absolute
var isAbsolute = file.charAt(0) == "/" || file.charAt(1) == ":";
var abs = isAbsolute ? file : base + file;
var abs = Data.isAbsolute(file) ? file : base + file;
if (!File.exists(abs)) {
makePink(abs);
}
+1 -1
View File
@@ -25,7 +25,7 @@ class UIFiles {
path = isSave ? Krom.saveDialog(filters, "") : Krom.openDialog(filters, "");
if (path != null) {
path = path.replace("\\\\", "\\");
if (path.charAt(1) == ":") path = path.replace("\\\\", "\\");
path = path.replace("\r", "");
filename = path.substr(path.lastIndexOf(Path.sep) + 1);
if (isSave) path = path.substr(0, path.lastIndexOf(Path.sep));