refactor: sync managers and section box actions
Wire section box scale/reverse/reset to clipping APIs and sync demo artifacts.
This commit is contained in:
@@ -3,6 +3,8 @@ import { getIcon } from '../../../../../utils/icon-manager';
|
||||
import { ManagerRegistry } from '../../../../../core/manager-registry';
|
||||
|
||||
export const createInfoButton = (): ButtonConfig => {
|
||||
const registry = ManagerRegistry.getInstance();
|
||||
|
||||
return {
|
||||
id: 'info',
|
||||
groupId: 'group-2',
|
||||
@@ -11,8 +13,7 @@ export const createInfoButton = (): ButtonConfig => {
|
||||
icon: getIcon('信息'),
|
||||
keepActive: false,
|
||||
onClick: () => {
|
||||
const registry = ManagerRegistry.getInstance();
|
||||
registry.emit('ui:open-dialog', { id: 'info' });
|
||||
registry.engineInfo?.show();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -5,14 +5,6 @@ import { ManagerRegistry } from '../../../../../core/manager-registry';
|
||||
export const createMapButton = (): ButtonConfig => {
|
||||
const registry = ManagerRegistry.getInstance();
|
||||
|
||||
registry.on('map:opened', () => {
|
||||
registry.toolbar?.setBtnActive('map', true);
|
||||
});
|
||||
|
||||
registry.on('map:closed', () => {
|
||||
registry.toolbar?.setBtnActive('map', false);
|
||||
});
|
||||
|
||||
return {
|
||||
id: 'map',
|
||||
groupId: 'group-1',
|
||||
@@ -22,11 +14,7 @@ export const createMapButton = (): ButtonConfig => {
|
||||
keepActive: true,
|
||||
icon: getIcon('地图'),
|
||||
onClick: () => {
|
||||
if (registry.map?.isOpen()) {
|
||||
registry.map?.hide();
|
||||
} else {
|
||||
registry.map?.show();
|
||||
}
|
||||
registry.engine3d?.toggleMiniMap();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user