1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- var t = require;
- var e = module;
- var i = exports;
- var s,
- 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}), (i.TIPSTATE = void 0);
- const o = t("GameText"),
- a = t("BaseView");
- ((t = s = i.TIPSTATE || (i.TIPSTATE = {}))[(t.SURE = 0)] = "SURE"),
- (t[(t.SURE_CANCEL = 1)] = "SURE_CANCEL"),
- (t[(t.NO_SURE = 2)] = "NO_SURE");
- const {ccclass: n, property: r} = cc._decorator;
- t = class extends a.default {
- constructor() {
- super(...arguments),
- (this.leftBtn = null),
- (this.rightBtn = null),
- (this.descLab = null),
- (this.closeBtn = null),
- (this.titleLab = null),
- (this.leftBtnLab = null),
- (this.rightBtnLab = null),
- (this.closeType = 0),
- (this.bgType = 1);
- }
- initUI() {
- super.initUI(),
- (this.leftBtnLab = this.leftBtn.target.getChildByName("Label").getComponent(cc.Label)),
- (this.rightBtnLab = this.rightBtn.target.getChildByName("Label").getComponent(cc.Label));
- }
- open(t) {
- super.open(), this.init(t);
- }
- init(t) {
- if (t) {
- switch ((this.data = t).curState) {
- case s.SURE:
- (this.rightBtn.node.active = !1), (this.leftBtn.node.active = !0);
- break;
- case s.SURE_CANCEL:
- (this.rightBtn.node.active = !0), (this.leftBtn.node.active = !0);
- break;
- case s.NO_SURE:
- (this.rightBtn.node.active = !1), (this.leftBtn.node.active = !1);
- break;
- default:
- (this.rightBtn.node.active = !1), (this.leftBtn.node.active = !0);
- }
- (this.closeBtn.node.active = t.hasCloseBtn),
- (this.leftBtnLab.string = t.leftBtnText || o.GameText.getText(17)),
- (this.rightBtnLab.string = t.rightBtnText),
- (this.descLab.string = t.tipsStr),
- (this.titleLab.string = t.title || o.GameText.getText(lang.ui_tip_view_title));
- }
- }
- onLeftBtn() {
- this.data.leftFunc && this.data.leftFunc.apply(this.data.leftThisObj), this.onTouchClose();
- }
- onRightBtn() {
- this.data.rightFunc && this.data.rightFunc.apply(this.data.rightThisObj), this.onTouchClose();
- }
- };
- e([r(cc.Button)], t.prototype, "leftBtn", void 0),
- e([r(cc.Button)], t.prototype, "rightBtn", void 0),
- e([r(cc.Label)], t.prototype, "descLab", void 0),
- e([r(cc.Button)], t.prototype, "closeBtn", void 0),
- e([r(cc.Label)], t.prototype, "titleLab", void 0),
- (t = e([n], t)),
- (i.default = t);
|