From 3bbb502fd73ade44d62906cf00b7238efd57ca48 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Mon, 18 Nov 2024 23:27:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E6=AC=A1=E8=BF=9B=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E6=B2=A1=E6=9C=89=E5=B7=A5=E5=85=B7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/main/custom/toolbar.ts | 8 +++++++- src/core/main/init/toolbar.tsx | 8 -------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/core/main/custom/toolbar.ts b/src/core/main/custom/toolbar.ts index e23bce5..0834f55 100644 --- a/src/core/main/custom/toolbar.ts +++ b/src/core/main/custom/toolbar.ts @@ -78,6 +78,12 @@ interface Misc { display: Component ): void; + /** + * 为一类杂项工具设置激活信息 + * @param id 杂项工具的id + * @param activable 是否可激活 + * @param actived 获取当前是否激活的函数 + */ bindActivable(id: string, activable: boolean, actived?: ActivedFn): void; /** @@ -383,7 +389,7 @@ Mota.require('var', 'hook').on('reset', () => { Mota.require('var', 'hook').once('reset', () => { const mainStorage = GameStorage.for(GameStorage.fromGame('main')); mainStorage.read(); - if (mainStorage.getValue('played', false)) { + if (!mainStorage.getValue('played', false)) { mainStorage.setValue('played', true); const defaultsTool = CustomToolbar.list.find(v => v.id === '@defaults') ?? diff --git a/src/core/main/init/toolbar.tsx b/src/core/main/init/toolbar.tsx index f6efa2f..a87eee2 100644 --- a/src/core/main/init/toolbar.tsx +++ b/src/core/main/init/toolbar.tsx @@ -958,14 +958,6 @@ Mota.require('var', 'hook').once('reset', () => { }, h(LayoutOutlined) ); - // CustomToolbar.misc.register( - // 'drag', - // '地图拖动', - // () => { - // // todo - // }, - // h('span', '拖动地图') - // ); CustomToolbar.misc.bindActivable('minimap', true, () => minimapTool); });