!1694 新增:开关天空球

pull/1698/MERGE
我是一条懒汉 3 years ago committed by ChenX
parent 17c8366335
commit 015872798f

@ -33,7 +33,7 @@ export interface ICursorConfig extends IBaseOption
export class UserConfig implements IConfigStore
{
private readonly _version = 22;
private readonly _version = 23;
_renderType: RenderType = RenderType.Wireframe;
@observable maxSize: IMaxSizeProps = {
isShow: false,
@ -121,6 +121,7 @@ export class UserConfig implements IConfigStore
@observable openHistoryList = true;
isOpenCabinet: boolean = false; //是否时开启门板、抽屉动作
@observable lightHelper: boolean = false; //是否显示灯光助手
@observable isShowSkyBox: boolean = false;//是否显示天空球,仅在透视相机下显示
constructor()
{
@ -200,6 +201,7 @@ export class UserConfig implements IConfigStore
this.synchronousEnable = false;
this.isLargeIcon = false;
this.isModifyMaterial = false;
this.isShowSkyBox = false;
}
SaveConfig()
{
@ -236,6 +238,7 @@ export class UserConfig implements IConfigStore
synchronousEnable: this.synchronousEnable,
isLargeIcon: this.isLargeIcon,
isModifyMaterial: this.isModifyMaterial,
isShowSkyBox: this.isShowSkyBox,
}
};
}
@ -337,6 +340,10 @@ export class UserConfig implements IConfigStore
{
this.openHistoryList = config.option.openHistoryList;
}
if (config.option.version > 22)
{
this.isShowSkyBox = config.option.isShowSkyBox;
}
}
}

@ -1,4 +1,4 @@
import { Alignment, Button, Classes, HTMLSelect, Intent, Navbar, ProgressBar, Switch } from '@blueprintjs/core';
import { Alignment, Button, Classes, HTMLSelect, Intent, Navbar, Position, ProgressBar, Switch, Tooltip } from '@blueprintjs/core';
import { inject, observer } from 'mobx-react';
import * as React from 'react';
import { app } from '../../ApplicationServices/Application';
@ -278,6 +278,14 @@ export class DownPanel extends React.Component<{ store?: DownPanelStore; }, {}>
e.currentTarget.blur();
return;
}
if (key === 'isShowSkyBox')
{
userConfig.isShowSkyBox = !userConfig.isShowSkyBox;
app.PerCameraUseSkyBox = userConfig.isShowSkyBox;
e.currentTarget.blur();
await userConfigStore.SaveConfig(BoardModalType.UserConfig, userConfig);
return;
}
this.props.store[key] = e.currentTarget.checked;
if (!app.Viewer.isLayout)
@ -428,6 +436,20 @@ export class DownPanel extends React.Component<{ store?: DownPanelStore; }, {}>
e.currentTarget.blur();
}}
/>
<div style={switchStyle}>
<Tooltip
content="仅在透视相机下显示"
position={Position.TOP}
>
<Switch
checked={userConfig.isShowSkyBox}
label='天空球'
alignIndicator={Alignment.RIGHT}
data-key='isShowSkyBox'
onChange={this.handleChange}
/>
</Tooltip>
</div>
<Switch
checked={userConfig.lightHelper}
data-key="lightHelper"
@ -437,7 +459,8 @@ export class DownPanel extends React.Component<{ store?: DownPanelStore; }, {}>
>
<LightsMenu />
</Switch>
</div>
</div >
);
}
}

@ -520,6 +520,8 @@ export class UserConfigStore extends Singleton
}
});
}
app.PerCameraUseSkyBox = userConfig.isShowSkyBox;
app.MoveTool.Disable = !userConfig.dimensions;
}
ClearUserData()
{

Loading…
Cancel
Save