You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
49 lines
1.2 KiB
2 years ago
|
import { UIPanel, UIText, UIRow } from './libs/ui.js';
|
||
|
import { UIBoolean } from './libs/ui.three.js';
|
||
|
|
||
|
|
||
|
function SidebarSettingsViewport( editor ) {
|
||
|
|
||
|
const signals = editor.signals;
|
||
|
const strings = editor.strings;
|
||
|
|
||
|
const container = new UIPanel();
|
||
|
|
||
|
const headerRow = new UIRow();
|
||
|
headerRow.add( new UIText( strings.getKey( 'sidebar/settings/viewport' ).toUpperCase() ) );
|
||
|
container.add( headerRow );
|
||
|
|
||
|
// grid
|
||
|
|
||
|
const showGridRow = new UIRow();
|
||
|
|
||
|
showGridRow.add( new UIText( strings.getKey( 'sidebar/settings/viewport/grid' ) ).setWidth( '90px' ) );
|
||
|
|
||
|
const showGrid = new UIBoolean( true ).onChange( function () {
|
||
|
|
||
|
signals.showGridChanged.dispatch( showGrid.getValue() );
|
||
|
|
||
|
} );
|
||
|
showGridRow.add( showGrid );
|
||
|
container.add( showGridRow );
|
||
|
|
||
|
// helpers
|
||
|
|
||
|
const showHelpersRow = new UIRow();
|
||
|
|
||
|
showHelpersRow.add( new UIText( strings.getKey( 'sidebar/settings/viewport/helpers' ) ).setWidth( '90px' ) );
|
||
|
|
||
|
const showHelpers = new UIBoolean( true ).onChange( function () {
|
||
|
|
||
|
signals.showHelpersChanged.dispatch( showHelpers.getValue() );
|
||
|
|
||
|
} );
|
||
|
showHelpersRow.add( showHelpers );
|
||
|
container.add( showHelpersRow );
|
||
|
|
||
|
return container;
|
||
|
|
||
|
}
|
||
|
|
||
|
export { SidebarSettingsViewport };
|