!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 export class UserConfig implements IConfigStore
{ {
private readonly _version = 22; private readonly _version = 23;
_renderType: RenderType = RenderType.Wireframe; _renderType: RenderType = RenderType.Wireframe;
@observable maxSize: IMaxSizeProps = { @observable maxSize: IMaxSizeProps = {
isShow: false, isShow: false,
@ -121,6 +121,7 @@ export class UserConfig implements IConfigStore
@observable openHistoryList = true; @observable openHistoryList = true;
isOpenCabinet: boolean = false; //是否时开启门板、抽屉动作 isOpenCabinet: boolean = false; //是否时开启门板、抽屉动作
@observable lightHelper: boolean = false; //是否显示灯光助手 @observable lightHelper: boolean = false; //是否显示灯光助手
@observable isShowSkyBox: boolean = false;//是否显示天空球,仅在透视相机下显示
constructor() constructor()
{ {
@ -200,6 +201,7 @@ export class UserConfig implements IConfigStore
this.synchronousEnable = false; this.synchronousEnable = false;
this.isLargeIcon = false; this.isLargeIcon = false;
this.isModifyMaterial = false; this.isModifyMaterial = false;
this.isShowSkyBox = false;
} }
SaveConfig() SaveConfig()
{ {
@ -236,6 +238,7 @@ export class UserConfig implements IConfigStore
synchronousEnable: this.synchronousEnable, synchronousEnable: this.synchronousEnable,
isLargeIcon: this.isLargeIcon, isLargeIcon: this.isLargeIcon,
isModifyMaterial: this.isModifyMaterial, isModifyMaterial: this.isModifyMaterial,
isShowSkyBox: this.isShowSkyBox,
} }
}; };
} }
@ -337,6 +340,10 @@ export class UserConfig implements IConfigStore
{ {
this.openHistoryList = config.option.openHistoryList; 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 { inject, observer } from 'mobx-react';
import * as React from 'react'; import * as React from 'react';
import { app } from '../../ApplicationServices/Application'; import { app } from '../../ApplicationServices/Application';
@ -278,6 +278,14 @@ export class DownPanel extends React.Component<{ store?: DownPanelStore; }, {}>
e.currentTarget.blur(); e.currentTarget.blur();
return; 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; this.props.store[key] = e.currentTarget.checked;
if (!app.Viewer.isLayout) if (!app.Viewer.isLayout)
@ -428,6 +436,20 @@ export class DownPanel extends React.Component<{ store?: DownPanelStore; }, {}>
e.currentTarget.blur(); 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 <Switch
checked={userConfig.lightHelper} checked={userConfig.lightHelper}
data-key="lightHelper" data-key="lightHelper"
@ -437,7 +459,8 @@ export class DownPanel extends React.Component<{ store?: DownPanelStore; }, {}>
> >
<LightsMenu /> <LightsMenu />
</Switch> </Switch>
</div>
</div >
); );
} }
} }

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

Loading…
Cancel
Save