Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

vive nested folders: clicked folder stays focused and prevents other presses #92

@ManuelGraf

Description

@ManuelGraf

when I call

inputObject.pressed(true)

the folder which i opened stays highlighted and prevents any further clicks to other folders and/or buttons.^

detaled information:

i am creating my gui recursively like in the nested example:

objects.forEach(function (element) {
      this.addGUIElement(this.gui,element);
    }, this);


    var inputObject = dat.GUIVR.addInputObject(this.gamepad.object);
    this.scene.add(inputObject);

    window.addEventListener('viveControllerThumbpadPressed', (e) => {
      inputObject.pressed(true);
    });

 addGUIElement(folder, subtree) {
    if (subtree.children) {
      console.log('creating subfolder %s', subtree.label);
      const newFolder = dat.GUIVR.create(subtree.label || '');
      newFolder.name= subtree.label;
      subtree.children.forEach(function (element) {
        this.addGUIElement(newFolder, element);

      }, this);
      folder.addFolder(newFolder);
     
    } else {
      var setting = {
        travel: () => {
          console.log(subtree.label + 'pressed');
        }
      }
      var btn1 = folder.add(setting, 'travel');
      btn1.name(subtree.label);
      console.log('created button %s', subtree.label);
      return;
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions