0a4102a464059398e43bc26dd3fe1faf79989cb3.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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", "__unresolved_13"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, find, ch, GameUILayers, gui, ui_base, ModuleDef, UI_GameRules, UI_Idioms, UI_Settings, UI_Win, Layout_Main, Container_Manager, UI_TimesOver, ch_audio, GameState, 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_GameRules(extras) {
  25. _reporterNs.report("UI_GameRules", "../UI_GameRules/UI_GameRules", _context.meta, extras);
  26. }
  27. function _reportPossibleCrUseOfUI_Idioms(extras) {
  28. _reporterNs.report("UI_Idioms", "../UI_Idioms/UI_Idioms", _context.meta, extras);
  29. }
  30. function _reportPossibleCrUseOfUI_Settings(extras) {
  31. _reporterNs.report("UI_Settings", "../UI_Settings/UI_Settings", _context.meta, extras);
  32. }
  33. function _reportPossibleCrUseOfUI_Win(extras) {
  34. _reporterNs.report("UI_Win", "../UI_Win/UI_Win", _context.meta, extras);
  35. }
  36. function _reportPossibleCrUseOfLayout_Main(extras) {
  37. _reporterNs.report("Layout_Main", "./Layout_Main", _context.meta, extras);
  38. }
  39. function _reportPossibleCrUseOfContainer_Manager(extras) {
  40. _reporterNs.report("Container_Manager", "../../game/Container_Manager", _context.meta, extras);
  41. }
  42. function _reportPossibleCrUseOfUI_TimesOver(extras) {
  43. _reporterNs.report("UI_TimesOver", "../UI_TimesOver/UI_TimesOver", _context.meta, extras);
  44. }
  45. function _reportPossibleCrUseOfch_audio(extras) {
  46. _reporterNs.report("ch_audio", "../../../ch/audio/audio", _context.meta, extras);
  47. }
  48. function _reportPossibleCrUseOfGameState(extras) {
  49. _reporterNs.report("GameState", "../../hall/Hall", _context.meta, extras);
  50. }
  51. function _reportPossibleCrUseOfHall(extras) {
  52. _reporterNs.report("Hall", "../../hall/Hall", _context.meta, extras);
  53. }
  54. _export("ani_ui", ani_ui);
  55. return {
  56. setters: [function (_unresolved_) {
  57. _reporterNs = _unresolved_;
  58. }, function (_cc) {
  59. _cclegacy = _cc.cclegacy;
  60. __checkObsolete__ = _cc.__checkObsolete__;
  61. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  62. _decorator = _cc._decorator;
  63. find = _cc.find;
  64. }, function (_unresolved_2) {
  65. ch = _unresolved_2.ch;
  66. }, function (_unresolved_3) {
  67. GameUILayers = _unresolved_3.GameUILayers;
  68. gui = _unresolved_3.gui;
  69. }, function (_unresolved_4) {
  70. ui_base = _unresolved_4.default;
  71. }, function (_unresolved_5) {
  72. ModuleDef = _unresolved_5.ModuleDef;
  73. }, function (_unresolved_6) {
  74. UI_GameRules = _unresolved_6.UI_GameRules;
  75. }, function (_unresolved_7) {
  76. UI_Idioms = _unresolved_7.UI_Idioms;
  77. }, function (_unresolved_8) {
  78. UI_Settings = _unresolved_8.UI_Settings;
  79. }, function (_unresolved_9) {
  80. UI_Win = _unresolved_9.UI_Win;
  81. }, function (_unresolved_10) {
  82. Layout_Main = _unresolved_10.Layout_Main;
  83. }, function (_unresolved_11) {
  84. Container_Manager = _unresolved_11.Container_Manager;
  85. }, function (_unresolved_12) {
  86. UI_TimesOver = _unresolved_12.UI_TimesOver;
  87. }, function (_unresolved_13) {
  88. ch_audio = _unresolved_13.default;
  89. }, function (_unresolved_14) {
  90. GameState = _unresolved_14.GameState;
  91. Hall = _unresolved_14.Hall;
  92. }],
  93. execute: function () {
  94. _crd = true;
  95. _cclegacy._RF.push({}, "31872b9CC5Fd6kJNVMdC0MF", "UI_Main", undefined);
  96. __checkObsolete__(['_decorator', 'find', 'Node']);
  97. ({
  98. ccclass,
  99. property
  100. } = _decorator);
  101. _export("UI_Main", UI_Main = (_dec = ccclass('UI_Main'), _dec(_class = class UI_Main extends (_crd && ui_base === void 0 ? (_reportPossibleCrUseOfui_base({
  102. error: Error()
  103. }), ui_base) : ui_base) {
  104. constructor() {
  105. super((_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
  106. error: Error()
  107. }), ModuleDef) : ModuleDef).GAME, 'ui/UI_Main/Main', (_crd && GameUILayers === void 0 ? (_reportPossibleCrUseOfGameUILayers({
  108. error: Error()
  109. }), GameUILayers) : GameUILayers).GAME, _crd && Layout_Main === void 0 ? (_reportPossibleCrUseOfLayout_Main({
  110. error: Error()
  111. }), Layout_Main) : Layout_Main);
  112. this.evt = (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  113. error: Error()
  114. }), ch) : ch).get_new_event();
  115. this.running = true;
  116. }
  117. async onCreated() {
  118. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  119. error: Error()
  120. }), Hall) : Hall).getInstance().gameState = (_crd && GameState === void 0 ? (_reportPossibleCrUseOfGameState({
  121. error: Error()
  122. }), GameState) : GameState).gameing;
  123. const layout = this.getLayout();
  124. layout.Container = find('Container').getComponent(_crd && Container_Manager === void 0 ? (_reportPossibleCrUseOfContainer_Manager({
  125. error: Error()
  126. }), Container_Manager) : Container_Manager);
  127. this.onButtonEvent(layout.Pause_Btn, async button => {
  128. if (layout.Container.canTouch) {
  129. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  130. error: Error()
  131. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn'); //打开设置界面
  132. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  133. error: Error()
  134. }), gui) : gui).show(_crd && UI_Settings === void 0 ? (_reportPossibleCrUseOfUI_Settings({
  135. error: Error()
  136. }), UI_Settings) : UI_Settings);
  137. this.pause();
  138. }
  139. }, this);
  140. this.onButtonEvent(layout.Rules_Btn, async button => {
  141. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  142. error: Error()
  143. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn'); //打开游戏说明
  144. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  145. error: Error()
  146. }), gui) : gui).show(_crd && UI_GameRules === void 0 ? (_reportPossibleCrUseOfUI_GameRules({
  147. error: Error()
  148. }), UI_GameRules) : UI_GameRules);
  149. }, this); //显示关卡数
  150. layout.Level.string = '第' + ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  151. error: Error()
  152. }), Hall) : Hall).getInstance().player.get_max_floor() + 1) + '关'; //显示剩余方块
  153. layout.Remain_Cube_Des.string = '剩余:' + (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  154. error: Error()
  155. }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
  156. error: Error()
  157. }), UI_Idioms) : UI_Idioms).idioms.length * 2; //开始倒计时
  158. this.new_level();
  159. let level = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  160. error: Error()
  161. }), Hall) : Hall).getInstance().player.get_max_floor();
  162. layout.schedule(() => {
  163. if (this.running) {
  164. if (layout.time != 0) {
  165. layout.time -= 1;
  166. let minute = Math.floor(layout.time / 60);
  167. let second = layout.time % 60;
  168. layout.Count_Down_Des.string = (minute >= 10 ? minute : '0' + minute) + ':' + (second >= 10 ? second : '0' + second);
  169. } else {
  170. if (layout.Container.idioms.length > 0) {
  171. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  172. error: Error()
  173. }), gui) : gui).show(_crd && UI_TimesOver === void 0 ? (_reportPossibleCrUseOfUI_TimesOver({
  174. error: Error()
  175. }), UI_TimesOver) : UI_TimesOver);
  176. this.running = false;
  177. }
  178. }
  179. if (layout.Container.idioms.length <= 0) {
  180. console.log('恭喜你,通关成功');
  181. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  182. error: Error()
  183. }), Hall) : Hall).getInstance().player.set_pass_level(1);
  184. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  185. error: Error()
  186. }), Hall) : Hall).getInstance().player.set_max_floor((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  187. error: Error()
  188. }), Hall) : Hall).getInstance().player.get_max_floor() + 1);
  189. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  190. error: Error()
  191. }), Hall) : Hall).getInstance().player.setDirty();
  192. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  193. error: Error()
  194. }), Hall) : Hall).getInstance().player.save_rank_floor();
  195. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  196. error: Error()
  197. }), Hall) : Hall).getInstance().player.save();
  198. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  199. error: Error()
  200. }), gui) : gui).show(_crd && UI_Win === void 0 ? (_reportPossibleCrUseOfUI_Win({
  201. error: Error()
  202. }), UI_Win) : UI_Win);
  203. this.running = false;
  204. }
  205. }
  206. }, 1.0);
  207. this.evt.on(this.evt.key.pause, this.pause, this);
  208. this.evt.on(this.evt.key.resume, this.resume, this);
  209. this.evt.on(this.evt.key.next_level, this.new_level, this);
  210. this.evt.on(this.evt.key.update_remain, this.remain, this);
  211. this.evt.on(this.evt.key.update_ui_idioms, this.ui_idioms, this);
  212. }
  213. new_level() {
  214. let level = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  215. error: Error()
  216. }), Hall) : Hall).getInstance().player.get_max_floor();
  217. const layout = this.getLayout();
  218. if (level == 0) {
  219. layout.Eliminate_Btn.node.active = false;
  220. layout.Shuffle_Btn.node.active = false;
  221. layout.Empty_Btn.node.active = false;
  222. } else {
  223. layout.Eliminate_Btn.node.active = true;
  224. layout.Shuffle_Btn.node.active = true;
  225. layout.Empty_Btn.node.active = true;
  226. }
  227. layout.time = layout.Container.time;
  228. let minute = Math.floor(layout.Container.time / 60);
  229. let second = layout.Container.time % 60;
  230. layout.Count_Down_Des.string = (minute >= 10 ? minute : '0' + minute) + ':' + (second >= 10 ? second : '0' + second);
  231. layout.Remain_Cube_Des.string = '剩余:' + (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  232. error: Error()
  233. }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
  234. error: Error()
  235. }), UI_Idioms) : UI_Idioms).idioms.length * 2;
  236. layout.Level.string = '第' + ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  237. error: Error()
  238. }), Hall) : Hall).getInstance().player.get_max_floor() + 1) + '关';
  239. if (level == 0) {
  240. layout.Hands.forEach(node => {
  241. node.active = true;
  242. });
  243. } else {
  244. layout.Hands.forEach(node => {
  245. node.active = false;
  246. });
  247. }
  248. this.running = true;
  249. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  250. error: Error()
  251. }), ch_audio) : ch_audio).getInstance().play('sound/bgm');
  252. }
  253. remain() {
  254. const layout = this.getLayout();
  255. layout.Remain_Cube_Des.string = '剩余:' + (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  256. error: Error()
  257. }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
  258. error: Error()
  259. }), UI_Idioms) : UI_Idioms).idioms.length * 2;
  260. }
  261. ui_idioms() {
  262. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  263. error: Error()
  264. }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
  265. error: Error()
  266. }), UI_Idioms) : UI_Idioms).init();
  267. }
  268. pause() {
  269. this.running = false;
  270. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  271. error: Error()
  272. }), Hall) : Hall).getInstance().gameState = (_crd && GameState === void 0 ? (_reportPossibleCrUseOfGameState({
  273. error: Error()
  274. }), GameState) : GameState).wait;
  275. }
  276. resume() {
  277. this.running = true;
  278. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  279. error: Error()
  280. }), Hall) : Hall).getInstance().gameState = (_crd && GameState === void 0 ? (_reportPossibleCrUseOfGameState({
  281. error: Error()
  282. }), GameState) : GameState).gameing;
  283. }
  284. onDispose() {
  285. const layout = this.getLayout();
  286. layout.unscheduleAllCallbacks();
  287. }
  288. }) || _class));
  289. _cclegacy._RF.pop();
  290. _crd = false;
  291. }
  292. };
  293. });
  294. //# sourceMappingURL=0a4102a464059398e43bc26dd3fe1faf79989cb3.js.map