Skip to content
This repository has been 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

Open
ManuelGraf opened this issue Sep 13, 2017 · 5 comments

Comments

@ManuelGraf
Copy link

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;
    }
  }
@xinaesthete
Copy link
Contributor

I'll try to remember to check that soon. Maybe ping me if you don't hear anything by mid next week. You might also want to try with my fork https://github.com/xinaesthete/dat.guiVR/tree/ImageButton is a branch with a few new (not well documented) features added but it should do the standard stuff fine and may well have bug fixes relevant to this, I don't remember off the top of my head.

Anyway, that's the version I was using when I was last actively working with this and I certainly had some nested folders behaving reasonably with Vive.

@ManuelGraf
Copy link
Author

@xinaesthete Actually, your fork was the first one I tried out due to the ImageButton functionality. I would love to use it, but it's not possible without any documentation.

For Example, I can't use the addFolder function because it is missing in your branch. If you can show me an example of how you used it, this would be great!

@xinaesthete
Copy link
Contributor

xinaesthete commented Sep 20, 2017

@ManuelGraf https://github.com/xinaesthete/dat.guiVR/blob/ImageButton/examples/imagebutton.html is all working here (non-Vive example, but Vive stuff should be working as well). Admittedly that example doesn't cover quite 100% of new features, doesn't have much (anything) in the way of comments, and the interface for some of the new stuff is liable to change at some point, but it is using addFolder and image buttons / grids as well as colour pickers and text box input.

@xinaesthete
Copy link
Contributor

I've included that example in the examples index page as "Simple ImageButton Example".

@xinaesthete
Copy link
Contributor

@ManuelGraf is it possible that you accidentally checked out the master branch of my fork, rather than ImageButton? That will be behind.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants