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
79
80
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//      这里填写详细说明,主要填写该模块的功能简要
// <br/>Create: 2019-09-16 19:26:31
// --------------------------------------------------------------------
var ElementController = cc.Class({
    extends: BaseController,
    ctor: function () {
    },
 
    // 初始化配置数据
    initConfig: function () {
        var ElementModel = require("element_model");
 
        this.model = new ElementModel();
        this.model.initConfig();
    },
 
    // 返回当前的model
    getModel: function () {
        return this.model;
    },
 
    // 注册监听事件
    registerEvents: function () {
    },
 
    // 注册协议接受事件
    registerProtocals: function () {
        // this.RegisterProtocal(1110, this.on1110);
        this.RegisterProtocal(25000, this.handle25000) // 元素神殿基础数据
        this.RegisterProtocal(25001, this.handle25001) // 元素神殿挑战
        this.RegisterProtocal(25002, this.handle25002) // 元素神殿扫荡
        this.RegisterProtocal(25003, this.handle25003) // 购买挑战次数
        this.RegisterProtocal(25004, this.handle25004) // 挑战次数刷新
        this.RegisterProtocal(25005, this.handle25005) // 最大关卡数更新
    },
    handle25000(){
        
    },
    handle25001(){
        
    },
    handle25002(){
        
    },
    handle25003(){
        
    },
    handle25004(){
        
    },
    handle25005(){
        
    },
    //打开元素神殿主界面
    openElementMainWindow( status ){
        if(status == true){
            let is_open = this.model.checkElementIsOpen()
            if(!is_open){
                return
            }
 
            if(this.element_main_wnd == null){
                this.element_main_wnd = ElementMainWindow.New()
            }
            if(this.element_main_wnd.isOpen() == false){
                this.element_main_wnd.open()
            }
        }else{
            if(this.element_main_wnd){
                this.element_main_wnd.close()
                this.element_main_wnd = null
            }
        }
    },
});
 
module.exports = ElementController;