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:
@@ -112,6 +112,15 @@ export class ToolbarManager extends BaseManager {
|
||||
this.toolbar?.setBtnActive(id, active);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新按钮图标
|
||||
* @param id 按钮 ID
|
||||
* @param icon 新的 SVG 图标字符串
|
||||
*/
|
||||
public updateButtonIcon(id: string, icon: string) {
|
||||
this.toolbar?.updateButtonIcon(id, icon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置工具栏可见性
|
||||
* @param visible 是否可见
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user