用户:
上知天文查看:2 回复:5 评论:2 创建时间:2023-06-16T23:03:33
https://box3.codemao.cn/e/5fd40c6e669270de4df0
找模型师,建图师,代码师
Dang的猫猫Box3Entity.prototype.viewFiles = async function (path = "") {
const files = resources.ls(path);
let options = files.reduce(
(l, v) => {
l.push(
concat(
"[",
v.type,
"]",
v.path.includes("/")?v.path.sliceFrom("/").slice(1):v.path
)
);
return l;
},
["[directory]..."]
);
await this.selectDialog(
"查看文件",
concat(
"/",
path
),
options
);
if (!this.dialogResult || this.dialogResult.value == "[directory]...") return;
const index = this.dialogResult.index - 1;
const viewFile = files[index];
if (viewFile.type == "directory") {
await this.viewFiles(viewFile.path);
return await this.viewFiles(path);
} else {
const viewPath = viewFile.path;
await this.textDialog(
"查看文件",
concat(
viewPath,
endline,
"请在创作端左侧控件区域的文件菜单中查看类型为",
"“",
viewFile.type,
"”",
"的文件。"
)
);
return await this.viewFiles(path);
}
}
()
点赞0
评论