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

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;
    }
  }

Activity

  1. xinaesthete commented on Sep 14, 2017

    @xinaesthete
    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.

  2. ManuelGraf commented on Sep 19, 2017

    @ManuelGraf
    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!

  3. xinaesthete commented on Sep 20, 2017

    @xinaesthete
    Contributor

    @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.

  4. xinaesthete commented on Sep 20, 2017

    @xinaesthete
    Contributor

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

  5. xinaesthete commented on Sep 20, 2017

    @xinaesthete
    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 join this conversation on GitHub. Already have an account? Sign in to comment

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