fea: 添加地图管理

This commit is contained in:
cancerai committed 2026-10-22 23:16:27 +08:00
1 parent cc2883458c
commit 22157d4baa
7 files changed
+201 -44

No files matched your search

+9
View File
@@ -42,6 +42,15 @@ export const Save = {
this.flush();
return lv;
},
/** 更新已保存的自制关卡(按 id 就地替换,不新增);id 不存在则追加 */
updateCustom(lv) {
this.data.customs = this.data.customs || [];
const i = this.data.customs.findIndex(l => l.id === lv.id);
if (i >= 0) this.data.customs[i] = lv;
else this.data.customs.push(lv);
this.flush();
return lv;
},
removeCustom(id) {
this.data.customs = (this.data.customs || []).filter(l => l.id !== id);
this.flush();