123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7"], function (_export, _context) {
- "use strict";
- var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Node, Label, Sprite, Tween, tween, Vec3, BaseExp, autoBind, userIns, Constants, uiMgr, ResUtil, i18n, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _crd, ccclass, property, FailUI;
- function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
- function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
- function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
- function _reportPossibleCrUseOfBaseExp(extras) {
- _reporterNs.report("BaseExp", "../core/base/BaseExp", _context.meta, extras);
- }
- function _reportPossibleCrUseOfautoBind(extras) {
- _reporterNs.report("autoBind", "../extend/AutoBind", _context.meta, extras);
- }
- function _reportPossibleCrUseOfuserIns(extras) {
- _reporterNs.report("userIns", "../data/UserData", _context.meta, extras);
- }
- function _reportPossibleCrUseOfConstants(extras) {
- _reporterNs.report("Constants", "../data/Constants", _context.meta, extras);
- }
- function _reportPossibleCrUseOfuiMgr(extras) {
- _reporterNs.report("uiMgr", "../core/manager/UIManager", _context.meta, extras);
- }
- function _reportPossibleCrUseOfResUtil(extras) {
- _reporterNs.report("ResUtil", "../utils/ResUtil", _context.meta, extras);
- }
- function _reportPossibleCrUseOfi18n(extras) {
- _reporterNs.report("i18n", "../core/i18n/runtime-scripts/LanguageData", _context.meta, extras);
- }
- return {
- setters: [function (_unresolved_) {
- _reporterNs = _unresolved_;
- }, function (_cc) {
- _cclegacy = _cc.cclegacy;
- __checkObsolete__ = _cc.__checkObsolete__;
- __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
- _decorator = _cc._decorator;
- Node = _cc.Node;
- Label = _cc.Label;
- Sprite = _cc.Sprite;
- Tween = _cc.Tween;
- tween = _cc.tween;
- Vec3 = _cc.Vec3;
- }, function (_unresolved_2) {
- BaseExp = _unresolved_2.BaseExp;
- }, function (_unresolved_3) {
- autoBind = _unresolved_3.autoBind;
- }, function (_unresolved_4) {
- userIns = _unresolved_4.userIns;
- }, function (_unresolved_5) {
- Constants = _unresolved_5.Constants;
- }, function (_unresolved_6) {
- uiMgr = _unresolved_6.uiMgr;
- }, function (_unresolved_7) {
- ResUtil = _unresolved_7.ResUtil;
- }, function (_unresolved_8) {
- i18n = _unresolved_8.default;
- }],
- execute: function () {
- _crd = true;
- _cclegacy._RF.push({}, "82bdafbov1NI4pcI+yBlNAb", "FailUI-001", undefined);
- __checkObsolete__(['_decorator', 'Node', 'Label', 'Sprite', 'EventTouch', 'Tween', 'tween', 'Vec3']);
- ({
- ccclass,
- property
- } = _decorator);
- _export("FailUI", FailUI = (_dec = ccclass('FailUI'), _dec2 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Node,
- tooltip: "旋转光节点"
- }), _dec3 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Sprite,
- tooltip: "获得的物品图片"
- }), _dec4 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Sprite,
- tooltip: "获得的物品图片缩影"
- }), _dec5 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Label,
- tooltip: "获得的物品的名字"
- }), _dec6 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Label,
- tooltip: "描述文字"
- }), _dec7 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Node,
- tooltip: "底部提交确认按钮"
- }), _dec8 = (_crd && autoBind === void 0 ? (_reportPossibleCrUseOfautoBind({
- error: Error()
- }), autoBind) : autoBind)({
- type: Node,
- tooltip: "拥有状态"
- }), _dec(_class = (_class2 = class FailUI extends (_crd && BaseExp === void 0 ? (_reportPossibleCrUseOfBaseExp({
- error: Error()
- }), BaseExp) : BaseExp) {
- constructor() {
- super(...arguments);
- _initializerDefineProperty(this, "rotation_light", _descriptor, this);
- _initializerDefineProperty(this, "obtain_good", _descriptor2, this);
- _initializerDefineProperty(this, "good_sy_sp", _descriptor3, this);
- _initializerDefineProperty(this, "name_lable", _descriptor4, this);
- _initializerDefineProperty(this, "dec_lable", _descriptor5, this);
- _initializerDefineProperty(this, "confim_btn", _descriptor6, this);
- _initializerDefineProperty(this, "owned_lable", _descriptor7, this);
- //奖励的数据
- this.data = null;
- //奖励的id
- this.id = '';
- //回调函数
- this.cb = null;
- }
- start() {
- this.closeOnBlank = false;
- }
- show() {
- this.id = arguments.length <= 0 ? undefined : arguments[0];
- this.cb = arguments.length <= 1 ? undefined : arguments[1];
- this.hasAnim = true; //加载数据ui
- this.ui();
- }
- /**
- * 加载数据ui
- */
- ui() {
- //获得的光圈一直旋转
- Tween.stopAllByTarget(this.rotation_light);
- tween(this.rotation_light).by(2, {
- eulerAngles: new Vec3(0, 0, -360)
- }).repeatForever().start();
- this.data = (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).boomerangTable.find(e => e.id == this.id); //设置图片
- (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
- error: Error()
- }), ResUtil) : ResUtil).setSpriteFrame(this.data.icon, this.obtain_good); //设置图片缩影
- (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
- error: Error()
- }), ResUtil) : ResUtil).setSpriteFrame(this.data.s_icon, this.good_sy_sp); //设置名字
- this.name_lable.string = (_crd && i18n === void 0 ? (_reportPossibleCrUseOfi18n({
- error: Error()
- }), i18n) : i18n).isZh ? this.data.name : this.data.name_lang; //设置描述
- this.dec_lable.string = (_crd && i18n === void 0 ? (_reportPossibleCrUseOfi18n({
- error: Error()
- }), i18n) : i18n).isZh ? this.data.description : this.data.dec_lang;
- var [gun_id, num] = this.data.quantity.split('_');
- if (gun_id == 1001 || gun_id == 1002) {
- //金币和钻石
- this.owned_lable.active = false;
- this.confim_btn.active = false; //是金币和钻石自动关闭
- this.scheduleOnce(() => {
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).hide((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.obtainUI, this.cb);
- }, 2);
- } else {
- this.confim_btn.active = true; //是解锁的枪 这儿需要判断是否已经拥有的了这把枪 如果已经拥有了这把枪 就转换成钻石和金币
- if ((_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).isHasGun(gun_id)) {
- //拥有这把枪转换成金币
- this.owned_lable.active = true;
- var [good_id, amount] = this.data.value.split('_');
- var sData = (_crd && userIns === void 0 ? (_reportPossibleCrUseOfuserIns({
- error: Error()
- }), userIns) : userIns).itemTable.find(e => e.id == good_id);
- this.dec_lable.string = "Already owned " + this.data.name_lang + ", converted " + amount + " " + sData.name_lang;
- } else {
- this.owned_lable.active = false;
- }
- }
- }
- /**
- * 按钮点击事件
- * @param event 事件
- * @param param 参数
- */
- onBtnClicked(event, param) {
- var btnName = event.target.name;
- if (btnName === 'confim_btn' || btnName === 'close_btn') {
- this.unscheduleAllCallbacks();
- (_crd && uiMgr === void 0 ? (_reportPossibleCrUseOfuiMgr({
- error: Error()
- }), uiMgr) : uiMgr).hide((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
- error: Error()
- }), Constants) : Constants).popUIs.obtainUI, this.cb);
- }
- }
- }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "rotation_light", [_dec2], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "obtain_good", [_dec3], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "good_sy_sp", [_dec4], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "name_lable", [_dec5], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "dec_lable", [_dec6], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "confim_btn", [_dec7], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "owned_lable", [_dec8], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- })), _class2)) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=2a56d92b1ce48d69b4cd0d4f5d83eba2070779dd.js.map
|