c3e1fc3a-21fc-4185-9b54-095990c4972c.js
3.97 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
78
79
80
81
82
83
84
85
86
87
88
89
90
"use strict";
cc._RF.push(module, 'c3e1fw6IfxBhZtUCVmQxJcs', 'MessageEntryItem');
// script/game/ui/view/impl/MessageEntryItem.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 });
exports.MessageEntryItemImpl = void 0;
const CCDummyObjects_1 = require("../../../../common/CCDummyObjects");
const ListItemImpl_1 = require("../../baseview/impl/ListItemImpl");
const simba_cc_resutils_1 = require("simba-cc-resutils");
const { ccclass, property } = cc._decorator;
let MessageEntryItemImpl = /** @class */ (() => {
let MessageEntryItemImpl = class MessageEntryItemImpl extends ListItemImpl_1.ListItemImpl {
constructor() {
super(...arguments);
this.lastMsgLabel = CCDummyObjects_1.DummyRichText;
this.iconSprite = CCDummyObjects_1.DummySprite;
this.nameSprite = CCDummyObjects_1.DummySprite;
this.addGraceBtnNode = CCDummyObjects_1.DummyNode;
this.addNode = CCDummyObjects_1.DummyNode;
this.graceLevel = CCDummyObjects_1.DummyLabel;
this.redDotNode = CCDummyObjects_1.DummyNode;
}
onLoad() {
this.bindProp("nameSpr", async (value) => {
if (value && "" !== value.trim()) {
this.nameSprite.spriteFrame = await simba_cc_resutils_1.ResUtils.loadRes(value, cc.SpriteFrame);
}
});
this.bindProp("lastMsg", this.lastMsgLabel, "string");
this.bindProp("redDot", this.redDotNode, "active");
this.bindProp("icons", async (value) => {
if (value.length == 1) {
this.iconSprite.spriteFrame = await simba_cc_resutils_1.ResUtils.loadRes(value[0], cc.SpriteFrame);
}
});
this.bindProp("level", (v) => {
this.graceLevel.string = v + "";
});
this.bindProp("isShowAddGrace", async (value) => {
this.addNode.active = value;
if (value) {
cc.tween(this.addGraceBtnNode)
.repeatForever(cc.tween()
.to(0.8, { scale: 1.15 }, { easing: 'sineInOut' })
.to(0.8, { scale: 1 }, { easing: 'sineInOut' }))
.start();
}
});
this.bindProp("isShowGrace", this.addGraceBtnNode, "active");
}
onAddGraceClickCallBack() {
this._props.addGraceClickCallBack(this._props.roleId);
}
};
__decorate([
property({ type: cc.RichText })
], MessageEntryItemImpl.prototype, "lastMsgLabel", void 0);
__decorate([
property(cc.Sprite)
], MessageEntryItemImpl.prototype, "iconSprite", void 0);
__decorate([
property(cc.Sprite)
], MessageEntryItemImpl.prototype, "nameSprite", void 0);
__decorate([
property(cc.Node)
], MessageEntryItemImpl.prototype, "addGraceBtnNode", void 0);
__decorate([
property(cc.Node)
], MessageEntryItemImpl.prototype, "addNode", void 0);
__decorate([
property(cc.Label)
], MessageEntryItemImpl.prototype, "graceLevel", void 0);
__decorate([
property(cc.Node)
], MessageEntryItemImpl.prototype, "redDotNode", void 0);
MessageEntryItemImpl = __decorate([
ccclass
], MessageEntryItemImpl);
return MessageEntryItemImpl;
})();
exports.MessageEntryItemImpl = MessageEntryItemImpl;
cc._RF.pop();