fix: 首次进游戏没有工具栏

This commit is contained in:
unanmed 2024-11-18 23:27:28 +08:00
parent 63a21c8afa
commit 3bbb502fd7
2 changed files with 7 additions and 9 deletions

View File

@ -78,6 +78,12 @@ interface Misc {
display: Component display: Component
): void; ): void;
/**
*
* @param id id
* @param activable
* @param actived
*/
bindActivable(id: string, activable: boolean, actived?: ActivedFn): void; bindActivable(id: string, activable: boolean, actived?: ActivedFn): void;
/** /**
@ -383,7 +389,7 @@ Mota.require('var', 'hook').on('reset', () => {
Mota.require('var', 'hook').once('reset', () => { Mota.require('var', 'hook').once('reset', () => {
const mainStorage = GameStorage.for(GameStorage.fromGame('main')); const mainStorage = GameStorage.for(GameStorage.fromGame('main'));
mainStorage.read(); mainStorage.read();
if (mainStorage.getValue('played', false)) { if (!mainStorage.getValue('played', false)) {
mainStorage.setValue('played', true); mainStorage.setValue('played', true);
const defaultsTool = const defaultsTool =
CustomToolbar.list.find(v => v.id === '@defaults') ?? CustomToolbar.list.find(v => v.id === '@defaults') ??

View File

@ -958,14 +958,6 @@ Mota.require('var', 'hook').once('reset', () => {
}, },
h(LayoutOutlined) h(LayoutOutlined)
); );
// CustomToolbar.misc.register(
// 'drag',
// '地图拖动',
// () => {
// // todo
// },
// h('span', '拖动地图')
// );
CustomToolbar.misc.bindActivable('minimap', true, () => minimapTool); CustomToolbar.misc.bindActivable('minimap', true, () => minimapTool);
}); });