Author Topic: [Help]Loading themes based on current filter  (Read 5642 times)

Hamaya

  • Newbie
  • *
  • Posts: 2
    • View Profile
[Help]Loading themes based on current filter
« on: December 02, 2015, 04:42:33 PM »
I'm trying to load specific .nut files based on the filter.

So If the current filter is "Capcom" it will load /themes/capcom.nut, if I change the filter it will then load the next one. (Lets say Konami) So then I load /themes/Konami.nut etc. Same for NES, SNES and other systems.

I'm not really sure how to get this working though! I've done some basic themes but they've all been a single theme for all systems/filters. 

Hoping for some direction on this, I'm pretty confused to be honest, ???.

Currently I have something like this
Code: [Select]
if (fe.Filter = "mame") {
print("Loading MAME.nut...\n");
fe.do_nut("themes/MAME.nut");
}
else if (fe.Filter = "mess") {
print("Loading MESS.nut...\n");
fe.do_nut("themes/MESS.nut");
}
etc. etc. *Above code is not updating layout correctly though!*

Where each theme is initializing its own variables and everything. Not sure if it would be possible to declare the objects and surfaces in the main layout file and just manipulate them in the filter/system themes.

So yeah, thanks for taking a look and thanks for any and all help!
« Last Edit: December 02, 2015, 10:57:45 PM by Hamaya »

raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 393
    • View Profile
Re: [Help]Loading themes based on current filter
« Reply #1 on: December 03, 2015, 11:02:10 PM »
One thing you could try is instead of creating "Capcom" and "Konami" filters you could create a "Capcom" and "Konami" Display.  Then you can point them each at the same romlist, change their default filters to filter for capcom and konami games as appropriate, and still set a different theme for each of them.  To cycle between the lists you could then just cycle by "Display" instead of "Filter".

I think this might be the easiest way if I understand what you are trying to do correctly.

Hamaya

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: [Help]Loading themes based on current filter
« Reply #2 on: December 04, 2015, 02:10:12 AM »
Thanks raygun, I guess ill just do that and point them to seperate rom lists. I guess I was just focusing way too much on the layout and not the whole picture.