feat: add camera switch, fix click event/dialog resize/map state sync

- fix(engine): adapt click handler to base engine array format data[0].url/ids
- feat(toolbar): add perspective/orthographic camera switch button with dynamic icon
- fix(dialog): clamp resize to container bounds to prevent overflow
- feat(demo): add auto-combine feature with robust URL parsing and validation
- fix(walk): close minimap on walk exit and sync map state between toolbar and walk panel
- fix(engine): correct MiniMap getstate() casing to match base engine API
- build: rebuild demo libs
This commit is contained in:
yuding
2026-03-05 17:43:50 +08:00
parent b96e5f3262
commit 507112fcf9
18 changed files with 6890 additions and 6501 deletions

View File

@@ -44,6 +44,8 @@ export class WalkControlManager extends BaseManager {
onPlanViewToggle: (isActive) => {
console.log('[WalkControl] 小地图:', isActive);
this.engineComponent?.toggleMiniMap();
// 同步工具栏地图按钮的激活状态
this.registry.toolbar?.setBtnActive('map', isActive);
this.emit('walk:plan-view-toggle', { isActive });
},
onPathModeToggle: (isActive) => {
@@ -91,7 +93,9 @@ export class WalkControlManager extends BaseManager {
});
this.panel.init();
// 同步当前地图状态到漫游面板
const mapState = this.engineComponent?.getMiniMapState() ?? false;
this.panel.setPlanViewActive(mapState);
if (this.registry.container) {
this.panel.element.style.position = 'absolute';
@@ -110,6 +114,11 @@ export class WalkControlManager extends BaseManager {
public hide(): void {
this.pathManager?.hide();
// 如果小地图开着,先关闭它
if (this.engineComponent?.getMiniMapState()) {
this.engineComponent.toggleMiniMap();
}
console.log('[WalkControl] 关闭漫游面板,退出第一人称模式');
this.engineComponent?.deactivateFirstPersonMode();
@@ -118,6 +127,9 @@ export class WalkControlManager extends BaseManager {
this.panel = null;
}
// 同步工具栏地图按钮的激活状态
this.registry.toolbar?.setBtnActive('map', false);
if (this.registry.toolbar) {
this.registry.toolbar.show();
}