394eb72f0b5be6799d0045482477175eb4563bad.js 11 KB

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