erget 点击按钮弹出显示框文本确认

 onActReset(event) {
            let dConfirm = new gf.view.wgt.GFDlgConfirmView();
            dConfirm.message = `是否重置?`;
            dConfirm.ctx = this;
            dConfirm.onConfirm = ()=>{
                let req = new app.api.TowerResetTower();
                nn.RestSession.fetch(req, ()=>{
                    app.manager.player.me.actionCount.dailyTowerReset++;
                    this.data.Progress = req.Data.Progress;
                    let delta = new app.PlayerDelta();
                    delta.diamond = req.Data.DiamondCount;
                    app.manager.player.updateDelta(delta);
                    gf.view.other.HudView.Text("重置成功!");
                    this.updateData();               
                }, this);
            }
            dConfirm.open(MAIN_SCENE_INDEX.DIALOG_LAYER);
        }
   首先创建显示框对象 dConfirm;

   再定义要显示的文本表;
   在定义一系列的显示操作

  更新文本数据,显示点击按钮后的文本
  最后再初始化

猜你喜欢

转载自blog.csdn.net/weixin_40854327/article/details/79981864
今日推荐