From f4757d7cc31e1ef7cfd3c8a05b162972dbc809ae Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Fri, 19 Jan 2024 22:18:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E5=85=B7=E6=A0=8F=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- idea.md | 2 +- src/core/main/custom/toolbar.ts | 21 --------------------- src/core/main/init/toolbar.tsx | 5 +---- src/ui/toolEditor.vue | 4 ++-- 4 files changed, 4 insertions(+), 28 deletions(-) diff --git a/idea.md b/idea.md index 47b16bd..58e3b0b 100644 --- a/idea.md +++ b/idea.md @@ -70,7 +70,7 @@ dam4.png ---- 存档 59 [] 小地图显示框,可以选择是否显示剩余怪物数量等 [x] 怪物死亡特效 [] 区域名称显示特效,3D 粒子特效 -[] 单独的工具栏,可以自定义按键 +[x] 单独的工具栏,可以自定义按键 [] 完全 ts 化 [] 平行光(待定) [] 视角控制系统 diff --git a/src/core/main/custom/toolbar.ts b/src/core/main/custom/toolbar.ts index 1e928c4..2352c58 100644 --- a/src/core/main/custom/toolbar.ts +++ b/src/core/main/custom/toolbar.ts @@ -321,24 +321,3 @@ CustomToolbar.register( }; } ); - -hook.once('reset', () => { - const toolbar = new CustomToolbar('test'); - toolbar - .add<'hotkey'>({ - id: 'test1', - type: 'hotkey', - assist: 0, - key: KeyCode.KeyX - }) - .add<'assistKey'>({ - id: 'test2', - type: 'assistKey', - assist: KeyCode.Ctrl - }) - .add<'item'>({ - id: 'test3', - type: 'item', - item: 'book' - }); -}); diff --git a/src/core/main/init/toolbar.tsx b/src/core/main/init/toolbar.tsx index 6af5933..0851c6e 100644 --- a/src/core/main/init/toolbar.tsx +++ b/src/core/main/init/toolbar.tsx @@ -114,10 +114,7 @@ function KeyToolEdtior(props: CustomToolbarProps<'hotkey'>) { }; const getKeyShow = (key: KeyCode, assist: number) => { - return ( - unwarpAssist(assist) + - (key === KeyCode.Unknown ? '' : KeyCodeUtils.toString(key)) - ); + return unwarpAssist(assist) + KeyCodeUtils.toString(key); }; return ( diff --git a/src/ui/toolEditor.vue b/src/ui/toolEditor.vue index 2ca781d..addbb0e 100644 --- a/src/ui/toolEditor.vue +++ b/src/ui/toolEditor.vue @@ -45,7 +45,7 @@ :type="isMobile ? 'horizontal' : 'vertical'" >