Jump to content

Switch Tooltips Off/On?


Recommended Posts

You can bind a key to toggle the GUI on and off, should be relatively simple, if you want them to stay off, you have to create a button in options menu that sets a pref value to disable it or have the pref value set, if you just press the toggle tooltips on/off button.


Look into the code how it is done for other GUIs that you can toggle.

Link to post
Share on other sites

There are already complete functions like that in the default template I think, I mostly just copy and paste existing functions and extend them to what I need, it's simpler than reinventing the wheel every time.


Isn't there already a tooltip GUI by default in the full template? I remember seeing it.


A toggle function looks like:


function toggleTooltips()

{

if (TooltipsGUI.isAwake()) {

Canvas.popDialog(TooltipsGUI);

}

else

Canvas.pushDialog(TooltipsGUI);

}


Then you bind a key to do that and done. What else you need?

Link to post
Share on other sites
  • 2 weeks later...

Theoretically you could set the GuiToolTipProfile.opaque field to false to "turn tool tips off" - it should just make them invisible, they'd still technically be there. I don't recall when the profiles are refreshed exactly so it might not function as expected on a hot-key but it would be okay to use in the preferences file as I'm pretty sure the profile is applied any time a UI element is shown/unhidden.


By default GuiToolTipProfile is defined in \modules\Sandbox\1\gui\guiProfiles.cs.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...