0a4102a464059398e43bc26dd3fe1faf79989cb3.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9", "__unresolved_10", "__unresolved_11", "__unresolved_12"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, find, ch, GameUILayers, gui, ui_base, ModuleDef, UI_Fail, UI_GameRules, UI_Idioms, UI_Settings, UI_Win, Layout_Main, Container_Manager, Hall, _dec, _class, _crd, ccclass, property, UI_Main;
  4. function ani_ui(node, end = 1.0) {
  5. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  6. error: Error()
  7. }), gui) : gui).scale_elasticOut_anim(node, 1.2, 0.5, end);
  8. }
  9. function _reportPossibleCrUseOfch(extras) {
  10. _reporterNs.report("ch", "../../../ch/ch", _context.meta, extras);
  11. }
  12. function _reportPossibleCrUseOfGameUILayers(extras) {
  13. _reporterNs.report("GameUILayers", "../../../core/ui/ui", _context.meta, extras);
  14. }
  15. function _reportPossibleCrUseOfgui(extras) {
  16. _reporterNs.report("gui", "../../../core/ui/ui", _context.meta, extras);
  17. }
  18. function _reportPossibleCrUseOfui_base(extras) {
  19. _reporterNs.report("ui_base", "../../../core/ui/ui_base", _context.meta, extras);
  20. }
  21. function _reportPossibleCrUseOfModuleDef(extras) {
  22. _reporterNs.report("ModuleDef", "../../../Scripts/ModuleDef", _context.meta, extras);
  23. }
  24. function _reportPossibleCrUseOfUI_Fail(extras) {
  25. _reporterNs.report("UI_Fail", "../UI_Fail/UI_Fail", _context.meta, extras);
  26. }
  27. function _reportPossibleCrUseOfUI_GameRules(extras) {
  28. _reporterNs.report("UI_GameRules", "../UI_GameRules/UI_GameRules", _context.meta, extras);
  29. }
  30. function _reportPossibleCrUseOfUI_Idioms(extras) {
  31. _reporterNs.report("UI_Idioms", "../UI_Idioms/UI_Idioms", _context.meta, extras);
  32. }
  33. function _reportPossibleCrUseOfUI_Settings(extras) {
  34. _reporterNs.report("UI_Settings", "../UI_Settings/UI_Settings", _context.meta, extras);
  35. }
  36. function _reportPossibleCrUseOfUI_Win(extras) {
  37. _reporterNs.report("UI_Win", "../UI_Win/UI_Win", _context.meta, extras);
  38. }
  39. function _reportPossibleCrUseOfLayout_Main(extras) {
  40. _reporterNs.report("Layout_Main", "./Layout_Main", _context.meta, extras);
  41. }
  42. function _reportPossibleCrUseOfContainer_Manager(extras) {
  43. _reporterNs.report("Container_Manager", "../../game/Container_Manager", _context.meta, extras);
  44. }
  45. function _reportPossibleCrUseOfHall(extras) {
  46. _reporterNs.report("Hall", "../../hall/Hall", _context.meta, extras);
  47. }
  48. _export("ani_ui", ani_ui);
  49. return {
  50. setters: [function (_unresolved_) {
  51. _reporterNs = _unresolved_;
  52. }, function (_cc) {
  53. _cclegacy = _cc.cclegacy;
  54. __checkObsolete__ = _cc.__checkObsolete__;
  55. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  56. _decorator = _cc._decorator;
  57. find = _cc.find;
  58. }, function (_unresolved_2) {
  59. ch = _unresolved_2.ch;
  60. }, function (_unresolved_3) {
  61. GameUILayers = _unresolved_3.GameUILayers;
  62. gui = _unresolved_3.gui;
  63. }, function (_unresolved_4) {
  64. ui_base = _unresolved_4.default;
  65. }, function (_unresolved_5) {
  66. ModuleDef = _unresolved_5.ModuleDef;
  67. }, function (_unresolved_6) {
  68. UI_Fail = _unresolved_6.UI_Fail;
  69. }, function (_unresolved_7) {
  70. UI_GameRules = _unresolved_7.UI_GameRules;
  71. }, function (_unresolved_8) {
  72. UI_Idioms = _unresolved_8.UI_Idioms;
  73. }, function (_unresolved_9) {
  74. UI_Settings = _unresolved_9.UI_Settings;
  75. }, function (_unresolved_10) {
  76. UI_Win = _unresolved_10.UI_Win;
  77. }, function (_unresolved_11) {
  78. Layout_Main = _unresolved_11.Layout_Main;
  79. }, function (_unresolved_12) {
  80. Container_Manager = _unresolved_12.Container_Manager;
  81. }, function (_unresolved_13) {
  82. Hall = _unresolved_13.Hall;
  83. }],
  84. execute: function () {
  85. _crd = true;
  86. _cclegacy._RF.push({}, "31872b9CC5Fd6kJNVMdC0MF", "UI_Main", undefined);
  87. __checkObsolete__(['_decorator', 'find', 'Node']);
  88. ({
  89. ccclass,
  90. property
  91. } = _decorator);
  92. _export("UI_Main", UI_Main = (_dec = ccclass('UI_Main'), _dec(_class = class UI_Main extends (_crd && ui_base === void 0 ? (_reportPossibleCrUseOfui_base({
  93. error: Error()
  94. }), ui_base) : ui_base) {
  95. constructor() {
  96. super((_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
  97. error: Error()
  98. }), ModuleDef) : ModuleDef).GAME, 'ui/UI_Main/Main', (_crd && GameUILayers === void 0 ? (_reportPossibleCrUseOfGameUILayers({
  99. error: Error()
  100. }), GameUILayers) : GameUILayers).GAME, _crd && Layout_Main === void 0 ? (_reportPossibleCrUseOfLayout_Main({
  101. error: Error()
  102. }), Layout_Main) : Layout_Main);
  103. this.evt = (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  104. error: Error()
  105. }), ch) : ch).get_new_event();
  106. this.running = true;
  107. }
  108. async onCreated() {
  109. const layout = this.getLayout();
  110. layout.Container = find('Container').getComponent(_crd && Container_Manager === void 0 ? (_reportPossibleCrUseOfContainer_Manager({
  111. error: Error()
  112. }), Container_Manager) : Container_Manager);
  113. this.onButtonEvent(layout.Pause_Btn, async button => {
  114. //打开设置界面
  115. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  116. error: Error()
  117. }), gui) : gui).show(_crd && UI_Settings === void 0 ? (_reportPossibleCrUseOfUI_Settings({
  118. error: Error()
  119. }), UI_Settings) : UI_Settings);
  120. this.pause();
  121. }, this);
  122. this.onButtonEvent(layout.Rules_Btn, async button => {
  123. //打开游戏说明
  124. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  125. error: Error()
  126. }), gui) : gui).show(_crd && UI_GameRules === void 0 ? (_reportPossibleCrUseOfUI_GameRules({
  127. error: Error()
  128. }), UI_GameRules) : UI_GameRules);
  129. }, this); //显示关卡数
  130. layout.Level.string = '第' + ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  131. error: Error()
  132. }), Hall) : Hall).getInstance().player.get_max_floor() + 1) + '关'; //显示剩余方块
  133. layout.Remain_Cube_Des.string = '剩余:' + (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  134. error: Error()
  135. }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
  136. error: Error()
  137. }), UI_Idioms) : UI_Idioms).idioms.length * 2; //开始倒计时
  138. this.new_level();
  139. let level = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  140. error: Error()
  141. }), Hall) : Hall).getInstance().player.get_max_floor();
  142. layout.schedule(() => {
  143. if (this.running) {
  144. if (layout.time != 0) {
  145. layout.time -= 1;
  146. let minute = Math.floor(layout.time / 60);
  147. let second = layout.time % 60;
  148. layout.Count_Down_Des.string = (minute >= 10 ? minute : '0' + minute) + ':' + (second >= 10 ? second : '0' + second);
  149. } else {
  150. if (layout.Container.idioms.length > 0) {
  151. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  152. error: Error()
  153. }), gui) : gui).show(_crd && UI_Fail === void 0 ? (_reportPossibleCrUseOfUI_Fail({
  154. error: Error()
  155. }), UI_Fail) : UI_Fail);
  156. this.running = false;
  157. }
  158. }
  159. if (layout.Container.idioms.length <= 0) {
  160. console.log('恭喜你,通关成功');
  161. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  162. error: Error()
  163. }), Hall) : Hall).getInstance().player.set_pass_level(1);
  164. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  165. error: Error()
  166. }), Hall) : Hall).getInstance().player.set_max_floor((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  167. error: Error()
  168. }), Hall) : Hall).getInstance().player.get_max_floor() + 1);
  169. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  170. error: Error()
  171. }), Hall) : Hall).getInstance().player.setDirty();
  172. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  173. error: Error()
  174. }), Hall) : Hall).getInstance().player.save_rank_floor();
  175. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  176. error: Error()
  177. }), Hall) : Hall).getInstance().player.save();
  178. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  179. error: Error()
  180. }), gui) : gui).show(_crd && UI_Win === void 0 ? (_reportPossibleCrUseOfUI_Win({
  181. error: Error()
  182. }), UI_Win) : UI_Win);
  183. this.running = false;
  184. }
  185. }
  186. }, 1.0);
  187. this.evt.on(this.evt.key.pause, this.pause, this);
  188. this.evt.on(this.evt.key.resume, this.resume, this);
  189. this.evt.on(this.evt.key.next_level, this.new_level, this);
  190. this.evt.on(this.evt.key.update_remain, this.remain, this);
  191. this.evt.on(this.evt.key.update_ui_idioms, this.ui_idioms, this);
  192. }
  193. new_level() {
  194. let level = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  195. error: Error()
  196. }), Hall) : Hall).getInstance().player.get_max_floor();
  197. const layout = this.getLayout();
  198. layout.time = layout.Container.level_config[level].time;
  199. let minute = Math.floor(layout.Container.level_config[level].time / 60);
  200. let second = layout.Container.level_config[level].time % 60;
  201. layout.Count_Down_Des.string = (minute >= 10 ? minute : '0' + minute) + ':' + (second >= 10 ? second : '0' + second);
  202. layout.Remain_Cube_Des.string = '剩余:' + (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  203. error: Error()
  204. }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
  205. error: Error()
  206. }), UI_Idioms) : UI_Idioms).idioms.length * 2;
  207. layout.Level.string = '第' + ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  208. error: Error()
  209. }), Hall) : Hall).getInstance().player.get_max_floor() + 1) + '关';
  210. this.running = true;
  211. }
  212. remain() {
  213. const layout = this.getLayout();
  214. layout.Remain_Cube_Des.string = '剩余:' + (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  215. error: Error()
  216. }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
  217. error: Error()
  218. }), UI_Idioms) : UI_Idioms).idioms.length * 2;
  219. }
  220. ui_idioms() {
  221. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  222. error: Error()
  223. }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
  224. error: Error()
  225. }), UI_Idioms) : UI_Idioms).init();
  226. }
  227. pause() {
  228. this.running = false;
  229. }
  230. resume() {
  231. this.running = true;
  232. }
  233. onDispose() {
  234. const layout = this.getLayout();
  235. layout.unscheduleAllCallbacks();
  236. }
  237. }) || _class));
  238. _cclegacy._RF.pop();
  239. _crd = false;
  240. }
  241. };
  242. });
  243. //# sourceMappingURL=0a4102a464059398e43bc26dd3fe1faf79989cb3.js.map