difenduandada
2024-12-31 34abe6963b344c882358274957f4b992456fee40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// --------------------------------------------------------------------
// @author: whjing2012@syg.com(必填, 创建模块的人员)
// @description:
//      这里填写详细说明,主要填写该模块的功能简要
// <br/>Create: 2019-01-07 15:18:54
// --------------------------------------------------------------------
var EsecsiceConst = require("esecsice_const");
 
var EsecsiceController = cc.Class({
    extends: BaseController,
    ctor: function () {
    },
 
    // 初始化配置数据
    initConfig: function () {
        var EsecsiceModel = require("esecsice_model");
 
        this.model = new EsecsiceModel();
        this.model.initConfig();
    },
 
    // 返回当前的model
    getModel: function () {
        return this.model;
    },
 
    // 注册监听事件
    registerEvents: function () {
    },
 
    // 注册协议接受事件
    registerProtocals: function () {
        // this.RegisterProtocal(1110, this.on1110);
    },
 
    openEsecsiceView : function(bool){
        if(bool){
            if(!this.esecsiceView){
                var EsecsiceWindow = require("esecsice_window");
                this.esecsiceView = new EsecsiceWindow();
            }
            this.esecsiceView.open();
        }else{
            if(this.esecsiceView){
                this.esecsiceView.close();
                this.esecsiceView = null;
            }
        }
    },
 
    switchEcecsiceActivityView(type){
        Log.info("====>>>", type);
        if(type == EsecsiceConst.execsice_index.endless){
            require("mainui_controller").getInstance().requestOpenBattleRelevanceWindow(require("battle_const").Fight_Type.Endless);
        }else if(type == EsecsiceConst.execsice_index.stonedungeon){
            require("mainui_controller").getInstance().requestOpenBattleRelevanceWindow(require("battle_const").Fight_Type.DungeonStone);
        }else if(type == EsecsiceConst.execsice_index.heroexpedit){
            require("mainui_controller").getInstance().requestOpenBattleRelevanceWindow(require("battle_const").Fight_Type.ExpeditFight);
        }else if(type == EsecsiceConst.execsice_index.honourfane){//荣耀神殿玩法
            require("mainui_controller").getInstance().requestOpenBattleRelevanceWindow(require("battle_const").Fight_Type.PrimusWar);
        }
    },
 
    getEsecsiceRoot: function(finish_cb) {
        if (!finish_cb) {
            if (this.esecsiceView)
                return this.esecsiceView.root_wnd;
        } else {
            if (this.esecsiceView) {
                this.esecsiceView.getRootWnd(finish_cb);
            } else {
                finish_cb(null);
            }
        }
    },
});
 
module.exports = EsecsiceController;