diff --git a/public/main.js b/public/main.js index 0758cc0..de1eeaa 100644 --- a/public/main.js +++ b/public/main.js @@ -305,10 +305,15 @@ main.prototype.loadSync = function (mode, callback) { }); core.initSync(coreData, callback); + main.loading.emit('coreLoaded'); + main.loading.emit('coreInit'); + core.initStatus.maps = core.maps._initMaps(); core.resize(); main.core = core; core.completeAchievement = () => 0; + + core.plugin = { drawLight: 0 }; }; main.prototype.loadAsync = async function (mode, callback) { @@ -402,20 +407,30 @@ main.prototype.loadAsync = async function (mode, callback) { ].forEach(function (t) { coreData[t] = main[t]; }); - await core.init(coreData, callback); - if (main.mode === 'play') main.loading.emit('coreInit'); - core.initStatus.maps = core.maps._initMaps(); + if (main.mode === 'play') { + await core.init(coreData, callback); + main.loading.emit('coreInit'); + core.initStatus.maps = core.maps._initMaps(); + } else { + await core.init(coreData, () => { + callback(); + core.initStatus.maps = core.maps._initMaps(); + }); + main.loading.emit('coreInit'); + } core.resize(); main.core = core; + if (main.mode === 'editor') return; + // 自动放缩最大化 - let auto = Mota.require('var', 'mainSetting').getValue('autoSclae'); + let auto = Mota.require('var', 'mainSetting').getValue('autoScale', true); if (auto && !core.domStyle.isVertical) { try { - Mota.Plugin.require('utils_g').maxGameScale(); + Mota.Plugin.require('utils_g').maxGameScale(1); requestAnimationFrame(() => { var style = getComputedStyle(main.dom.gameGroup); var height = parseFloat(style.height); diff --git a/public/project/floors/MT48.js b/public/project/floors/MT48.js index 46b0ebf..82a07a1 100644 --- a/public/project/floors/MT48.js +++ b/public/project/floors/MT48.js @@ -131,7 +131,16 @@ main.floors.MT48= "value": "1" } ], - "false": [] + "false": [ + { + "type": "changeFloor", + "floorId": "MT49", + "loc": [ + 7, + 14 + ] + } + ] } ] }, diff --git a/script/dev.ts b/script/dev.ts index 364c529..5d89931 100644 --- a/script/dev.ts +++ b/script/dev.ts @@ -527,6 +527,7 @@ function watchProject() { /_.*/ ] }); + watcher.removeAllListeners(); watcher.on('change', async path => { // 楼层热重载 if (/project(\/|\\)floors(\/|\\).*\.js$/.test(path)) {