mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 12:49:25 +08:00
fix: statusBar & load
This commit is contained in:
parent
3f195fdc72
commit
938bd18808
@ -276,10 +276,11 @@ function core() {
|
|||||||
core.prototype.init = async function (coreData, callback) {
|
core.prototype.init = async function (coreData, callback) {
|
||||||
this._forwardFuncs();
|
this._forwardFuncs();
|
||||||
for (var key in coreData) core[key] = coreData[key];
|
for (var key in coreData) core[key] = coreData[key];
|
||||||
|
await this._loadGameProcess();
|
||||||
|
await this._loadPluginAsync();
|
||||||
this._init_flags();
|
this._init_flags();
|
||||||
this._init_platform();
|
this._init_platform();
|
||||||
this._init_others();
|
this._init_others();
|
||||||
await this._loadGameProcess();
|
|
||||||
|
|
||||||
var b = main.mode == 'editor';
|
var b = main.mode == 'editor';
|
||||||
// 初始化画布
|
// 初始化画布
|
||||||
@ -304,26 +305,60 @@ core.prototype.init = async function (coreData, callback) {
|
|||||||
core.prototype.initSync = function (coreData, callback) {
|
core.prototype.initSync = function (coreData, callback) {
|
||||||
this._forwardFuncs();
|
this._forwardFuncs();
|
||||||
for (var key in coreData) core[key] = coreData[key];
|
for (var key in coreData) core[key] = coreData[key];
|
||||||
|
this._loadGameProcessSync();
|
||||||
|
this._loadPluginSync();
|
||||||
this._init_flags();
|
this._init_flags();
|
||||||
this._init_platform();
|
this._init_platform();
|
||||||
this._init_others();
|
this._init_others();
|
||||||
this._loadGameProcessSync();
|
|
||||||
|
|
||||||
core.loader._load(function () {
|
core.loader._load(function () {
|
||||||
core._afterLoadResources(callback);
|
core._afterLoadResources(callback);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
core.prototype._loadPluginAsync = async function () {
|
||||||
|
if (!main.useCompress) {
|
||||||
|
await main.loadScript(`project/plugins.js?v=${main.version}`);
|
||||||
|
}
|
||||||
|
this._initPlugins();
|
||||||
|
};
|
||||||
|
|
||||||
|
core.prototype._loadPluginSync = function () {
|
||||||
|
if (main.useCompress) main.loadMod('project', 'project', () => 0);
|
||||||
|
else {
|
||||||
|
main.pureData.forEach(v => main.loadMod('project', v, () => 0));
|
||||||
|
}
|
||||||
|
this._initPlugins();
|
||||||
|
};
|
||||||
|
|
||||||
|
core.prototype._initPlugins = function () {
|
||||||
|
for (const [key, value] of Object.entries(
|
||||||
|
plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1
|
||||||
|
)) {
|
||||||
|
try {
|
||||||
|
value?.call(plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Plugin '${key}' init failed.`);
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
core.prototype._loadGameProcess = async function () {
|
core.prototype._loadGameProcess = async function () {
|
||||||
// 加载游戏进程代码
|
// 加载游戏进程代码
|
||||||
if (main.pluginUseCompress) {
|
if (main.pluginUseCompress && main.replayChecking) {
|
||||||
await main.loadScript(`project/processG.min.js?v=${main.version}`);
|
await main.loadScript(`project/processG.min.js?v=${main.version}`);
|
||||||
} else {
|
} else {
|
||||||
// if (main.mode === 'play') {
|
if (main.mode === 'editor') {
|
||||||
// await main.loadScript(`src/game/index.ts`, true);
|
if (main.pluginUseCompress) {
|
||||||
// } else {
|
await main.loadScript(`project/processG.min.js`);
|
||||||
// await main.loadScript(`src/game/index.esm.ts`, true);
|
} else {
|
||||||
// }
|
await main.loadScript(`src/game/index.esm.ts`, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (main.useCompress) {
|
||||||
|
await main.loadScript(`project/project.min.js`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -76,6 +76,24 @@ maps.prototype.loadFloor = function (floorId, map) {
|
|||||||
|
|
||||||
maps.prototype._loadFloor_doNotCopy = function () {
|
maps.prototype._loadFloor_doNotCopy = function () {
|
||||||
// see src/plugin/game/fiveLayer.js
|
// see src/plugin/game/fiveLayer.js
|
||||||
|
return [
|
||||||
|
'firstArrive',
|
||||||
|
'eachArrive',
|
||||||
|
'blocks',
|
||||||
|
'parallelDo',
|
||||||
|
'map',
|
||||||
|
'bgmap',
|
||||||
|
'fgmap',
|
||||||
|
'bg2map',
|
||||||
|
'fg2map',
|
||||||
|
'events',
|
||||||
|
'changeFloor',
|
||||||
|
'afterBattle',
|
||||||
|
'afterGetItem',
|
||||||
|
'afterOpenDoor',
|
||||||
|
'cannotMove',
|
||||||
|
'enemy'
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
/// 根据需求解析出blocks
|
/// 根据需求解析出blocks
|
||||||
|
@ -267,8 +267,7 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.status-item {
|
.status-item {
|
||||||
display: flex;
|
position: relative;
|
||||||
flex-direction: row;
|
|
||||||
max-width: 17.5vw;
|
max-width: 17.5vw;
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
Loading…
Reference in New Issue
Block a user