2cb4568cc17fc880801c649b7e09213445038932.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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", "__unresolved_14", "__unresolved_15", "__unresolved_16"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Layout_Hall, UI_Rank, UI_Settings, UI_Sign, UI_Invite, GameUILayers, gui, ui_base, ResUtil, ModuleDef, SceneDef, UI_Store, UI_SideBar, UI_Task, ch_audio, GameState, Hall, life_countdown_Max, UI_Life, _dec, _class, _crd, ccclass, property, UI_Hall;
  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 _reportPossibleCrUseOfLayout_Hall(extras) {
  7. _reporterNs.report("Layout_Hall", "./Layout_Hall", _context.meta, extras);
  8. }
  9. function _reportPossibleCrUseOfUI_Rank(extras) {
  10. _reporterNs.report("UI_Rank", "../UI_Rank/UI_Rank", _context.meta, extras);
  11. }
  12. function _reportPossibleCrUseOfUI_Settings(extras) {
  13. _reporterNs.report("UI_Settings", "../UI_Settings/UI_Settings", _context.meta, extras);
  14. }
  15. function _reportPossibleCrUseOfUI_Sign(extras) {
  16. _reporterNs.report("UI_Sign", "../UI_Sign/UI_Sign", _context.meta, extras);
  17. }
  18. function _reportPossibleCrUseOfUI_Invite(extras) {
  19. _reporterNs.report("UI_Invite", "../UI_Invite/UI_Invite", _context.meta, extras);
  20. }
  21. function _reportPossibleCrUseOfGameUILayers(extras) {
  22. _reporterNs.report("GameUILayers", "../../../core/ui/ui", _context.meta, extras);
  23. }
  24. function _reportPossibleCrUseOfgui(extras) {
  25. _reporterNs.report("gui", "../../../core/ui/ui", _context.meta, extras);
  26. }
  27. function _reportPossibleCrUseOfui_base(extras) {
  28. _reporterNs.report("ui_base", "../../../core/ui/ui_base", _context.meta, extras);
  29. }
  30. function _reportPossibleCrUseOfResUtil(extras) {
  31. _reporterNs.report("ResUtil", "../../../core/util/ResUtil", _context.meta, extras);
  32. }
  33. function _reportPossibleCrUseOfModuleDef(extras) {
  34. _reporterNs.report("ModuleDef", "../../../Scripts/ModuleDef", _context.meta, extras);
  35. }
  36. function _reportPossibleCrUseOfSceneDef(extras) {
  37. _reporterNs.report("SceneDef", "../../../Scripts/SceneDef", _context.meta, extras);
  38. }
  39. function _reportPossibleCrUseOfUI_Store(extras) {
  40. _reporterNs.report("UI_Store", "../UI_Store/UI_Store", _context.meta, extras);
  41. }
  42. function _reportPossibleCrUseOfUI_SideBar(extras) {
  43. _reporterNs.report("UI_SideBar", "../UI_SideBar/UI_SideBar", _context.meta, extras);
  44. }
  45. function _reportPossibleCrUseOfUI_Task(extras) {
  46. _reporterNs.report("UI_Task", "../UI_Task/UI_Task", _context.meta, extras);
  47. }
  48. function _reportPossibleCrUseOfch_audio(extras) {
  49. _reporterNs.report("ch_audio", "../../../ch/audio/audio", _context.meta, extras);
  50. }
  51. function _reportPossibleCrUseOfGameState(extras) {
  52. _reporterNs.report("GameState", "../../hall/Hall", _context.meta, extras);
  53. }
  54. function _reportPossibleCrUseOfHall(extras) {
  55. _reporterNs.report("Hall", "../../hall/Hall", _context.meta, extras);
  56. }
  57. function _reportPossibleCrUseOflife_countdown_Max(extras) {
  58. _reporterNs.report("life_countdown_Max", "../../hall/Hall", _context.meta, extras);
  59. }
  60. function _reportPossibleCrUseOfUI_Life(extras) {
  61. _reporterNs.report("UI_Life", "../UI_Life/UI_Life", _context.meta, extras);
  62. }
  63. return {
  64. setters: [function (_unresolved_) {
  65. _reporterNs = _unresolved_;
  66. }, function (_cc) {
  67. _cclegacy = _cc.cclegacy;
  68. __checkObsolete__ = _cc.__checkObsolete__;
  69. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  70. _decorator = _cc._decorator;
  71. }, function (_unresolved_2) {
  72. Layout_Hall = _unresolved_2.Layout_Hall;
  73. }, function (_unresolved_3) {
  74. UI_Rank = _unresolved_3.UI_Rank;
  75. }, function (_unresolved_4) {
  76. UI_Settings = _unresolved_4.UI_Settings;
  77. }, function (_unresolved_5) {
  78. UI_Sign = _unresolved_5.UI_Sign;
  79. }, function (_unresolved_6) {
  80. UI_Invite = _unresolved_6.UI_Invite;
  81. }, function (_unresolved_7) {
  82. GameUILayers = _unresolved_7.GameUILayers;
  83. gui = _unresolved_7.gui;
  84. }, function (_unresolved_8) {
  85. ui_base = _unresolved_8.default;
  86. }, function (_unresolved_9) {
  87. ResUtil = _unresolved_9.ResUtil;
  88. }, function (_unresolved_10) {
  89. ModuleDef = _unresolved_10.ModuleDef;
  90. }, function (_unresolved_11) {
  91. SceneDef = _unresolved_11.SceneDef;
  92. }, function (_unresolved_12) {
  93. UI_Store = _unresolved_12.UI_Store;
  94. }, function (_unresolved_13) {
  95. UI_SideBar = _unresolved_13.UI_SideBar;
  96. }, function (_unresolved_14) {
  97. UI_Task = _unresolved_14.UI_Task;
  98. }, function (_unresolved_15) {
  99. ch_audio = _unresolved_15.default;
  100. }, function (_unresolved_16) {
  101. GameState = _unresolved_16.GameState;
  102. Hall = _unresolved_16.Hall;
  103. life_countdown_Max = _unresolved_16.life_countdown_Max;
  104. }, function (_unresolved_17) {
  105. UI_Life = _unresolved_17.UI_Life;
  106. }],
  107. execute: function () {
  108. _crd = true;
  109. _cclegacy._RF.push({}, "e5a30zX/fVMaZSMsA9kifAa", "UI_Hall", undefined);
  110. __checkObsolete__(['_decorator', 'Button', 'Component', 'Node']);
  111. ({
  112. ccclass,
  113. property
  114. } = _decorator);
  115. _export("UI_Hall", UI_Hall = (_dec = ccclass('UI_Hall'), _dec(_class = class UI_Hall extends (_crd && ui_base === void 0 ? (_reportPossibleCrUseOfui_base({
  116. error: Error()
  117. }), ui_base) : ui_base) {
  118. constructor() {
  119. super((_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
  120. error: Error()
  121. }), ModuleDef) : ModuleDef).GAME, 'ui/UI_Hall/Hall', (_crd && GameUILayers === void 0 ? (_reportPossibleCrUseOfGameUILayers({
  122. error: Error()
  123. }), GameUILayers) : GameUILayers).GAME, _crd && Layout_Hall === void 0 ? (_reportPossibleCrUseOfLayout_Hall({
  124. error: Error()
  125. }), Layout_Hall) : Layout_Hall);
  126. }
  127. onCreated() {
  128. if ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  129. error: Error()
  130. }), Hall) : Hall).getInstance().gameState == (_crd && GameState === void 0 ? (_reportPossibleCrUseOfGameState({
  131. error: Error()
  132. }), GameState) : GameState).fail) {
  133. if ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  134. error: Error()
  135. }), Hall) : Hall).getInstance().player.get_life() == 5) {
  136. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  137. error: Error()
  138. }), Hall) : Hall).getInstance().player.set_life_countdown(_crd && life_countdown_Max === void 0 ? (_reportPossibleCrUseOflife_countdown_Max({
  139. error: Error()
  140. }), life_countdown_Max) : life_countdown_Max);
  141. }
  142. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  143. error: Error()
  144. }), Hall) : Hall).getInstance().player.set_life((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  145. error: Error()
  146. }), Hall) : Hall).getInstance().player.get_life() - 1);
  147. }
  148. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  149. error: Error()
  150. }), Hall) : Hall).getInstance().gameState = (_crd && GameState === void 0 ? (_reportPossibleCrUseOfGameState({
  151. error: Error()
  152. }), GameState) : GameState).win;
  153. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  154. error: Error()
  155. }), ch_audio) : ch_audio).getInstance().play('sound/bgm');
  156. var layout = this.getLayout();
  157. this.onButtonEvent(layout.Start_Btn, () => {
  158. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  159. error: Error()
  160. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  161. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  162. error: Error()
  163. }), Hall) : Hall).getInstance().sceneChanging = false;
  164. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  165. error: Error()
  166. }), gui) : gui).close(UI_Hall);
  167. (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
  168. error: Error()
  169. }), ResUtil) : ResUtil).loadScene((_crd && SceneDef === void 0 ? (_reportPossibleCrUseOfSceneDef({
  170. error: Error()
  171. }), SceneDef) : SceneDef).GAME, (_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
  172. error: Error()
  173. }), ModuleDef) : ModuleDef).GAME, true);
  174. });
  175. this.onButtonEvent(layout.Settings_Btn, () => {
  176. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  177. error: Error()
  178. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  179. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  180. error: Error()
  181. }), gui) : gui).show(_crd && UI_Settings === void 0 ? (_reportPossibleCrUseOfUI_Settings({
  182. error: Error()
  183. }), UI_Settings) : UI_Settings);
  184. });
  185. this.onButtonEvent(layout.Rank_Btn, /*#__PURE__*/_asyncToGenerator(function* () {
  186. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  187. error: Error()
  188. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  189. yield (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  190. error: Error()
  191. }), Hall) : Hall).getInstance().player.loadPfInfo();
  192. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  193. error: Error()
  194. }), gui) : gui).show(_crd && UI_Rank === void 0 ? (_reportPossibleCrUseOfUI_Rank({
  195. error: Error()
  196. }), UI_Rank) : UI_Rank);
  197. }));
  198. this.onButtonEvent(layout.Sign_Btn, () => {
  199. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  200. error: Error()
  201. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  202. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  203. error: Error()
  204. }), gui) : gui).show(_crd && UI_Sign === void 0 ? (_reportPossibleCrUseOfUI_Sign({
  205. error: Error()
  206. }), UI_Sign) : UI_Sign);
  207. });
  208. this.onButtonEvent(layout.Invite_Btn, () => {
  209. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  210. error: Error()
  211. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  212. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  213. error: Error()
  214. }), gui) : gui).show(_crd && UI_Invite === void 0 ? (_reportPossibleCrUseOfUI_Invite({
  215. error: Error()
  216. }), UI_Invite) : UI_Invite);
  217. });
  218. this.onButtonEvent(layout.Store_Btn, () => {
  219. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  220. error: Error()
  221. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  222. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  223. error: Error()
  224. }), gui) : gui).show(_crd && UI_Store === void 0 ? (_reportPossibleCrUseOfUI_Store({
  225. error: Error()
  226. }), UI_Store) : UI_Store);
  227. });
  228. this.onButtonEvent(layout.Task_Btn, () => {
  229. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  230. error: Error()
  231. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  232. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  233. error: Error()
  234. }), gui) : gui).show(_crd && UI_Task === void 0 ? (_reportPossibleCrUseOfUI_Task({
  235. error: Error()
  236. }), UI_Task) : UI_Task);
  237. });
  238. this.onButtonEvent(layout.Search_Btn, () => {
  239. (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  240. error: Error()
  241. }), Hall) : Hall).getInstance().player.set_max_floor(parseInt(layout.Search_EditBox.string) - 1);
  242. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  243. error: Error()
  244. }), gui) : gui).close(UI_Hall);
  245. (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
  246. error: Error()
  247. }), ResUtil) : ResUtil).loadScene((_crd && SceneDef === void 0 ? (_reportPossibleCrUseOfSceneDef({
  248. error: Error()
  249. }), SceneDef) : SceneDef).GAME, (_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
  250. error: Error()
  251. }), ModuleDef) : ModuleDef).GAME, true);
  252. });
  253. if (chsdk.checkHasSidebar()) {
  254. layout.SideBar_Btn.node.active = true;
  255. this.onButtonEvent(layout.SideBar_Btn, () => {
  256. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  257. error: Error()
  258. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  259. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  260. error: Error()
  261. }), gui) : gui).show(_crd && UI_SideBar === void 0 ? (_reportPossibleCrUseOfUI_SideBar({
  262. error: Error()
  263. }), UI_SideBar) : UI_SideBar);
  264. });
  265. } else {
  266. layout.SideBar_Btn.node.active = false;
  267. }
  268. this.onButtonEvent(layout.Life_Btn, () => {
  269. (_crd && ch_audio === void 0 ? (_reportPossibleCrUseOfch_audio({
  270. error: Error()
  271. }), ch_audio) : ch_audio).getInstance().playOneShot('sound/click_Btn');
  272. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  273. error: Error()
  274. }), gui) : gui).show(_crd && UI_Life === void 0 ? (_reportPossibleCrUseOfUI_Life({
  275. error: Error()
  276. }), UI_Life) : UI_Life);
  277. });
  278. layout.Life_Num.string = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  279. error: Error()
  280. }), Hall) : Hall).getInstance().player.get_life().toString();
  281. if ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  282. error: Error()
  283. }), Hall) : Hall).getInstance().player.get_life_countdown() > 0) {
  284. layout.Life_CountDown.node.active = true;
  285. layout.Life_CountDown.node.parent.active = true;
  286. var minute = Math.floor((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  287. error: Error()
  288. }), Hall) : Hall).getInstance().player.get_life_countdown() / 60);
  289. var second = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
  290. error: Error()
  291. }), Hall) : Hall).getInstance().player.get_life_countdown() % 60;
  292. layout.Life_CountDown.string = (minute >= 10 ? minute : '0' + minute) + ':' + (second >= 10 ? second : '0' + second) + "后+1";
  293. } else {
  294. layout.Life_CountDown.node.active = false;
  295. layout.Life_CountDown.node.parent.active = false;
  296. }
  297. }
  298. update(deltaTime) {}
  299. set_Life(value) {
  300. var layout = this.getLayout();
  301. layout.Life_Num.string = value.toString();
  302. }
  303. set_Life_CountDown(value, flag) {
  304. var layout = this.getLayout();
  305. if (flag) {
  306. layout.Life_CountDown.node.active = true;
  307. layout.Life_CountDown.node.parent.active = true;
  308. var minute = Math.floor(value / 60);
  309. var second = value % 60;
  310. layout.Life_CountDown.string = (minute >= 10 ? minute : '0' + minute) + ':' + (second >= 10 ? second : '0' + second) + "后+1";
  311. } else {
  312. layout.Life_CountDown.node.active = false;
  313. layout.Life_CountDown.node.parent.active = false;
  314. }
  315. }
  316. }) || _class));
  317. _cclegacy._RF.pop();
  318. _crd = false;
  319. }
  320. };
  321. });
  322. //# sourceMappingURL=2cb4568cc17fc880801c649b7e09213445038932.js.map