refactor: KeyCode 移动至 @motajs/client-base

This commit is contained in:
unanmed 2025-03-05 11:32:07 +08:00
parent 693e531639
commit 50292e2d8a
18 changed files with 23 additions and 15 deletions

View File

@ -0,0 +1,3 @@
{
"name": "@motajs/client-base"
}

View File

@ -0,0 +1 @@
export * from './keyCodes';

View File

@ -1,6 +1,8 @@
{ {
"name": "@motajs/client", "name": "@motajs/client",
"dependencies": { "dependencies": {
"@motajs/render": "workspace:*" "@motajs/render": "workspace:*",
"@motajs/client-base": "workspace:*",
"@motajs/system": "workspace:*"
} }
} }

View File

@ -1,3 +1,3 @@
export * from './keyCodes'; export * as Base from '@motajs/client-base';
export * as Render from '@motajs/render'; export * as Render from '@motajs/render';
export * as System from '@motajs/system';

View File

@ -3,6 +3,7 @@
"dependencies": { "dependencies": {
"@motajs/render": "workspace:*", "@motajs/render": "workspace:*",
"@motajs/common": "workspace:*", "@motajs/common": "workspace:*",
"@motajs/client": "workspace:*" "@motajs/client": "workspace:*",
"@motajs/client-base": "workspace:*"
} }
} }

View File

@ -41,7 +41,7 @@ import { GameUi } from '@/core/main/custom/ui';
import Column from '../components/colomn.vue'; import Column from '../components/colomn.vue';
import { mainUi } from '@/core/main/init/ui'; import { mainUi } from '@/core/main/init/ui';
import { computed, onMounted, onUnmounted, reactive, ref } from 'vue'; import { computed, onMounted, onUnmounted, reactive, ref } from 'vue';
import { KeyCode, KeyCodeUtils } from '@motajs/client'; import { KeyCode, KeyCodeUtils } from '@motajs/client-base';
import { generateBinary, keycode } from '../utils'; import { generateBinary, keycode } from '../utils';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
import { gameKey } from '@/core/main/custom/hotkey'; import { gameKey } from '@/core/main/custom/hotkey';

View File

@ -3,7 +3,7 @@ import { MessageApi } from 'ant-design-vue/lib/message';
import { isNil } from 'lodash-es'; import { isNil } from 'lodash-es';
import { Animation, sleep, TimingFn } from 'mutate-animate'; import { Animation, sleep, TimingFn } from 'mutate-animate';
import { Ref, ref } from 'vue'; import { Ref, ref } from 'vue';
import { EVENT_KEY_CODE_MAP, KeyCode } from '@motajs/client'; import { EVENT_KEY_CODE_MAP, KeyCode } from '@motajs/client-base';
import axios from 'axios'; import axios from 'axios';
import { decompressFromBase64 } from 'lz-string'; import { decompressFromBase64 } from 'lz-string';
import { Keyboard, KeyboardEmits } from '@/core/main/custom/keyboard'; import { Keyboard, KeyboardEmits } from '@/core/main/custom/keyboard';

View File

@ -11,7 +11,7 @@ import {
mainSetting, mainSetting,
settingStorage settingStorage
} from './main/setting'; } from './main/setting';
import { KeyCode } from '@motajs/client'; import { KeyCode } from '@motajs/client-base';
import '@/plugin'; import '@/plugin';
import './package'; import './package';
import { CustomToolbar } from './main/custom/toolbar'; import { CustomToolbar } from './main/custom/toolbar';

View File

@ -1,4 +1,4 @@
import { KeyCode } from '@motajs/client'; import { KeyCode } from '@motajs/client-base';
import { Hotkey, HotkeyData } from '../custom/hotkey'; import { Hotkey, HotkeyData } from '../custom/hotkey';
import type { HeroMover, IMoveController } from '@/game/state/move'; import type { HeroMover, IMoveController } from '@/game/state/move';
import { Ticker } from 'mutate-animate'; import { Ticker } from 'mutate-animate';

View File

@ -1,4 +1,4 @@
import { KeyCode } from '@motajs/client'; import { KeyCode } from '@motajs/client-base';
import { import {
deleteWith, deleteWith,
generateBinary, generateBinary,

View File

@ -1,5 +1,5 @@
import { EventEmitter, Listener } from '@motajs/legacy-common'; import { EventEmitter, Listener } from '@motajs/legacy-common';
import { KeyCode } from '@motajs/client'; import { KeyCode } from '@motajs/client-base';
import { gameKey } from './hotkey'; import { gameKey } from './hotkey';
import { unwarpBinary } from './hotkey'; import { unwarpBinary } from './hotkey';
import { deleteWith, flipBinary } from '@motajs/legacy-ui'; import { deleteWith, flipBinary } from '@motajs/legacy-ui';

View File

@ -1,4 +1,4 @@
import { KeyCode } from '@motajs/client'; import { KeyCode } from '@motajs/client-base';
import { gameKey, HotkeyJSON } from '../custom/hotkey'; import { gameKey, HotkeyJSON } from '../custom/hotkey';
import { import {
openDanmakuPoster, openDanmakuPoster,

View File

@ -1,4 +1,4 @@
import { KeyCode } from '@motajs/client'; import { KeyCode } from '@motajs/client-base';
import { Keyboard } from '../custom/keyboard'; import { Keyboard } from '../custom/keyboard';
const qweKey = new Keyboard('qwe'); // 字母键盘A-Z const qweKey = new Keyboard('qwe'); // 字母键盘A-Z

View File

@ -1,4 +1,4 @@
import { KeyCode, KeyCodeUtils } from '@motajs/client'; import { KeyCode, KeyCodeUtils } from '@motajs/client-base';
import { CustomToolbar } from '../custom/toolbar'; import { CustomToolbar } from '../custom/toolbar';
import BoxAnimate from '@/components/boxAnimate.vue'; import BoxAnimate from '@/components/boxAnimate.vue';
import { checkAssist, unwarpBinary } from '../custom/hotkey'; import { checkAssist, unwarpBinary } from '../custom/hotkey';

View File

@ -13,7 +13,7 @@ import type { MotaSetting, SettingDisplayer } from '@/core/main/setting';
import type { GameStorage } from '@/core/main/storage'; import type { GameStorage } from '@/core/main/storage';
import type { DamageEnemy, EnemyCollection } from './enemy/damage'; import type { DamageEnemy, EnemyCollection } from './enemy/damage';
import type { specials } from './enemy/special'; import type { specials } from './enemy/special';
import type { KeyCode } from '@motajs/client'; import type { KeyCode } from '@motajs/client-base';
import type { Ref } from 'vue'; import type { Ref } from 'vue';
import type * as battle from './enemy/battle'; import type * as battle from './enemy/battle';
import type * as hero from './state/hero'; import type * as hero from './state/hero';

View File

@ -22,7 +22,7 @@ import { gameKey } from '@/core/main/custom/hotkey';
import { generateKeyboardEvent } from '@/core/main/custom/keyboard'; import { generateKeyboardEvent } from '@/core/main/custom/keyboard';
import { transitioned } from '../use'; import { transitioned } from '../use';
import { linear } from 'mutate-animate'; import { linear } from 'mutate-animate';
import { KeyCode } from '@motajs/client'; import { KeyCode } from '@motajs/client-base';
import { Progress } from '../components/misc'; import { Progress } from '../components/misc';
interface ToolbarProps extends DefaultProps { interface ToolbarProps extends DefaultProps {

View File

@ -2,6 +2,7 @@
"name": "@motajs/user", "name": "@motajs/user",
"dependencies": { "dependencies": {
"@motajs/client": "workspace:*", "@motajs/client": "workspace:*",
"@motajs/client-base": "workspace:*",
"@motajs/common": "workspace:*", "@motajs/common": "workspace:*",
"@motajs/render": "workspace:*", "@motajs/render": "workspace:*",
"@motajs/system": "workspace:*", "@motajs/system": "workspace:*",