394eb72f0b5be6799d0045482477175eb4563bad.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Button, Component, Label, ProgressBar, Sprite, SpriteFrame, Hall, gui, UI_Task, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _crd, ccclass, property, UI_Task_Item;
  4. 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 }); }
  5. 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; }
  6. 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.'); }
  7. function _reportPossibleCrUseOfHall(extras) {
  8. _reporterNs.report("Hall", "../../hall/Hall", _context.meta, extras);
  9. }
  10. function _reportPossibleCrUseOfgui(extras) {
  11. _reporterNs.report("gui", "../../../core/ui/ui", _context.meta, extras);
  12. }
  13. function _reportPossibleCrUseOfUI_Task(extras) {
  14. _reporterNs.report("UI_Task", "./UI_Task", _context.meta, extras);
  15. }
  16. return {
  17. setters: [function (_unresolved_) {
  18. _reporterNs = _unresolved_;
  19. }, function (_cc) {
  20. _cclegacy = _cc.cclegacy;
  21. __checkObsolete__ = _cc.__checkObsolete__;
  22. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  23. _decorator = _cc._decorator;
  24. Button = _cc.Button;
  25. Component = _cc.Component;
  26. Label = _cc.Label;
  27. ProgressBar = _cc.ProgressBar;
  28. Sprite = _cc.Sprite;
  29. SpriteFrame = _cc.SpriteFrame;
  30. }, function (_unresolved_2) {
  31. Hall = _unresolved_2.Hall;
  32. }, function (_unresolved_3) {
  33. gui = _unresolved_3.gui;
  34. }, function (_unresolved_4) {
  35. UI_Task = _unresolved_4.UI_Task;
  36. }],
  37. execute: function () {
  38. _crd = true;
  39. _cclegacy._RF.push({}, "016bcam/A5JvLXaYhjRZdz9", "UI_Task_Item", undefined);
  40. __checkObsolete__(['_decorator', 'Button', 'Component', 'Label', 'Node', 'ProgressBar', 'Sprite', 'SpriteFrame']);
  41. ({
  42. ccclass,
  43. property
  44. } = _decorator);
  45. _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 {
  46. constructor(...args) {
  47. super(...args);
  48. _initializerDefineProperty(this, "progressBar", _descriptor, this);
  49. _initializerDefineProperty(this, "Des", _descriptor2, this);
  50. _initializerDefineProperty(this, "Get", _descriptor3, this);
  51. _initializerDefineProperty(this, "Get_Bg", _descriptor4, this);
  52. _initializerDefineProperty(this, "Get_Bgs", _descriptor5, this);
  53. _initializerDefineProperty(this, "type", _descriptor6, this);
  54. _initializerDefineProperty(this, "index", _descriptor7, this);
  55. this.state = void 0;
  56. }
  57. start() {
  58. this.Get.node.on(Button.EventType.CLICK, this.add_Item, this);
  59. }
  60. update(deltaTime) {} //更新进度
  61. show(flag, target) {
  62. this.state = flag;
  63. switch (this.type) {
  64. //消除
  65. case 1:
  66. this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  67. error: Error()
  68. }), Hall) : Hall).getInstance().player.get_use_item_num() / target;
  69. this.Des.string = `${(_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  70. error: Error()
  71. }), Hall) : Hall).getInstance().player.get_use_item_num()}/${target}`;
  72. break;
  73. //洗牌 合成
  74. case 2:
  75. this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  76. error: Error()
  77. }), Hall) : Hall).getInstance().player.get_combine_num() / target;
  78. this.Des.string = `${(_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  79. error: Error()
  80. }), Hall) : Hall).getInstance().player.get_combine_num()}/${target}`;
  81. break;
  82. //清空 登陆
  83. case 3:
  84. this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  85. error: Error()
  86. }), Hall) : Hall).getInstance().player.get_login_num() / target;
  87. this.Des.string = `${(_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  88. error: Error()
  89. }), Hall) : Hall).getInstance().player.get_login_num()}/${target}`;
  90. break;
  91. //金币 过关
  92. case 4:
  93. this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  94. error: Error()
  95. }), Hall) : Hall).getInstance().player.get_pass_level() / target;
  96. this.Des.string = `${(_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  97. error: Error()
  98. }), Hall) : Hall).getInstance().player.get_pass_level()}/${target}`;
  99. break;
  100. //时间 广告
  101. case 5:
  102. this.progressBar.progress = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  103. error: Error()
  104. }), Hall) : Hall).getInstance().player.get_watch_ad_num() / target;
  105. this.Des.string = `${(_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  106. error: Error()
  107. }), Hall) : Hall).getInstance().player.get_watch_ad_num()}/${target}`;
  108. break;
  109. }
  110. if (this.progressBar.progress == 1) {
  111. if (this.state) {
  112. this.Des.string = '已领取';
  113. this.Get_Bg.spriteFrame = this.Get_Bgs[0];
  114. } else {
  115. this.Des.string = '可领取';
  116. this.Get_Bg.spriteFrame = this.Get_Bgs[1];
  117. }
  118. } else {
  119. this.Get_Bg.spriteFrame = this.Get_Bgs[0];
  120. }
  121. } //添加东西
  122. add_Item() {
  123. if (this.progressBar.progress == 1 && this.state == false) {
  124. if (this.type != 4) {
  125. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  126. error: Error()
  127. }), Hall) : Hall).getInstance().player.add_item(this.type, 1);
  128. } else if (this.type == 4) {
  129. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  130. error: Error()
  131. }), Hall) : Hall).getInstance().player.set_coin((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  132. error: Error()
  133. }), Hall) : Hall).getInstance().player.get_coin() + 100);
  134. }
  135. this.state = true;
  136. this.Des.string = '已领取';
  137. this.state ? this.Get_Bg.spriteFrame = this.Get_Bgs[0] : this.Get_Bg.spriteFrame = this.Get_Bgs[1];
  138. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  139. error: Error()
  140. }), gui) : gui).get(_crd && UI_Task === void 0 ? (_reportPossibleCrUseOfUI_Task({
  141. error: Error()
  142. }), UI_Task) : UI_Task).update_task_state(true, this.index);
  143. }
  144. }
  145. }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "progressBar", [_dec2], {
  146. configurable: true,
  147. enumerable: true,
  148. writable: true,
  149. initializer: null
  150. }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "Des", [_dec3], {
  151. configurable: true,
  152. enumerable: true,
  153. writable: true,
  154. initializer: null
  155. }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "Get", [_dec4], {
  156. configurable: true,
  157. enumerable: true,
  158. writable: true,
  159. initializer: null
  160. }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "Get_Bg", [_dec5], {
  161. configurable: true,
  162. enumerable: true,
  163. writable: true,
  164. initializer: null
  165. }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "Get_Bgs", [_dec6], {
  166. configurable: true,
  167. enumerable: true,
  168. writable: true,
  169. initializer: function () {
  170. return [];
  171. }
  172. }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "type", [property], {
  173. configurable: true,
  174. enumerable: true,
  175. writable: true,
  176. initializer: function () {
  177. return 0;
  178. }
  179. }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "index", [property], {
  180. configurable: true,
  181. enumerable: true,
  182. writable: true,
  183. initializer: function () {
  184. return 0;
  185. }
  186. })), _class2)) || _class));
  187. _cclegacy._RF.pop();
  188. _crd = false;
  189. }
  190. };
  191. });
  192. //# sourceMappingURL=394eb72f0b5be6799d0045482477175eb4563bad.js.map