‘To turn it off
mainWindow.on("gamestarted", ev => { backglassWindow.showWindow(false); });
‘To turn it on again when exiting table
mainWindow.on("gameover", ev => { backglassWindow.showWindow(true); });
My question is this: Is there a way to exclude this from turning on and off for specific programs and tables?
I have Pinball Deluxe Reloaded as a game in my setup and I’ve created a custom Backglass PNG file that I load in PinballY - I set it to Keep the Backglass image up when I launch Pinball Deluxe in PinballY, but now that I have the above code added it ignores the “Hold Backglass” checkbox setting.
Yes, you can make it more selective. The event object in ev contains information on the game being launched, in its property ev.game. What you'll probably want to do is check the system type of the game being launched, and hide the window or not based on the system. You can get the system description object from ev.game.system, and then check one of the properties of the system object to identify it as Pinball Deluxe Reloaded or something else. Identifying a system is a bit ad hoc - I wasn't able to come up with any sort of invariant universal identifier per system since I wanted to leave things open so you can add new systems at any time. An easy way to identify a system is to look at its display name, in the displayName property. You'll probably have to fix this up to match the exact text you entered for Pinball Deluxe Reloaded's display name in your own system, but here's how the code would look with the test:
mainWindow.on("gamestarted", ev => {
if (ev.game.system.displayName == "Pinball Deluxe Reloaded")
backglassWindow.showWindow(false);
});
Here are the relevant help sections for more details.
Launch event parameters (scroll down to "Properties"): http://mjrnet.org/pi...aunchEvent.html
GameInfo object (the type of object in ev.game): http://mjrnet.org/pi...p/GameInfo.html
GameSysInfo object (the type of object in ev.game.system): http://mjrnet.org/pi...ameSysInfo.html
Edited by mjr, 17 March 2023 - 03:44 AM.





Top











are all trademarks of VPFORUMS.