NormalEditor.js 697 B

12345678910111213141516171819202122232425262728293031
  1. import { ObjectNode } from '../core/ObjectNode.js';
  2. import { SelectInput, LabelElement } from '../../libs/flow.module.js';
  3. import { NormalNode } from '../../renderers/nodes/Nodes.js';
  4. export class NormalEditor extends ObjectNode {
  5. constructor() {
  6. const node = new NormalNode();
  7. super( 'Normal', 3, node );
  8. this.title.setStyle( 'red' );
  9. const optionsField = new SelectInput( [
  10. { name: 'Local', value: NormalNode.LOCAL },
  11. { name: 'World', value: NormalNode.WORLD },
  12. { name: 'View', value: NormalNode.VIEW }
  13. ] ).onChange( () => {
  14. node.scope = optionsField.getValue();
  15. this.invalidate();
  16. } );
  17. this.add( new LabelElement( 'Scope' ).add( optionsField ) );
  18. }
  19. }