feat: 对接最新的关卡工作流

This commit is contained in:
richarjiang
2026-04-26 17:04:47 +08:00
parent 5074706115
commit 1e5017e28e
16 changed files with 1808 additions and 795 deletions

View File

@@ -183,7 +183,9 @@ export class PageWriteLevels extends BaseView {
private _initLevelList(): void {
this._clearList();
this._levelCount = LevelDataManager.instance.getLevelCount();
// TODO: LevelDataManager API 已重构为 NextLevel 驱动,此页面需要重新设计数据来源
// this._levelCount = LevelDataManager.instance.getLevelCount();
this._levelCount = 0;
console.log('[PageWriteLevels] 关卡总数:', this._levelCount);
if (this._levelCount === 0) {
@@ -316,11 +318,11 @@ export class PageWriteLevels extends BaseView {
/**
* 异步加载关卡资源并刷新封面图和名称。
* LevelDataManager 采用懒加载,初始化时只加载了第一关图片,
* 其余关卡通过 ensureLevelReady 按需加载。
* TODO: LevelDataManager API 已重构为 NextLevel 驱动,此方法需要重新设计
*/
private async _loadAndRefreshCover(item: Node, index: number): Promise<void> {
const config = await LevelDataManager.instance.ensureLevelReady(index);
// const config = await LevelDataManager.instance.ensureLevelReady(index);
const config = null as any; // TODO: 需要适配新 API
if (!config || !item.isValid) return;
const levelCover = item.getChildByName('LevelCover');
@@ -548,14 +550,15 @@ export class PageWriteLevels extends BaseView {
* 将选中的关卡索引转换为关卡 ID 数组
*/
private _getSelectedLevelIds(): string[] {
// TODO: LevelDataManager API 已重构为 NextLevel 驱动,此方法需要重新设计
const ids: string[] = [];
const sortedIndices = Array.from(this._selectedIndices).sort((a, b) => a - b);
for (const index of sortedIndices) {
const config = LevelDataManager.instance.getLevelConfig(index);
if (config) {
ids.push(config.id);
}
}
// const sortedIndices = Array.from(this._selectedIndices).sort((a, b) => a - b);
// for (const index of sortedIndices) {
// const config = LevelDataManager.instance.getLevelConfig(index);
// if (config) {
// ids.push(config.id);
// }
// }
return ids;
}