You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdLike2048/assets/script/manager/BattleIllustratedGuideManag...

33 lines
1.2 KiB

3 weeks ago
import { GEvent } from '../../mx/module/event/GEvent';
/** 战斗内图鉴引导:第 5 波提示点击图鉴(waveIndex 0-based = 4) */
const ILLUSTRATED_HINT_WAVE_INDEX = 4;
/** 战斗图鉴引导:存档标记 + 事件通知 */
export class BattleIllustratedGuideManager {
/** 是否已点击过战斗图鉴(砚台) */
static hasClicked(): boolean {
return Math.floor(Number(gg.data?.doc?.battleIllustratedGuideClicked) || 0) === 1;
}
/** 标记已点击图鉴并通知隐藏引导节点 */
static markClicked(): void {
if (this.hasClicked()) {
GEvent.Ins.emit(GEvent.HideBattleIllustratedHint);
return;
}
gg.data.doc.battleIllustratedGuideClicked = 1;
gg.data.saveLocal();
GEvent.Ins.emit(GEvent.HideBattleIllustratedHint);
}
/**
* 是否应在指定波次显示图鉴引导。
* @param waveIndex 当前波次索引(0-based,与 WaveStart 一致)
*/
static shouldShowHintAtWave(waveIndex: number): boolean {
if (this.hasClicked()) return false;
return Math.floor(Number(waveIndex) || 0) === ILLUSTRATED_HINT_WAVE_INDEX;
}
}