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
"use strict";
cc._RF.push(module, '4fdf0VkT9RJbqoONbD6U5Y2', 'crossshow_controller');
// Scripts/mod/crossshow/crossshow_controller.js
 
"use strict";
 
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//     跨服时空,zys
// <br/>Create: 2019-07-29 10:38:42
// --------------------------------------------------------------------
var CrossshowEvent = require("crossshow_event");
 
var CrossshowController = cc.Class({
  "extends": BaseController,
  ctor: function ctor() {},
  // 初始化配置数据
  initConfig: function initConfig() {
    var CrossshowModel = require("crossshow_model");
 
    this.model = new CrossshowModel();
    this.model.initConfig();
  },
  // 返回当前的model
  getModel: function getModel() {
    return this.model;
  },
  // 注册监听事件
  registerEvents: function registerEvents() {},
  // 注册协议接受事件
  registerProtocals: function registerProtocals() {
    this.RegisterProtocal(22150, this.handle22150); //跨服时空当前信息
  },
  //跨服时空当前信息\
  sender22150: function sender22150() {
    this.SendProtocal(22150, {});
  },
  handle22150: function handle22150(data) {
    gcore.GlobalEvent.fire(CrossshowEvent.Get_Cross_Show_Info_Event, data);
  },
  //打开跨服战场主界面
  openCrossshowMainWindow: function openCrossshowMainWindow(status) {
    if (status == true) {
      if (this.cross_show_main_window == null) {
        this.cross_show_main_window = Utils.createClass("crossshow_main_window");
      }
 
      if (this.cross_show_main_window.isOpen() == false) {
        this.cross_show_main_window.open();
      }
    } else {
      if (this.cross_show_main_window) {
        this.cross_show_main_window.close();
        this.cross_show_main_window = null;
      }
    }
  }
});
module.exports = CrossshowController;
 
cc._RF.pop();