mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 23:29:27 +08:00
fix: 编辑器报错 & 设置勇士朝向
This commit is contained in:
parent
80f154694a
commit
ac8a61558e
@ -36,6 +36,7 @@
|
|||||||
"@babel/preset-env": "^7.25.3",
|
"@babel/preset-env": "^7.25.3",
|
||||||
"@rollup/plugin-babel": "^6.0.4",
|
"@rollup/plugin-babel": "^6.0.4",
|
||||||
"@rollup/plugin-commonjs": "^25.0.8",
|
"@rollup/plugin-commonjs": "^25.0.8",
|
||||||
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||||
"@rollup/plugin-replace": "^5.0.7",
|
"@rollup/plugin-replace": "^5.0.7",
|
||||||
"@rollup/plugin-terser": "^0.4.4",
|
"@rollup/plugin-terser": "^0.4.4",
|
||||||
|
@ -67,6 +67,9 @@ devDependencies:
|
|||||||
'@rollup/plugin-commonjs':
|
'@rollup/plugin-commonjs':
|
||||||
specifier: ^25.0.8
|
specifier: ^25.0.8
|
||||||
version: 25.0.8(rollup@3.29.4)
|
version: 25.0.8(rollup@3.29.4)
|
||||||
|
'@rollup/plugin-json':
|
||||||
|
specifier: ^6.1.0
|
||||||
|
version: 6.1.0(rollup@3.29.4)
|
||||||
'@rollup/plugin-node-resolve':
|
'@rollup/plugin-node-resolve':
|
||||||
specifier: ^15.2.3
|
specifier: ^15.2.3
|
||||||
version: 15.2.3(rollup@3.29.4)
|
version: 15.2.3(rollup@3.29.4)
|
||||||
@ -2527,6 +2530,19 @@ packages:
|
|||||||
rollup: 3.29.4
|
rollup: 3.29.4
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@rollup/plugin-json@6.1.0(rollup@3.29.4):
|
||||||
|
resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==}
|
||||||
|
engines: {node: '>=14.0.0'}
|
||||||
|
peerDependencies:
|
||||||
|
rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
|
||||||
|
peerDependenciesMeta:
|
||||||
|
rollup:
|
||||||
|
optional: true
|
||||||
|
dependencies:
|
||||||
|
'@rollup/pluginutils': 5.1.0(rollup@3.29.4)
|
||||||
|
rollup: 3.29.4
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@rollup/plugin-node-resolve@15.2.3(rollup@3.29.4):
|
/@rollup/plugin-node-resolve@15.2.3(rollup@3.29.4):
|
||||||
resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==}
|
resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==}
|
||||||
engines: {node: '>=14.0.0'}
|
engines: {node: '>=14.0.0'}
|
||||||
|
@ -16,6 +16,7 @@ import EventEmitter from 'events';
|
|||||||
import { WebSocket, WebSocketServer } from 'ws';
|
import { WebSocket, WebSocketServer } from 'ws';
|
||||||
import chokidar from 'chokidar';
|
import chokidar from 'chokidar';
|
||||||
import commonjs from '@rollup/plugin-commonjs';
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import json from '@rollup/plugin-json';
|
||||||
|
|
||||||
const base = './public';
|
const base = './public';
|
||||||
|
|
||||||
@ -151,7 +152,8 @@ async function getEsmFile(
|
|||||||
plugins: [
|
plugins: [
|
||||||
typescript({ sourceMap: true }),
|
typescript({ sourceMap: true }),
|
||||||
nodeResolve(),
|
nodeResolve(),
|
||||||
commonjs()
|
commonjs(),
|
||||||
|
json()
|
||||||
],
|
],
|
||||||
onwarn() {}
|
onwarn() {}
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { debounce } from 'lodash-es';
|
import { debounce } from 'lodash-es';
|
||||||
import logInfo from '@/data/logger.json';
|
import logInfo from '../../data/logger.json';
|
||||||
|
|
||||||
// todo: 使用格式化输出?
|
// todo: 使用格式化输出?
|
||||||
|
|
||||||
|
@ -65,6 +65,10 @@ export function init() {
|
|||||||
return moveSteps;
|
return moveSteps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setHeroDirection(dir: Dir) {
|
||||||
|
if (!heroMover.moving) heroMover.moveDir = dir;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成跳跃函数
|
* 生成跳跃函数
|
||||||
*/
|
*/
|
||||||
@ -164,6 +168,7 @@ export function init() {
|
|||||||
}
|
}
|
||||||
if (name === 'direction') {
|
if (name === 'direction') {
|
||||||
adapters['hero-adapter']?.sync('turn', value);
|
adapters['hero-adapter']?.sync('turn', value);
|
||||||
|
setHeroDirection(value as Dir);
|
||||||
} else if (name === 'x') {
|
} else if (name === 'x') {
|
||||||
adapters['hero-adapter']?.sync('setHeroLoc', value);
|
adapters['hero-adapter']?.sync('setHeroLoc', value);
|
||||||
} else {
|
} else {
|
||||||
|
2
src/types/ui.d.ts
vendored
2
src/types/ui.d.ts
vendored
@ -799,11 +799,13 @@ interface Ui {
|
|||||||
drawBook(index: number): void;
|
drawBook(index: number): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated
|
||||||
* 绘制楼层传送器
|
* 绘制楼层传送器
|
||||||
*/
|
*/
|
||||||
drawFly(page: number): void;
|
drawFly(page: number): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated
|
||||||
* 获得所有应该在道具栏显示的某个类型道具
|
* 获得所有应该在道具栏显示的某个类型道具
|
||||||
*/
|
*/
|
||||||
getToolboxItems<T extends Exclude<ItemCls, 'items'>>(cls: T): ItemIdOf<T>[];
|
getToolboxItems<T extends Exclude<ItemCls, 'items'>>(cls: T): ItemIdOf<T>[];
|
||||||
|
Loading…
Reference in New Issue
Block a user