/** * 漫游路径对话框管理器 * 负责管理漫游路径设置对话框的显示和交互 */ import { BaseDialogManager } from '../core/base-dialog-manager'; import { WalkPathPanel } from '../components/walk-path-panel'; /** * 漫游路径对话框管理器 * 继承自 BaseDialogManager,提供漫游路径配置的对话框管理功能 */ export class WalkPathDialogManager extends BaseDialogManager { /** 漫游路径面板实例 */ private panel: WalkPathPanel | null = null; /** 对话框唯一标识 */ protected get dialogId() { return 'walk-path-dialog'; } /** 对话框标题(国际化 key) */ protected get dialogTitle() { return 'walkControl.path.dialogTitle'; } /** 对话框宽度 */ protected get dialogWidth() { return 300; } /** 对话框高度 */ protected get dialogHeight(): number { return 450; } /** 初始化 */ public init(): void {} /** * 获取对话框位置 * 定位在容器右上角 */ protected getDialogPosition() { const container = this.registry.container; if (!container) return { x: 100, y: 100 }; const paddingRight = 20; const paddingTop = 20; const containerWidth = container.clientWidth; return { x: containerWidth - this.dialogWidth - paddingRight, y: paddingTop }; } /** 创建对话框内容 */ protected createContent(): HTMLElement { this.panel = new WalkPathPanel(); this.panel.init(); return this.panel.element; } /** 对话框关闭时的回调 */ protected onDialogClose(): void { if (this.registry.walkControl && this.registry.walkControl.panel) { this.registry.walkControl.panel.setPathModeActive(false); } } /** 销毁前的清理 */ protected onBeforeDestroy(): void { if (this.panel) { this.panel.destroy(); this.panel = null; } } }