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