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
): 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') ??

View File

@ -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);
});