feat(新手引导): 实现1-4号新手引导的完整流程
新增UIID.Guide1~Guide4枚举及弹窗UI配置 在任务主页组件中添加引导1的触发与完成逻辑 在任务卡牌组件中按流程触发引导2、3、4,完成步骤后自动切换并标记完成
This commit is contained in:
@@ -24,6 +24,10 @@ export enum UIID {
|
||||
HInfo,
|
||||
/** 技能卡牌系统核心控制器 */
|
||||
SkillBox,
|
||||
Guide1,
|
||||
Guide2,
|
||||
Guide3,
|
||||
Guide4,
|
||||
}
|
||||
|
||||
/** 打开界面方式的配置数据 */
|
||||
@@ -40,4 +44,8 @@ export var UIConfigData: { [key: number]: UIConfig } = {
|
||||
[UIID.Mission]: { layer: LayerType.UI, prefab: "gui/element/mission" },
|
||||
[UIID.HInfo]: { layer: LayerType.UI, prefab: "gui/element/hnode" },
|
||||
[UIID.SkillBox]: { layer: LayerType.UI, prefab: "gui/element/skillbox" },
|
||||
[UIID.Guide1]: { layer: LayerType.PopUp, prefab: "gui/element/guide1" },
|
||||
[UIID.Guide2]: { layer: LayerType.PopUp, prefab: "gui/element/guide2" },
|
||||
[UIID.Guide3]: { layer: LayerType.PopUp, prefab: "gui/element/guide3" },
|
||||
[UIID.Guide4]: { layer: LayerType.PopUp, prefab: "gui/element/guide4" },
|
||||
}
|
||||
@@ -49,6 +49,7 @@ import { FacSet, FightSet } from "../common/config/GameSet";
|
||||
import { MoveComp } from "../hero/MoveComp";
|
||||
import { MissionHeroComp } from "./MissionHeroComp";
|
||||
import { MissionEconomy } from "./MissionEconomy";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -328,6 +329,12 @@ export class MissionCardComp extends CCComp {
|
||||
this.isBattlePhase = true;
|
||||
this.enterBattlePhase();
|
||||
this.clearAllCards();
|
||||
|
||||
// 第一次进入战斗阶段,关闭guide4
|
||||
if (!smc.finish_guides.includes(4)) {
|
||||
smc.finish_guides.push(4);
|
||||
oops.gui.remove(UIID.Guide4);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -411,6 +418,11 @@ export class MissionCardComp extends CCComp {
|
||||
const cards = this.buildSkillDrawCards();
|
||||
this.dispatchCardsToSkillSlots(cards);
|
||||
this.playSkillCardEnterAnim();
|
||||
|
||||
// 首次弹出技能三选一的时候弹出guide2
|
||||
if (!smc.finish_guides.includes(2)) {
|
||||
oops.gui.open(UIID.Guide2);
|
||||
}
|
||||
}
|
||||
|
||||
private dispatchCardsToSkillSlots(cards: CardConfig[]) {
|
||||
@@ -427,6 +439,15 @@ export class MissionCardComp extends CCComp {
|
||||
if (this.skill_card_node && this.skill_card_node.isValid) {
|
||||
this.skill_card_node.active = false;
|
||||
}
|
||||
|
||||
// 首次完成技能选取后 关闭guide2,打开guide3
|
||||
if (!smc.finish_guides.includes(2)) {
|
||||
smc.finish_guides.push(2);
|
||||
oops.gui.remove(UIID.Guide2);
|
||||
if (!smc.finish_guides.includes(3)) {
|
||||
oops.gui.open(UIID.Guide3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 解除按钮监听,避免节点销毁后回调泄漏 */
|
||||
@@ -474,6 +495,15 @@ export class MissionCardComp extends CCComp {
|
||||
const before = this.getAliveHeroCount();
|
||||
const after = this.getAliveHeroCount();
|
||||
this.updateHeroNumUI(true, after > before);
|
||||
|
||||
// 第一次召唤英雄后,关闭guide3,打开guide4
|
||||
if (!smc.finish_guides.includes(3)) {
|
||||
smc.finish_guides.push(3);
|
||||
oops.gui.remove(UIID.Guide3);
|
||||
if (!smc.finish_guides.includes(4)) {
|
||||
oops.gui.open(UIID.Guide4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 英雄死亡事件回调:刷新面板列表并更新英雄数量 UI */
|
||||
|
||||
@@ -70,6 +70,11 @@ export class MissionHomeComp extends CCComp {
|
||||
/** 启动时显示主页 */
|
||||
start() {
|
||||
this.home_active()
|
||||
|
||||
// 首次打开游戏打开guide1
|
||||
if (!smc.finish_guides.includes(1)) {
|
||||
oops.gui.open(UIID.Guide1);
|
||||
}
|
||||
}
|
||||
|
||||
onEnable(){
|
||||
@@ -88,6 +93,13 @@ export class MissionHomeComp extends CCComp {
|
||||
*/
|
||||
start_mission() {
|
||||
mLogger.log(this.debugMode, 'MissionHomeComp', "start_mission")
|
||||
|
||||
// 进入战斗后,关闭guide1
|
||||
if (!smc.finish_guides.includes(1)) {
|
||||
smc.finish_guides.push(1);
|
||||
oops.gui.remove(UIID.Guide1);
|
||||
}
|
||||
|
||||
oops.gui.open(UIID.Mission)
|
||||
this.node.active=false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user