SimHub icon indicating copy to clipboard operation
SimHub copied to clipboard

[Feature request] Shortcut to Show/Hide individual overlays.

Open Dean688 opened this issue 7 months ago • 4 comments

Would it be possible to add a way to be able to have a keyboard shortcut to Show/Hide individual overlays?

Dean688 avatar Jun 27 '25 05:06 Dean688

I was going to comment on this request first but showing/hiding an overlay seemed different to me to closing/loading an overlay. I thought showing/hiding them would leave the overlays open just not visible? In order to make that work you would also need to have 2 (or more) different overlays open at the same time, not sure if that is something SimHub can already do? I would think it would make more sense (and be lighter on resources) to close/load overlays instead of just hiding them.

SmartShots avatar Jun 29 '25 08:06 SmartShots

Okay maybe show/hide was the wrong wording. Open/Close would be okay. I have a delta bar overlay i want to use,but i only want to use it during practice sessions then be able to turn if off. Unless there's a way to add some coding to the overlay it self that allows it to only show during practice.

Dean688 avatar Jun 29 '25 09:06 Dean688

Okay maybe show/hide was the wrong wording. Open/Close would be okay. I have a delta bar overlay i want to use,but i only want to use it during practice sessions then be able to turn if off. Unless there's a way to add some coding to the overlay it self that allows it to only show during practice.

You can already set an overlay to only show during practice. I do this with a lap timer overlay. The below JavaScript is what I use in the visibility code:

if ($prop('EngineIgnitionOn')==0) { return false; } else { if (($prop('DataCorePlugin.GamePaused')==1)|($prop('DataCorePlugin.GameRunning')==0)) { return false; } else { if ($prop('OpponentsCount')>1) { return false; } else { return true; } } }

With that code in place the overlay will only show up when there is just you on track (i.e. during time trial, practice, etc.). If there are any opponents it does not show up.

Another way to do what you want is to setup a shortcut key to show the next dash screen (in the Dash Studio Controls tab) then edit the overlay you want to toggle on/off and add an extra screen that is completely blank. That way when you press the key that overlay switches to a blank screen, press it again and the overlay switches and can be seen again. I use this to toggle my track map overlay on/off.

What I want is to be able to have an entirely different overlay layout (with different overlays in each) and be able to switch between them.

In my case it is for switching between a 'Full' layout - loads of extra overlays with loads of information, and a 'Minimal' layout with just the main information I need (less overlays that are more compact).

So my request is not for a single overlay but for an overlay layout (a collection of overlays) to be able to be closed/loaded with a single shortcut key, which you can't currently do. Individual overlays can already be toggled on/off, in either of the ways I mentioned.

SmartShots avatar Jun 30 '25 08:06 SmartShots

You can already set an overlay to only show during practice. I do this with a lap timer overlay. The below JavaScript is what I use in the visibility code:

if ($prop('EngineIgnitionOn')==0) { return false; } else { if (($prop('DataCorePlugin.GamePaused')==1)|($prop('DataCorePlugin.GameRunning')==0)) { return false; } else { if ($prop('OpponentsCount')>1) { return false; } else { return true; } } }

With that code in place the overlay will only show up when there is just you on track (i.e. during time trial, practice, etc.). If there are any opponents it does not show up.

Another way to do what you want is to setup a shortcut key to show the next dash screen (in the Dash Studio Controls tab) then edit the overlay you want to toggle on/off and add an extra screen that is completely blank. That way when you press the key that overlay switches to a blank screen, press it again and the overlay switches and can be seen again. I use this to toggle my track map overlay on/off.

Thanks for the suggestions,out of the two the second option sounds the best for me. But i'm new to simhub and not a programmer,so i don't know how to do that. I have a key set for the toggle on/off but i don't know how to create a blank screen in the overlay. I tried google but none of it makes any sense.

Dean688 avatar Jun 30 '25 12:06 Dean688