8d3d22f59bd6c497dcec20b4e5c10da28017adf0.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, ui_base, GameUILayers, gui, ModuleDef, Layout_TimesOver, UI_Fail, ani_ui, UI_Main, ch_audio, Hall, ch, _dec, _class, _crd, ccclass, property, UI_TimesOver;
  4. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  5. function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  6. function _reportPossibleCrUseOfui_base(extras) {
  7. _reporterNs.report("ui_base", "../../../core/ui/ui_base", _context.meta, extras);
  8. }
  9. function _reportPossibleCrUseOfGameUILayers(extras) {
  10. _reporterNs.report("GameUILayers", "../../../core/ui/ui", _context.meta, extras);
  11. }
  12. function _reportPossibleCrUseOfgui(extras) {
  13. _reporterNs.report("gui", "../../../core/ui/ui", _context.meta, extras);
  14. }
  15. function _reportPossibleCrUseOfModuleDef(extras) {
  16. _reporterNs.report("ModuleDef", "../../../Scripts/ModuleDef", _context.meta, extras);
  17. }
  18. function _reportPossibleCrUseOfLayout_TimesOver(extras) {
  19. _reporterNs.report("Layout_TimesOver", "./Layout_TimesOver", _context.meta, extras);
  20. }
  21. function _reportPossibleCrUseOfUI_Fail(extras) {
  22. _reporterNs.report("UI_Fail", "../UI_Fail/UI_Fail", _context.meta, extras);
  23. }
  24. function _reportPossibleCrUseOfani_ui(extras) {
  25. _reporterNs.report("ani_ui", "../UI_Main/UI_Main", _context.meta, extras);
  26. }
  27. function _reportPossibleCrUseOfUI_Main(extras) {
  28. _reporterNs.report("UI_Main", "../UI_Main/UI_Main", _context.meta, extras);
  29. }
  30. function _reportPossibleCrUseOfLayout_Main(extras) {
  31. _reporterNs.report("Layout_Main", "../UI_Main/Layout_Main", _context.meta, extras);
  32. }
  33. function _reportPossibleCrUseOfch_audio(extras) {
  34. _reporterNs.report("ch_audio", "../../../ch/audio/audio", _context.meta, extras);
  35. }
  36. function _reportPossibleCrUseOfHall(extras) {
  37. _reporterNs.report("Hall", "../../hall/Hall", _context.meta, extras);
  38. }
  39. function _reportPossibleCrUseOfch(extras) {
  40. _reporterNs.report("ch", "../../../ch/ch", _context.meta, extras);
  41. }
  42. return {
  43. setters: [function (_unresolved_) {
  44. _reporterNs = _unresolved_;
  45. }, function (_cc) {
  46. _cclegacy = _cc.cclegacy;
  47. __checkObsolete__ = _cc.__checkObsolete__;
  48. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  49. _decorator = _cc._decorator;
  50. }, function (_unresolved_2) {
  51. ui_base = _unresolved_2.default;
  52. }, function (_unresolved_3) {
  53. GameUILayers = _unresolved_3.GameUILayers;
  54. gui = _unresolved_3.gui;
  55. }, function (_unresolved_4) {
  56. ModuleDef = _unresolved_4.ModuleDef;
  57. }, function (_unresolved_5) {
  58. Layout_TimesOver = _unresolved_5.Layout_TimesOver;
  59. }, function (_unresolved_6) {
  60. UI_Fail = _unresolved_6.UI_Fail;
  61. }, function (_unresolved_7) {
  62. ani_ui = _unresolved_7.ani_ui;
  63. UI_Main = _unresolved_7.UI_Main;
  64. }, function (_unresolved_8) {
  65. ch_audio = _unresolved_8.default;
  66. }, function (_unresolved_9) {
  67. Hall = _unresolved_9.Hall;
  68. }, function (_unresolved_10) {
  69. ch = _unresolved_10.ch;
  70. }],
  71. execute: function () {
  72. _crd = true;
  73. _cclegacy._RF.push({}, "93f49g+PURGyJ0pLDMhVj8P", "UI_TimesOver", undefined);
  74. __checkObsolete__(['_decorator', 'Component', 'Node']);
  75. ({
  76. ccclass,
  77. property
  78. } = _decorator);
  79. _export("UI_TimesOver", UI_TimesOver = (_dec = ccclass('UI_TimesOver'), _dec(_class = class UI_TimesOver extends (_crd && ui_base === void 0 ? (_reportPossibleCrUseOfui_base({
  80. error: Error()
  81. }), ui_base) : ui_base) {
  82. constructor() {
  83. super((_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
  84. error: Error()
  85. }), ModuleDef) : ModuleDef).GAME, 'ui/UI_TimesOver/TimesOver', (_crd && GameUILayers === void 0 ? (_reportPossibleCrUseOfGameUILayers({
  86. error: Error()
  87. }), GameUILayers) : GameUILayers).HUD, _crd && Layout_TimesOver === void 0 ? (_reportPossibleCrUseOfLayout_TimesOver({
  88. error: Error()
  89. }), Layout_TimesOver) : Layout_TimesOver);
  90. }
  91. onCreated() {
  92. var _this = this;
  93. return _asyncToGenerator(function* () {
  94. var layout = _this.getLayout();
  95. (_crd && ani_ui === void 0 ? (_reportPossibleCrUseOfani_ui({
  96. error: Error()
  97. }), ani_ui) : ani_ui)(layout.Close_Btn.node.parent);
  98. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  99. error: Error()
  100. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  101. error: Error()
  102. }), UI_Main) : UI_Main).evt.emit((_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  103. error: Error()
  104. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  105. error: Error()
  106. }), UI_Main) : UI_Main).evt.key.pause);
  107. var num = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  108. error: Error()
  109. }), Hall) : Hall).getInstance().player.get_item(5);
  110. if (num > 0) {
  111. layout.AddTime_Ad.node.active = false;
  112. layout.RedPoint_num.node.parent.active = true;
  113. layout.RedPoint_num.string = num.toString();
  114. } else {
  115. layout.AddTime_Ad.node.active = true;
  116. layout.RedPoint_num.node.parent.active = false;
  117. } //已经消除方块/总方块
  118. layout.progressBar.progress = ((_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  119. error: Error()
  120. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  121. error: Error()
  122. }), UI_Main) : UI_Main).getLayout().Container.count - (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  123. error: Error()
  124. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  125. error: Error()
  126. }), UI_Main) : UI_Main).getLayout().Container.idioms.length) / (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  127. error: Error()
  128. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  129. error: Error()
  130. }), UI_Main) : UI_Main).getLayout().Container.count;
  131. console.log((_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  132. error: Error()
  133. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  134. error: Error()
  135. }), UI_Main) : UI_Main).getLayout().Container.count, (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  136. error: Error()
  137. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  138. error: Error()
  139. }), UI_Main) : UI_Main).getLayout().Container.idioms.length);
  140. layout.progressBar_Percent.string = Math.floor(layout.progressBar.progress * 100) + '%';
  141. _this.onButtonEvent(layout.Close_Btn, () => {
  142. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  143. error: Error()
  144. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  145. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  146. error: Error()
  147. }), gui) : gui).close(UI_TimesOver);
  148. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  149. error: Error()
  150. }), gui) : gui).show(_crd && UI_Fail === void 0 ? (_reportPossibleCrUseOfUI_Fail({
  151. error: Error()
  152. }), UI_Fail) : UI_Fail);
  153. });
  154. _this.onButtonEvent(layout.AddTime, /*#__PURE__*/_asyncToGenerator(function* () {
  155. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  156. error: Error()
  157. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  158. if (num <= 0) {
  159. var ret = yield chsdk.playRewardAd('获得道具5');
  160. if (ret) {
  161. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  162. error: Error()
  163. }), gui) : gui).close(UI_TimesOver); //增加时间
  164. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  165. error: Error()
  166. }), Hall) : Hall).getInstance().player.add_item(5, 1);
  167. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  168. error: Error()
  169. }), Hall) : Hall).getInstance().player.use_item(5);
  170. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  171. error: Error()
  172. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  173. error: Error()
  174. }), UI_Main) : UI_Main).evt.emit((_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  175. error: Error()
  176. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  177. error: Error()
  178. }), UI_Main) : UI_Main).evt.key.resume);
  179. (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  180. error: Error()
  181. }), ch) : ch).audio.resume();
  182. }
  183. } else {
  184. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  185. error: Error()
  186. }), gui) : gui).close(UI_TimesOver);
  187. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  188. error: Error()
  189. }), Hall) : Hall).getInstance().player.use_item(5); //增加时间
  190. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  191. error: Error()
  192. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  193. error: Error()
  194. }), UI_Main) : UI_Main).evt.emit((_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  195. error: Error()
  196. }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({
  197. error: Error()
  198. }), UI_Main) : UI_Main).evt.key.resume);
  199. }
  200. }));
  201. })();
  202. }
  203. }) || _class));
  204. _cclegacy._RF.pop();
  205. _crd = false;
  206. }
  207. };
  208. });
  209. //# sourceMappingURL=8d3d22f59bd6c497dcec20b4e5c10da28017adf0.js.map