mjrgh / PinballY

A table browser and launcher ("front end") for virtual pinball cabinets.
Other
47 stars 22 forks source link

Shutdown Lightshow / Underground Dynamics RGB Lights within Front End #114

Closed xantari closed 4 years ago

xantari commented 4 years ago

Is your feature request related to a problem? Please describe. DOF works out of the box in PinballY and even has the same left/right navigation lightbar functions as PinballX.

What is missing is the shutdown light show. How can that be added? Is it possible to add via the Scripting function? I didn't see any DOF javascript scripting examples.

Describe the solution you'd like Built in light show on exit. Additionally, undercab dynamic lighting would also be awesome.

xantari commented 4 years ago

Update: I do see that there are different events we can add in DOF (will need to figure out how to add the RGB Undercab complex upon program load I guess).

What I could not find is a PBYProgramExit event to fire the light show upon shutdown or program close of PinballY?

mjrgh commented 4 years ago

I do see that there are different events we can add in DOF

Right. In case you haven't found it yet, there's a section in the Help called "DOF Events" with details on how to customize the events.

will need to figure out how to add the RGB Undercab complex upon program load

There's not currently a separate event for the initial program load - it'll just go into $PBYWheel state initially. I could add a program load event easily enough.

What I could not find is a PBYProgramExit event to fire the light show upon shutdown or program close of PinballY?

That one is probably going to be impossible to handle this way, unfortunately, because DOF automatically resets everything when a program exits. Even if I did add a "program exit" event, you'd probably only see the first couple of flashes from it before DOF shuts down, so it would be kind of useless.

I can think of two alternative approaches that might work:

mainWindow.on("command", ev => { 
    if (ev.id == command.Quit) {
        // carry out the light show launch here as in the Worked Example section
    }
});
xantari commented 4 years ago

Thanks! I'll give the javascript method a shot when I get more time (hopefully in a couple weeks).

mjrgh commented 4 years ago

The Beta 20 release has new Javascript features that will let you do everything you want here, I think. See Activating a DOF light show in Javascript scripting > Worked Examples > Play a Video on Quit in the help.

mjrgh commented 4 years ago

Closing, since I think this is best handled through the Javascript approach.