123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- 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) {
- "use strict";
- 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;
- function ani_ui(node, end = 1.0) {
- (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).scale_elasticOut_anim(node, 1.2, 0.5, end);
- }
- function _reportPossibleCrUseOfch(extras) {
- _reporterNs.report("ch", "../../../ch/ch", _context.meta, extras);
- }
- function _reportPossibleCrUseOfGameUILayers(extras) {
- _reporterNs.report("GameUILayers", "../../../core/ui/ui", _context.meta, extras);
- }
- function _reportPossibleCrUseOfgui(extras) {
- _reporterNs.report("gui", "../../../core/ui/ui", _context.meta, extras);
- }
- function _reportPossibleCrUseOfui_base(extras) {
- _reporterNs.report("ui_base", "../../../core/ui/ui_base", _context.meta, extras);
- }
- function _reportPossibleCrUseOfModuleDef(extras) {
- _reporterNs.report("ModuleDef", "../../../Scripts/ModuleDef", _context.meta, extras);
- }
- function _reportPossibleCrUseOfUI_Fail(extras) {
- _reporterNs.report("UI_Fail", "../UI_Fail/UI_Fail", _context.meta, extras);
- }
- function _reportPossibleCrUseOfUI_GameRules(extras) {
- _reporterNs.report("UI_GameRules", "../UI_GameRules/UI_GameRules", _context.meta, extras);
- }
- function _reportPossibleCrUseOfUI_Idioms(extras) {
- _reporterNs.report("UI_Idioms", "../UI_Idioms/UI_Idioms", _context.meta, extras);
- }
- function _reportPossibleCrUseOfUI_Settings(extras) {
- _reporterNs.report("UI_Settings", "../UI_Settings/UI_Settings", _context.meta, extras);
- }
- function _reportPossibleCrUseOfUI_Win(extras) {
- _reporterNs.report("UI_Win", "../UI_Win/UI_Win", _context.meta, extras);
- }
- function _reportPossibleCrUseOfLayout_Main(extras) {
- _reporterNs.report("Layout_Main", "./Layout_Main", _context.meta, extras);
- }
- function _reportPossibleCrUseOfContainer_Manager(extras) {
- _reporterNs.report("Container_Manager", "../../game/Container_Manager", _context.meta, extras);
- }
- function _reportPossibleCrUseOfHall(extras) {
- _reporterNs.report("Hall", "../../hall/Hall", _context.meta, extras);
- }
- _export("ani_ui", ani_ui);
- return {
- setters: [function (_unresolved_) {
- _reporterNs = _unresolved_;
- }, function (_cc) {
- _cclegacy = _cc.cclegacy;
- __checkObsolete__ = _cc.__checkObsolete__;
- __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
- _decorator = _cc._decorator;
- find = _cc.find;
- }, function (_unresolved_2) {
- ch = _unresolved_2.ch;
- }, function (_unresolved_3) {
- GameUILayers = _unresolved_3.GameUILayers;
- gui = _unresolved_3.gui;
- }, function (_unresolved_4) {
- ui_base = _unresolved_4.default;
- }, function (_unresolved_5) {
- ModuleDef = _unresolved_5.ModuleDef;
- }, function (_unresolved_6) {
- UI_Fail = _unresolved_6.UI_Fail;
- }, function (_unresolved_7) {
- UI_GameRules = _unresolved_7.UI_GameRules;
- }, function (_unresolved_8) {
- UI_Idioms = _unresolved_8.UI_Idioms;
- }, function (_unresolved_9) {
- UI_Settings = _unresolved_9.UI_Settings;
- }, function (_unresolved_10) {
- UI_Win = _unresolved_10.UI_Win;
- }, function (_unresolved_11) {
- Layout_Main = _unresolved_11.Layout_Main;
- }, function (_unresolved_12) {
- Container_Manager = _unresolved_12.Container_Manager;
- }, function (_unresolved_13) {
- Hall = _unresolved_13.Hall;
- }],
- execute: function () {
- _crd = true;
- _cclegacy._RF.push({}, "31872b9CC5Fd6kJNVMdC0MF", "UI_Main", undefined);
- __checkObsolete__(['_decorator', 'find', 'Node']);
- ({
- ccclass,
- property
- } = _decorator);
- _export("UI_Main", UI_Main = (_dec = ccclass('UI_Main'), _dec(_class = class UI_Main extends (_crd && ui_base === void 0 ? (_reportPossibleCrUseOfui_base({
- error: Error()
- }), ui_base) : ui_base) {
- constructor() {
- super((_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
- error: Error()
- }), ModuleDef) : ModuleDef).GAME, 'ui/UI_Main/Main', (_crd && GameUILayers === void 0 ? (_reportPossibleCrUseOfGameUILayers({
- error: Error()
- }), GameUILayers) : GameUILayers).GAME, _crd && Layout_Main === void 0 ? (_reportPossibleCrUseOfLayout_Main({
- error: Error()
- }), Layout_Main) : Layout_Main);
- this.evt = (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
- error: Error()
- }), ch) : ch).get_new_event();
- this.running = true;
- }
- async onCreated() {
- const layout = this.getLayout();
- layout.Container = find('Container').getComponent(_crd && Container_Manager === void 0 ? (_reportPossibleCrUseOfContainer_Manager({
- error: Error()
- }), Container_Manager) : Container_Manager);
- this.onButtonEvent(layout.Pause_Btn, async button => {
- //打开设置界面
- (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).show(_crd && UI_Settings === void 0 ? (_reportPossibleCrUseOfUI_Settings({
- error: Error()
- }), UI_Settings) : UI_Settings);
- this.pause();
- }, this);
- this.onButtonEvent(layout.Rules_Btn, async button => {
- //打开游戏说明
- (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).show(_crd && UI_GameRules === void 0 ? (_reportPossibleCrUseOfUI_GameRules({
- error: Error()
- }), UI_GameRules) : UI_GameRules);
- }, this); //显示关卡数
- layout.Level.string = '第' + ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_max_floor() + 1) + '关'; //显示剩余方块
- layout.Remain_Cube_Des.string = '剩余:' + (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
- error: Error()
- }), UI_Idioms) : UI_Idioms).idioms.length * 2; //开始倒计时
- this.new_level();
- let level = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_max_floor();
- layout.schedule(() => {
- if (this.running) {
- if (layout.time != 0) {
- layout.time -= 1;
- let minute = Math.floor(layout.time / 60);
- let second = layout.time % 60;
- layout.Count_Down_Des.string = (minute >= 10 ? minute : '0' + minute) + ':' + (second >= 10 ? second : '0' + second);
- } else {
- if (layout.Container.idioms.length > 0) {
- (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).show(_crd && UI_Fail === void 0 ? (_reportPossibleCrUseOfUI_Fail({
- error: Error()
- }), UI_Fail) : UI_Fail);
- this.running = false;
- }
- }
- if (layout.Container.idioms.length <= 0) {
- console.log('恭喜你,通关成功');
- (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.set_pass_level(1);
- (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.set_max_floor((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_max_floor() + 1);
- (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.setDirty();
- (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.save_rank_floor();
- (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.save();
- (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).show(_crd && UI_Win === void 0 ? (_reportPossibleCrUseOfUI_Win({
- error: Error()
- }), UI_Win) : UI_Win);
- this.running = false;
- }
- }
- }, 1.0);
- this.evt.on(this.evt.key.pause, this.pause, this);
- this.evt.on(this.evt.key.resume, this.resume, this);
- this.evt.on(this.evt.key.next_level, this.new_level, this);
- this.evt.on(this.evt.key.update_remain, this.remain, this);
- this.evt.on(this.evt.key.update_ui_idioms, this.ui_idioms, this);
- }
- new_level() {
- let level = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_max_floor();
- const layout = this.getLayout();
- layout.time = layout.Container.level_config[level].time;
- let minute = Math.floor(layout.Container.level_config[level].time / 60);
- let second = layout.Container.level_config[level].time % 60;
- layout.Count_Down_Des.string = (minute >= 10 ? minute : '0' + minute) + ':' + (second >= 10 ? second : '0' + second);
- layout.Remain_Cube_Des.string = '剩余:' + (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
- error: Error()
- }), UI_Idioms) : UI_Idioms).idioms.length * 2;
- layout.Level.string = '第' + ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({
- error: Error()
- }), Hall) : Hall).getInstance().player.get_max_floor() + 1) + '关';
- this.running = true;
- }
- remain() {
- const layout = this.getLayout();
- layout.Remain_Cube_Des.string = '剩余:' + (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
- error: Error()
- }), UI_Idioms) : UI_Idioms).idioms.length * 2;
- }
- ui_idioms() {
- (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({
- error: Error()
- }), UI_Idioms) : UI_Idioms).init();
- }
- pause() {
- this.running = false;
- }
- resume() {
- this.running = true;
- }
- onDispose() {
- const layout = this.getLayout();
- layout.unscheduleAllCallbacks();
- }
- }) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=0a4102a464059398e43bc26dd3fe1faf79989cb3.js.map
|