Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: liquid8d on August 04, 2015, 02:12:03 PM

Title: Reset/Reload layout
Post by: liquid8d on August 04, 2015, 02:12:03 PM
Trying to see if there is a way to re-initialize the layout. As far as I can tell, the only related signal I could see might be "reset_window", but that just seems to refresh the AM window, not the layout contents itself.

Any idea if this possible via fe.signal() or some hack?
Title: Re: Reset/Reload layout
Post by: tomek on August 04, 2015, 03:01:06 PM
That would be an awesome feature for working with layouts, especially if it was possible to send that signal to a running instance of AM. In the UNIX world many programs are designed to react in a particular way to the signals they are sent. For example, many programs reload their config when sent SIGHUP (even though the original meaning of that signal was something different).


It would be cool to start up AM and then occasionally send "kill -HUP" to get it to reread the config in stead of having to quit and restart it. This would be an easy change to implement for any UNIX-like OS. I have no idea how you'd implement this for Windows.
Title: Re: Reset/Reload layout
Post by: liquid8d on August 04, 2015, 03:07:03 PM
Yep, since the layouts are read once to add objects and objects can't be removed -  I want to be able to reload the layout at certain times ( to implement per display/system/game layouts).

Technically I could add multiple layout surfaces and show/hide them, but I'd rather not load every possible layout scenario at once.

It already reloads the layout when exiting the screensaver, I just want a way to force it.
Title: Re: Reset/Reload layout
Post by: raygun on August 05, 2015, 10:43:15 PM
good idea, and easy to add.  I'll put this in for the next version.
Title: Re: Reset/Reload layout
Post by: liquid8d on August 06, 2015, 08:00:10 AM
That would be great! It looks like we can switch filters and lists already with the same layout, so just need a way to change the actual layout when necessary. Technically you could use the multi-layouts (layout-*.nut) and toggle through them, but this would allow for it to programmatically change.

My goal is for my theme module (WIP) to allow for something similar to Hyperspin - different themes/layouts based on current game, current list or current filter or even other properties (like year, category, etc)