a441a6ac46987c8a416f5e72b0d42fb15596ae3b.js 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, Layout_Set, ModuleDef, GameUILayers, gui, ui_base, ch, get_new_wait, UI_Set, _crd;
  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_Set(extras) {
  7. _reporterNs.report("Layout_Set", "./Layout_Set", _context.meta, extras);
  8. }
  9. function _reportPossibleCrUseOfModuleDef(extras) {
  10. _reporterNs.report("ModuleDef", "../../scripts/ModuleDef", _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", _context.meta, extras);
  20. }
  21. function _reportPossibleCrUseOfch(extras) {
  22. _reporterNs.report("ch", "../../ch/ch", _context.meta, extras);
  23. }
  24. function _reportPossibleCrUseOfget_new_wait(extras) {
  25. _reporterNs.report("get_new_wait", "../../core/util_class/Wait", _context.meta, extras);
  26. }
  27. _export("UI_Set", void 0);
  28. return {
  29. setters: [function (_unresolved_) {
  30. _reporterNs = _unresolved_;
  31. }, function (_cc) {
  32. _cclegacy = _cc.cclegacy;
  33. __checkObsolete__ = _cc.__checkObsolete__;
  34. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  35. }, function (_unresolved_2) {
  36. Layout_Set = _unresolved_2.Layout_Set;
  37. }, function (_unresolved_3) {
  38. ModuleDef = _unresolved_3.ModuleDef;
  39. }, function (_unresolved_4) {
  40. GameUILayers = _unresolved_4.GameUILayers;
  41. gui = _unresolved_4.gui;
  42. ui_base = _unresolved_4.ui_base;
  43. }, function (_unresolved_5) {
  44. ch = _unresolved_5.ch;
  45. }, function (_unresolved_6) {
  46. get_new_wait = _unresolved_6.default;
  47. }],
  48. execute: function () {
  49. _crd = true;
  50. _cclegacy._RF.push({}, "f6ce46tVeNIMLXLIOeXtxW8", "UI_Set", undefined);
  51. __checkObsolete__(['Button', 'Size', 'Toggle']);
  52. _export("UI_Set", UI_Set = class UI_Set extends (_crd && ui_base === void 0 ? (_reportPossibleCrUseOfui_base({
  53. error: Error()
  54. }), ui_base) : ui_base) {
  55. constructor() {
  56. super((_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
  57. error: Error()
  58. }), ModuleDef) : ModuleDef).BASIC, 'ui_set/UI_Set', (_crd && GameUILayers === void 0 ? (_reportPossibleCrUseOfGameUILayers({
  59. error: Error()
  60. }), GameUILayers) : GameUILayers).POPUP, _crd && Layout_Set === void 0 ? (_reportPossibleCrUseOfLayout_Set({
  61. error: Error()
  62. }), Layout_Set) : Layout_Set);
  63. this.wait = (_crd && get_new_wait === void 0 ? (_reportPossibleCrUseOfget_new_wait({
  64. error: Error()
  65. }), get_new_wait) : get_new_wait)();
  66. }
  67. onCreated(is_in_game) {
  68. var layout = this.getLayout();
  69. this.onButtonEvent(layout.btnClose, this.onClose, this);
  70. this.onButtonEvent(layout.btnRestart, this.onRestart, this);
  71. this.onButtonEvent(layout.btnMain, this.onMain, this);
  72. layout.toogleMusic.isChecked = (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  73. error: Error()
  74. }), ch) : ch).audio.volumeMusic == 0;
  75. layout.toogleSound.isChecked = !(_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  76. error: Error()
  77. }), ch) : ch).audio.switchEffect;
  78. this.onToggleEvent(layout.toogleMusic, this.onMusic, this);
  79. this.onToggleEvent(layout.toogleSound, this.onSound, this);
  80. (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  81. error: Error()
  82. }), ch) : ch).audio.pause();
  83. (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
  84. error: Error()
  85. }), gui) : gui).scale_anim(layout.btnClose.node.parent); //
  86. layout.btnRestart.node.active = is_in_game;
  87. layout.btnMain.node.active = is_in_game;
  88. }
  89. onClose(button) {
  90. this.wait.resolve(null);
  91. this.close();
  92. (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  93. error: Error()
  94. }), ch) : ch).audio.resume();
  95. }
  96. await_choose() {
  97. var _this = this;
  98. return _asyncToGenerator(function* () {
  99. return _this.wait.wait();
  100. })();
  101. }
  102. onRestart(button) {
  103. this.wait.resolve('restart');
  104. this.close();
  105. }
  106. onMain(button) {
  107. this.wait.resolve('remain');
  108. this.close();
  109. }
  110. onMusic(toggle) {
  111. (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  112. error: Error()
  113. }), ch) : ch).audio.volumeMusic = toggle.isChecked ? 0 : 1;
  114. (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  115. error: Error()
  116. }), ch) : ch).audio.save();
  117. }
  118. onSound(toggle) {
  119. (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  120. error: Error()
  121. }), ch) : ch).audio.switchEffect = !toggle.isChecked;
  122. (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
  123. error: Error()
  124. }), ch) : ch).audio.save();
  125. }
  126. onDispose() {
  127. var _this$wait, _this$wait2;
  128. (_this$wait = this.wait) == null || _this$wait.resolve(null);
  129. (_this$wait2 = this.wait) == null || _this$wait2.dispose();
  130. this.wait = null;
  131. }
  132. });
  133. _cclegacy._RF.pop();
  134. _crd = false;
  135. }
  136. };
  137. });
  138. //# sourceMappingURL=a441a6ac46987c8a416f5e72b0d42fb15596ae3b.js.map