daa1964f-7ef4-4b2d-8164-e23b96a54fcf.js
2.66 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
"use strict";
cc._RF.push(module, 'daa19ZPfvRLLYFk4juWpU/P', 'ChapterBtn');
// script/game/ui/ChapterBtn.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 CCDummyObjects_1 = require("../../common/CCDummyObjects");
const GameModelManager_1 = require("../model/GameModelManager");
const { ccclass, property } = cc._decorator;
let ChapterBtn = /** @class */ (() => {
let ChapterBtn = class ChapterBtn extends cc.Component {
constructor() {
super(...arguments);
this.label = CCDummyObjects_1.DummyLabel;
this.pointSpr = CCDummyObjects_1.DummyNode;
this._pid = -1;
}
setData(chapterId, chapterName, pid) {
this._pid = pid;
this.label.string = chapterId.toString() + "." + GameModelManager_1.GameModelManager.getI18LanguageTxt(chapterName);
}
onItemClick() {
console.log("onItemClick pid = ", this._pid);
GameModelManager_1.GameModelManager.RollBackToPlot.emit(this._pid);
let sprites = this.node.parent.getComponentsInChildren(cc.Sprite);
for (let i = 0; i < sprites.length; i++) {
sprites[i].node.active = false;
}
this.pointSpr.active = true;
cc.tween(this.pointSpr)
.repeatForever(cc.tween()
.to(0.5, { scale: 1.15, x: -25 }, { easing: 'sineInOut' })
.to(0.5, { scale: 1, x: -30 }, { easing: 'sineInOut' }))
.start();
let labels = this.node.parent.getComponentsInChildren(cc.Label);
for (let i = 0; i < labels.length; i++) {
labels[i].node.color = cc.color(255, 255, 255, 255);
}
this.label.node.color = cc.color(255, 238, 149, 255);
}
};
__decorate([
property(cc.Label)
], ChapterBtn.prototype, "label", void 0);
__decorate([
property(cc.Node)
], ChapterBtn.prototype, "pointSpr", void 0);
ChapterBtn = __decorate([
ccclass
], ChapterBtn);
return ChapterBtn;
})();
exports.default = ChapterBtn;
cc._RF.pop();