1411de84-62aa-4c48-bf98-4cd4b23f63d7.js
3.56 KB
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
"use strict";
cc._RF.push(module, '1411d6EYqpMSL+YTNSyP2PX', 'CCGameCenterListView');
// script/cooperation/script/CCGameCenterListView.ts
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const EventCenter_1 = require("../event/EventCenter");
const EventKit_1 = require("../event/EventKit");
const CCCooperationItem_1 = require("./CCCooperationItem");
const CooperationDataCenter_1 = require("./CooperationDataCenter");
const GameCenter_1 = require("./GameCenter");
const CCGameCenterNodeFactory_1 = require("./CCGameCenterNodeFactory");
const CCDummyObjects_1 = require("../../common/CCDummyObjects");
const simba_sdk_1 = require("simba-sdk");
const MainViewPresenter_1 = require("../../game/ui/presenter/MainViewPresenter");
const { ccclass, property } = cc._decorator;
let CCGameCenterListView = /** @class */ (() => {
let CCGameCenterListView = class CCGameCenterListView extends cc.Component {
constructor() {
super(...arguments);
this.contentNode = CCDummyObjects_1.DummyNode;
this._disposable = new EventKit_1.CompositeDisposable;
this.onRefreshContent = () => {
if (!this.contentNode) {
return;
}
this.contentNode.removeAllChildren(true);
let isRelease = GameCenter_1.default.getInstance().getIsRelease();
let list = CooperationDataCenter_1.default.getInstance().getCooperationItemDataModelList();
for (let i = 0; i < list.length; i++) {
let node = CCGameCenterNodeFactory_1.default.getInstance().getSubGameNode();
if (!node) {
break;
}
let script = node.getComponent(CCCooperationItem_1.CCCooperationItem);
if (script) {
script.setRelease(isRelease);
script.bindData(list[i]);
script.setLocation(CooperationDataCenter_1.SubGameLocation.GameCenter);
}
this.contentNode.addChild(node);
}
};
}
onLoad() {
this.registerEventListener();
}
registerEventListener() {
this._disposable.add(EventCenter_1.EventCenter.REFRESH_SUB_GAME_LIST.on(this.onRefreshContent));
}
start() {
}
update(dt) { }
onViewClick() {
EventCenter_1.EventCenter.SHOW_GAME_CENTER_LIST_VIEW.emit(false);
if (MainViewPresenter_1.default.tabIndex == 3) {
simba_sdk_1.SDK.showGameClubButton();
}
}
};
__decorate([
property({ type: cc.Node, visible: true, displayName: "scrollview内容节点", tooltip: "contentNode" })
], CCGameCenterListView.prototype, "contentNode", void 0);
CCGameCenterListView = __decorate([
ccclass
], CCGameCenterListView);
return CCGameCenterListView;
})();
exports.default = CCGameCenterListView;
cc._RF.pop();