diff --git a/package.json b/package.json index 3557de4..5252982 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@babel/preset-env": "^7.25.3", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^25.0.8", + "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "^5.0.7", "@rollup/plugin-terser": "^0.4.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 37cef07..d785573 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,6 +67,9 @@ devDependencies: '@rollup/plugin-commonjs': specifier: ^25.0.8 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': specifier: ^15.2.3 version: 15.2.3(rollup@3.29.4) @@ -2527,6 +2530,19 @@ packages: rollup: 3.29.4 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): resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} engines: {node: '>=14.0.0'} diff --git a/script/dev.ts b/script/dev.ts index 85cf596..52379d0 100644 --- a/script/dev.ts +++ b/script/dev.ts @@ -16,6 +16,7 @@ import EventEmitter from 'events'; import { WebSocket, WebSocketServer } from 'ws'; import chokidar from 'chokidar'; import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; const base = './public'; @@ -151,7 +152,8 @@ async function getEsmFile( plugins: [ typescript({ sourceMap: true }), nodeResolve(), - commonjs() + commonjs(), + json() ], onwarn() {} }); diff --git a/src/core/common/logger.ts b/src/core/common/logger.ts index cd10fdc..433d762 100644 --- a/src/core/common/logger.ts +++ b/src/core/common/logger.ts @@ -1,5 +1,5 @@ import { debounce } from 'lodash-es'; -import logInfo from '@/data/logger.json'; +import logInfo from '../../data/logger.json'; // todo: 使用格式化输出? diff --git a/src/plugin/game/fallback.ts b/src/plugin/game/fallback.ts index dc0f5ff..1f84be7 100644 --- a/src/plugin/game/fallback.ts +++ b/src/plugin/game/fallback.ts @@ -65,6 +65,10 @@ export function init() { return moveSteps; } + function setHeroDirection(dir: Dir) { + if (!heroMover.moving) heroMover.moveDir = dir; + } + /** * 生成跳跃函数 */ @@ -164,6 +168,7 @@ export function init() { } if (name === 'direction') { adapters['hero-adapter']?.sync('turn', value); + setHeroDirection(value as Dir); } else if (name === 'x') { adapters['hero-adapter']?.sync('setHeroLoc', value); } else { diff --git a/src/types/ui.d.ts b/src/types/ui.d.ts index ab2042b..d8d755c 100644 --- a/src/types/ui.d.ts +++ b/src/types/ui.d.ts @@ -799,11 +799,13 @@ interface Ui { drawBook(index: number): void; /** + * @deprecated * 绘制楼层传送器 */ drawFly(page: number): void; /** + * @deprecated * 获得所有应该在道具栏显示的某个类型道具 */ getToolboxItems>(cls: T): ItemIdOf[];