a441a6ac46987c8a416f5e72b0d42fb15596ae3b.js 5.6 KB

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