Page 1 of 1

Switch Tooltips Off/On?

Posted: Wed Nov 20, 2019 4:56 pm
by RichardLichten
Hi all,

is there a command to set all tooltips to off?
I included those in the gui files, but they should be switchable.

Kindest, thanks, Chris

Re: Switch Tooltips Off/On?

Posted: Wed Nov 20, 2019 6:10 pm
by Duion
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.

Re: Switch Tooltips Off/On?

Posted: Wed Nov 20, 2019 7:58 pm
by RichardLichten
Thanks!

But what i need is a command/function like toggleTooltip (true) or renderTooltip(true) for all tooltips.

Is there a command/function like this or similar in the torquescript-syntax?

Kindest, Chris

Re: Switch Tooltips Off/On?

Posted: Wed Nov 20, 2019 8:40 pm
by Duion
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?

Re: Switch Tooltips Off/On?

Posted: Wed Nov 20, 2019 10:13 pm
by RichardLichten
No, isn´t there a function for accesing the tooltips. There isn´t a separate TooltipGUI :cry: .

Re: Switch Tooltips Off/On?

Posted: Wed Nov 20, 2019 10:17 pm
by Duion
You mean the popups that appear when you hover over a GUI item? You can set them in the properties what you want them to be or enter nothing.

You have to explain in more detail what you mean, maybe a screenshot of what you mean.

Re: Switch Tooltips Off/On?

Posted: Mon Dec 02, 2019 5:45 pm
by rlranft
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.