1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- var t = require;
- var e = module;
- var i = exports;
- e =
- (this && this.__decorate) ||
- function (t, e, i, s) {
- var o,
- a = arguments.length,
- n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
- else
- for (var r = t.length - 1; 0 <= r; r--)
- (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
- return 3 < a && n && Object.defineProperty(e, i, n), n;
- };
- Object.defineProperty(i, "__esModule", {value: !0});
- const s = t("App"),
- o = t("NotificationConst"),
- a = t("IBuff"),
- n = t("GameConst"),
- r = t("GlobalAttr"),
- l = t("MyBigLong"),
- h = t("MapService"),
- {ccclass: c, property: d} = cc._decorator;
- t = class extends cc.Component {
- constructor() {
- super(...arguments), (this.icon = null), (this.label = null), (this.rateLab = null);
- }
- onLoad() {
- this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
- }
- onTouchEnd() {}
- onEnable() {
- s.default.NotificationCenter.addListener(o.NotificationConst.UPDATE_MONEY, this.onUpdateMoney, this),
- s.default.NotificationCenter.addListener(n.GameNotificationConst.UPDATE_BUFF, this.onUpdateBuff, this),
- this.onUpdateMoney(),
- this.onUpdateBuff(null, null, "FOOD_SELL_RATE");
- }
- onUpdateMoney() {
- this.label.string = l.default.toString(h.default.ins.mapSaveData.money);
- }
- updateContent() {}
- onUpdateBuff(t, e, i) {
- a.BUFF_TYPE[i] == a.BUFF_TYPE.FOOD_SELL_RATE &&
- ((i = r.default.ins.buffAttr.attr.FOOD_SELL_RATE) && 1 < i
- ? ((this.rateLab.node.active = !0),
- (this.rateLab.string = "x" + r.default.ins.buffAttr.attr.FOOD_SELL_RATE))
- : (this.rateLab.node.active = !1));
- }
- onDisable() {
- s.default.NotificationCenter.removeListener(o.NotificationConst.UPDATE_MONEY, this.onUpdateMoney, this),
- s.default.NotificationCenter.removeListener(n.GameNotificationConst.UPDATE_BUFF, this.onUpdateBuff, this);
- }
- };
- e([d(cc.Sprite)], t.prototype, "icon", void 0),
- e([d(cc.Label)], t.prototype, "label", void 0),
- e([d(cc.Label)], t.prototype, "rateLab", void 0),
- (t = e([c], t)),
- (i.default = t);
|