Author Topic: Layout settings per instance?  (Read 1712 times)

j.e.f.f

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Layout settings per instance?
« on: April 27, 2020, 01:55:35 AM »
I'm trying to create a single layout for all my displays, but can be themed for each individual display (e.g.: NES Display gets different artwork than SNES display). I'm trying to do it this way so that I don't have a copy of my layout code for EACH display I set up... I'd like to have all the code in one place. I also want each of my displays to have a consistent layout.  The existing themes that others have made are great, but there are plenty of small differences that make the front end look patched together when you move from one display to another.

Thus far I have approached it as follows:
 - Common code is in layout.nut
 - theme-specific resources are in a subfolder named ./themes/<theme_name>
 - A configuration that allows you to select the <theme_name> from Attract mode's Display configuration

My thought was that I could just set all of my displays to use the same layout, and select a different theme for each, but I have discovered that changing a theme setting for one display changes it for ALL displays that use the layout.

Is it possible to designate a configuration option to be display specific?  Or is there a different way I can approach this to achieve what I want?

Thanks!
 - Jeff

j.e.f.f

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Layout settings per instance?
« Reply #1 on: April 29, 2020, 04:20:50 AM »
For anyone who has been looking at this thread, I have taken a different approach. 

I get the name of the current display:
Code: [Select]
local displayName = fe.list.name;
The try to match it against an object that associates display names with themes I define:
Code: [Select]
local ThemesList = {
"Nintendo NES": "nes",
"Super Nintendo": "snes",
        "<display name x>" : "<them name y>"
}

It means some manual configuration instead of picking it in the UI, but it works