Author Topic: Retrieving path to artwork folder  (Read 6375 times)

Svampson

  • Newbie
  • *
  • Posts: 5
    • View Profile
Retrieving path to artwork folder
« on: October 16, 2014, 12:05:41 AM »
Hi! I'm currently working on a theme, and i've implemented so it checks if a game's image exist, and if it doesn't it substitutes it with a Text object with the games title instead (Kind of how Hyperspin does it) using Squirrel's fopen function. This works really well the only problem is that I can't figure out a way to actually get the configured artwork path, so right now I have to have a separate Layout Option where the user specifies the artwork path which works but is not ideal, since the user now has to specify it in two separate places, also this probably won't work with multiple emulators that has different artwork paths :P

Is there a way to get the path to an artwork from the configuration, without having to manually parse and search the config files?

raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 393
    • View Profile
Re: Retrieving path to artwork folder
« Reply #1 on: October 16, 2014, 05:45:14 PM »
There isn't a way currently to get the path in a layout/plugin script.  That could certainly be added if it is useful for people

An easier way to determine if an image is being shown in an artwork is to check if the file_name attribute is empty... that way you don't have to worry about paths etc...

So something like:

if ( artwork.file_name.len() > 0 )
{
   // there is an image being displayed by the artwork
}
else
{
   // no image displayed, show the text instead
}


Svampson

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Retrieving path to artwork folder
« Reply #2 on: October 17, 2014, 03:14:08 AM »
Wow yeah that's way cleaner, gonna go with that, thanks!