feat: add settings dialog with render mode selection

- Add SettingDialogManager with radio-style render mode picker (simple/balance/advanced)
- Add getRenderMode/setRenderMode API to Engine and EngineManager layers
- Wire setting toolbar button to toggle the settings dialog
- Add i18n keys for settings dialog (zh-CN/en-US)
- Add version display at bottom-right of engine wrapper
- Bump version to 1.1.7, rebuild and sync demo libs
This commit is contained in:
yuding
2026-02-28 11:26:59 +08:00
parent a9c8317b10
commit 837177f3f2
15 changed files with 875 additions and 525 deletions

View File

@@ -2,7 +2,7 @@ import type { ButtonConfig } from '../../../index.type';
import { getIcon } from '../../../../../utils/icon-manager';
import type { ManagerRegistry } from '../../../../../core/manager-registry';
export const createSettingButton = (_registry?: ManagerRegistry): ButtonConfig => {
export const createSettingButton = (registry?: ManagerRegistry): ButtonConfig => {
return {
id: 'setting',
groupId: 'group-2',
@@ -10,8 +10,8 @@ export const createSettingButton = (_registry?: ManagerRegistry): ButtonConfig =
label: 'toolbar.setting',
icon: getIcon('设置'),
keepActive: false,
onClick: (button) => {
console.log('设置按钮被点击:', button.id);
onClick: (_button) => {
registry?.setting?.toggle();
}
};
};

View File

@@ -557,6 +557,33 @@ export class Engine implements IBimComponent {
// ==================== 结束:剖切功能 ====================
// ==================== 渲染模式 ====================
/**
* 获取当前渲染模式
* @returns 'simple' | 'balance' | 'advanced'
*/
public getRenderMode(): string {
if (!this._isInitialized || !this.engine?.engineModelModule) {
return 'balance';
}
return this.engine.engineModelModule.getCurrentMode();
}
/**
* 设置渲染模式
* @param mode 'simple'(性能模式) | 'balance'(平衡模式) | 'advanced'(效果模式)
*/
public setRenderMode(mode: 'simple' | 'balance' | 'advanced'): void {
if (!this._isInitialized || !this.engine?.engineModelModule) {
console.warn('[Engine] Cannot set render mode: engine not initialized.');
return;
}
this.engine.engineModelModule.setMode(mode);
}
// ==================== 结束:渲染模式 ====================
// ==================== 漫游功能 ====================
/** 漫游模式是否激活 */