KrabCode/LazyGui

Can not hide everything - root path option

Closed this issue · 13 comments

Hi,
I am trying to hide and show everything, but gui.hide(""); does nothing, event thought that println( "stack "+gui.getFolder()); returns empty string, which is what I am using to specify root path. Generally speaking it would also be nice to have ability truly stop rendering and updating as well to save resources. You can now specify gui.draw(); but it will draw anyway even if the call is not present - it would be nice to have explicit option in settings "drawWhenCalled" - and draw only when I am calling gui.draw() (instead of just sepecting WHERE it will draw).

This could be done... but how should it behave if the currently selected option "a" is not present in the newly set list ["b", "c"]?

perhaps by choosing first option in the list ( list.get(0) ). One more thing - currently it does not support empty array - it will throw null pointer. How about just returning null when the array is empty? Currently I just append some nonsense to avoid nullpointer ( like list.add("file not avaliable") ) and check for empty array myself (I am retrieving files inside folder that can dynamically change).

umm... did you just make this issue not about setting lists in radios but about hiding everything? please make a separate issue for the hiding...

oh, sorry, it was me who reacted to the wrong issue, strange

you can hide the whole gui with pressing 'h' - do you want to do that from code or is that sufficient?

you can hide the whole gui with pressing 'h' - do you want to do that from code or is that sufficient?

yes exactly - i did not find the function for that....I could perhaps trigger the "h" key I guess. Can these shortcuts be overwritten as well?

I did:

import com.krab.lazy.stores.LayoutStore;

      LayoutStore  mystore = new LayoutStore();
      mystore.hideGuiToggle();

to acces the function....seems hacky?

The shortcuts cannot be overwritten at this time. Your workaround does seem hacky, but it will work well... I'll make a public facing gui.hideGui() and showGui() method instead that internally call the LayoutStore methods.

btw the LayoutStore.hideGuiToggle() is static - you don't need to do new LayoutStore() at all, just call it as
LayoutStore.hideGuiToggle();

cool - strangely when I hide gui my fps counter goes down....with frameRate(1000) in setup it seems I am getting more fps when rendering the gui compared to gui "hidden" - it would be better to have the option to completely skip the gui update methods as well. I am trying to not render anything and just do some processing when in "performance" mode that hides the gui to increase performance. Currently I am rewriting my OSC packets recorder and replay app with LazyGui. https://github.com/trackme518/OSCreplay

I could only explain the lower fps by you running the toggle function every frame..

Cool project!

you can now hide the gui with gui.hideGui(), gui.hideGuiToggle(), gui.showGui()

released in v1.6.0