"use strict";
|
cc._RF.push(module, '468cdO454JJ27qtFdOjsLqw', 'stone_dungeon_controller');
|
// Scripts/mod/stone_dungeon/stone_dungeon_controller.js
|
|
"use strict";
|
|
// --------------------------------------------------------------------
|
// @author: xxx@syg.com(必填, 创建模块的人员)
|
// @description:
|
// 这里填写详细说明,主要填写该模块的功能简要
|
// <br/>Create: 2019-01-08 11:59:10
|
// --------------------------------------------------------------------
|
var StoneDungeonEvent = require("stone_dungeon_event");
|
|
var Stone_dungeonController = cc.Class({
|
"extends": BaseController,
|
ctor: function ctor() {},
|
// 初始化配置数据
|
initConfig: function initConfig() {
|
var Stone_dungeonModel = require("stone_dungeon_model");
|
|
this.model = new Stone_dungeonModel();
|
this.model.initConfig();
|
},
|
// 返回当前的model
|
getModel: function getModel() {
|
return this.model;
|
},
|
// 注册监听事件
|
registerEvents: function registerEvents() {// if(!this.init_role_event){
|
// this.init_role_event = gcore.GlobalEvent.bind(EventId.EVT_ROLE_CREATE_SUCCESS, (function(){
|
// gcore.GlobalEvent.unbind(this.init_role_event);
|
// this.init_role_event = null;
|
// this.send13030();
|
// }).bind(this));
|
// }
|
},
|
// 注册协议接受事件
|
registerProtocals: function registerProtocals() {
|
this.RegisterProtocal(13030, this.on13030);
|
this.RegisterProtocal(13031, this.on13031);
|
this.RegisterProtocal(13032, this.on13032);
|
},
|
openStoneDungeonView: function openStoneDungeonView(status) {
|
if (status) {
|
var open_data = Config.dailyplay_data.data_exerciseactivity[1];
|
|
if (open_data == null) {
|
message(Utils.TI18N("日常副本数据异常"));
|
return;
|
}
|
|
var MainuiController = require("mainui_controller");
|
|
var bool = MainuiController.getInstance().checkIsOpenByActivate(open_data.activate);
|
|
if (bool == false) {
|
message(open_data.lock_desc);
|
return;
|
}
|
|
if (!this.stoneDungeonView) {
|
this.stoneDungeonView = Utils.createClass("stone_dungeon_window", this);
|
}
|
|
if (this.stoneDungeonView && this.stoneDungeonView.isOpen() == false) {
|
this.stoneDungeonView.open();
|
}
|
} else {
|
if (this.stoneDungeonView) {
|
this.stoneDungeonView.close();
|
this.stoneDungeonView = null;
|
}
|
}
|
},
|
// 副本信息
|
send13030: function send13030() {
|
this.SendProtocal(13030, {});
|
},
|
on13030: function on13030(data) {
|
this.model.setChangeSweepCount(data.list);
|
this.model.setPassClearanceID(data.pass_list);
|
gcore.GlobalEvent.fire(StoneDungeonEvent.Update_StoneDungeon_Data, data);
|
},
|
// 挑战副本
|
send13031: function send13031(id) {
|
this.SendProtocal(13031, {
|
id: id
|
});
|
},
|
on13031: function on13031(data) {
|
message(data.msg);
|
},
|
// 扫荡副本
|
send13032: function send13032(id) {
|
this.SendProtocal(13032, {
|
id: id
|
});
|
},
|
on13032: function on13032(data) {
|
message(data.msg);
|
},
|
getStoneDungeonRoot: function getStoneDungeonRoot(finish_cb) {
|
if (!finish_cb) {
|
if (this.stoneDungeonView) return this.stoneDungeonView.root_wnd;
|
} else {
|
if (this.stoneDungeonView) {
|
this.stoneDungeonView.getRootWnd(finish_cb);
|
} else {
|
finish_cb(null);
|
}
|
}
|
}
|
});
|
module.exports = Stone_dungeonController;
|
|
cc._RF.pop();
|