123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5"], function (_export, _context) {
- "use strict";
- var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Button, Component, Label, ProgressBar, Sprite, SpriteFrame, gui, UI_Task, Toast, ch_audio, Hall, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _crd, ccclass, property, UI_Task_Item;
- 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 _reportPossibleCrUseOfgui(extras) {
- _reporterNs.report("gui", "../../../core/ui/ui", _context.meta, extras);
- }
- function _reportPossibleCrUseOfUI_Task(extras) {
- _reporterNs.report("UI_Task", "./UI_Task", _context.meta, extras);
- }
- function _reportPossibleCrUseOfToast(extras) {
- _reporterNs.report("Toast", "../../../core/util_class/Toast", _context.meta, extras);
- }
- function _reportPossibleCrUseOfch_audio(extras) {
- _reporterNs.report("ch_audio", "../../../ch/audio/audio", _context.meta, extras);
- }
- function _reportPossibleCrUseOfHall(extras) {
- _reporterNs.report("Hall", "../../hall/Hall", _context.meta, extras);
- }
- return {
- setters: [function (_unresolved_) {
- _reporterNs = _unresolved_;
- }, function (_cc) {
- _cclegacy = _cc.cclegacy;
- __checkObsolete__ = _cc.__checkObsolete__;
- __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
- _decorator = _cc._decorator;
- Button = _cc.Button;
- Component = _cc.Component;
- Label = _cc.Label;
- ProgressBar = _cc.ProgressBar;
- Sprite = _cc.Sprite;
- SpriteFrame = _cc.SpriteFrame;
- }, function (_unresolved_2) {
- gui = _unresolved_2.gui;
- }, function (_unresolved_3) {
- UI_Task = _unresolved_3.UI_Task;
- }, function (_unresolved_4) {
- Toast = _unresolved_4.Toast;
- }, function (_unresolved_5) {
- ch_audio = _unresolved_5.default;
- }, function (_unresolved_6) {
- Hall = _unresolved_6.Hall;
- }],
- execute: function () {
- _crd = true;
- _cclegacy._RF.push({}, "016bcam/A5JvLXaYhjRZdz9", "UI_Task_Item", undefined);
- __checkObsolete__(['_decorator', 'Button', 'Component', 'Label', 'Node', 'ProgressBar', 'Sprite', 'SpriteFrame']);
- ({
- ccclass,
- property
- } = _decorator);
- _export("UI_Task_Item", UI_Task_Item = (_dec = ccclass('UI_Task_Item'), _dec2 = property(ProgressBar), _dec3 = property(Label), _dec4 = property(Button), _dec5 = property(Sprite), _dec6 = property([SpriteFrame]), _dec(_class = (_class2 = class UI_Task_Item extends Component {
- constructor() {
- super(...arguments);
- _initializerDefineProperty(this, "progressBar", _descriptor, this);
- _initializerDefineProperty(this, "Des", _descriptor2, this);
- _initializerDefineProperty(this, "Get", _descriptor3, this);
- _initializerDefineProperty(this, "Get_Bg", _descriptor4, this);
- _initializerDefineProperty(this, "Get_Bgs", _descriptor5, this);
- this.config = void 0;
- _initializerDefineProperty(this, "index", _descriptor6, this);
- this.state = void 0;
- }
- start() {
- this.Get.node.on(Button.EventType.CLICK, this.add_Item, this);
- }
- update(deltaTime) {} //更新进度
- show(flag, config) {
- this.config = config;
- this.state = flag;
- switch (config.type) {
- //消除
- case 1:
- this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_use_item_num() / config.goal;
- this.Des.string = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_use_item_num() + "/" + config.goal;
- break;
- //洗牌 合成
- case 2:
- this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_combine_num() / config.goal;
- this.Des.string = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_combine_num() + "/" + config.goal;
- break;
- //清空 登陆
- case 3:
- this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_login_num() / config.goal;
- this.Des.string = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_login_num() + "/" + config.goal;
- break;
- //铜币 过关
- case 4:
- this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_pass_level() / config.goal;
- this.Des.string = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_pass_level() + "/" + config.goal;
- break;
- //时间 广告
- case 5:
- this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_watch_ad_num() / config.goal;
- this.Des.string = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_watch_ad_num() + "/" + config.goal;
- break;
- }
- if (this.progressBar.progress == 1) {
- if (this.state) {
- this.Des.string = '已领取';
- this.Get.interactable = false;
- this.Get_Bg.spriteFrame = this.Get_Bgs[0];
- } else {
- this.Des.string = '可领取';
- this.Get.interactable = true;
- this.Get_Bg.spriteFrame = this.Get_Bgs[1];
- }
- } else {
- this.Get.interactable = false;
- this.Get_Bg.spriteFrame = this.Get_Bgs[0];
- }
- } //添加东西
- add_Item() {
- (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
- error: Error()
- }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
- if (this.progressBar.progress == 1 && this.state == false) {
- if (this.config.type != 4) {
- (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.add_item(this.config.type, 1);
- (_crd && Toast === void 0 ? (_reportPossibleCrUseOfToast({
- error: Error()
- }), Toast) : Toast).makeText((_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).getLayerNode(5), '获得道具:' + this.config.name).show();
- } else if (this.config.type == 4) {
- (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.set_coin((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_coin() + 100);
- (_crd && Toast === void 0 ? (_reportPossibleCrUseOfToast({
- error: Error()
- }), Toast) : Toast).makeText((_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).getLayerNode(5), '获得铜币:X' + this.config.num).show();
- }
- this.state = true;
- this.Des.string = '已领取';
- this.Get_Bg.spriteFrame = this.Get_Bgs[0];
- this.Get.interactable = false;
- (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).get(_crd && UI_Task === void 0 ? (_reportPossibleCrUseOfUI_Task({
- error: Error()
- }), UI_Task) : UI_Task).update_task_state(true, this.index);
- }
- }
- }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "progressBar", [_dec2], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "Des", [_dec3], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "Get", [_dec4], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "Get_Bg", [_dec5], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "Get_Bgs", [_dec6], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: function initializer() {
- return [];
- }
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "index", [property], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- })), _class2)) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=394eb72f0b5be6799d0045482477175eb4563bad.js.map
|