فهرست منبع

事件名字调整

薛鸿潇 5 سال پیش
والد
کامیت
773294e0dc

+ 2 - 0
tower_sanguo/assets/scripts/manager/XXConst.ts

@@ -12,6 +12,8 @@ export class XXConst {
     public EventGetReward = 'event-get-reward';
     /** 是新的一天 */
     public EventIsNewDay = 'event-is-new-day';
+    /** 新的一波开始了 */
+    public EventNewMissionStart = 'event-new-mission-start';
 };
 declare global {
     const XXConst: XXConst;

+ 1 - 1
tower_sanguo/assets/scripts/module/checkpointRedBag/CheckpointRedBagBtn.ts

@@ -23,7 +23,7 @@ export default class CheckpointRedBagBtn extends cc.Component {
         XXEvent.addClickEvent(this.btn_chPo_RedBag, this.onClickChPoRedBag, this);
         XXEvent.on('event-get-checkpoint-redbag', this.onAddRedBag, this);
         XXEvent.on('event-monster-died', this.onMonsterDied, this);
-        XXEvent.on('event-new-mission-start', this.onNewMissionStart, this)// 新的一波开始了
+        XXEvent.on(XXConst.EventNewMissionStart, this.onNewMissionStart, this)// 新的一波开始了
     }
 
     start() {

+ 1 - 1
tower_sanguo/assets/scripts/module/checkpointRedBag/CheckpointRedBagItem.ts

@@ -23,7 +23,7 @@ export default class CheckpointRedBagItem extends cc.Component {
     /** 主页组件 */
     private comp_main: MainUI = null!;
     onLoad() {
-        XXEvent.on('event-new-mission-start', this.onNewMissionStart, this)// 新的一波开始了
+        XXEvent.on(XXConst.EventNewMissionStart, this.onNewMissionStart, this)// 新的一波开始了
         this.comp_btn = this.node.getComponent(cc.Button);
         XXEvent.addClickEvent(this.comp_btn, this.flyNode, this);
         // this.scheduleOnce(this.flyNode, this.life_time);

+ 1 - 1
tower_sanguo/assets/scripts/module/fight/FightUI.ts

@@ -496,7 +496,7 @@ export default class FightUI extends BaseUI {
         // GameUtil.shake(this.lbl_mission.node.parent.getChildByName('lbl_guan'), 20, 2)
         this.mission_start.stop();
         this.mission_start.play();
-        XXEvent.emit('event-new-mission-start')// 新的一波开始了
+        XXEvent.emit(XXConst.EventNewMissionStart, mission)// 新的一波开始了
     }
     private playMissionEndEffect(win: boolean, rewards: string) {
         if (win) {

+ 2 - 2
tower_sanguo/assets/scripts/module/getLiangCao/GetLiangCaoModel.ts

@@ -31,8 +31,8 @@ export default class GetLiangCaoModel {
     /** 更新可以获得的粮草数量 
      * 每关刷新
     */
-    public static updateFoodCount() {
-        this.model_data.food_count = GameController.gameData.getMissionByID(1).videofood;
+    public static updateFoodCount(mission_id) {
+        this.model_data.food_count = GameController.gameData.getMissionByID(mission_id).videofood;
     }
     /** 预计可训练次数 
      * - 实时计算得到

+ 3 - 3
tower_sanguo/assets/scripts/module/getLiangCao/GetLiangCaoUI.ts

@@ -20,7 +20,7 @@ export default class GetLiangCaoUI extends BaseUI {
 
     onLoad() {
         XXEvent.addClickEvent(this.btn_receive, this.onClickReceive, this);
-        XXEvent.on('event-new-mission-start', this.onUpdateFoodCount, this);
+        XXEvent.on(XXConst.EventNewMissionStart, this.onUpdateFoodCount, this);
     }
 
     start() {
@@ -35,8 +35,8 @@ export default class GetLiangCaoUI extends BaseUI {
         // 领取粮草逻辑
         // this.close();
     }
-    private onUpdateFoodCount() {
-        GetLiangCaoModel.updateFoodCount();
+    private onUpdateFoodCount(mission_id) {
+        GetLiangCaoModel.updateFoodCount(mission_id);
     }
     // update (dt) {}
 }