NormalEditor.js 662 B

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