mickelson / attract

A graphical front-end for command line emulators that hides the underlying operating system and is intended to be controlled with a joystick or gamepad.
http://attractmode.org
GNU General Public License v3.0
397 stars 115 forks source link

fe.get_art results inconsistent when images and videos are present #569

Closed zpaolo11x closed 5 years ago

zpaolo11x commented 5 years ago

I'm using fe.get_art to load artwork in an image object, I have a "snap" artwork category that contains both images and videos, the manual says to use the "Art.ImageOnly" parameter, but if I use this I get an error. If I try "Art.ImagesOnly" the result is an empty string. Is there something wrong in the implementation?

oomek commented 5 years ago

it's a typo in the documentation. It should be Art.ImagesOnly

zpaolo11x commented 5 years ago

I tried, but still I only get video filenames even if image snaps are there.

oomek commented 5 years ago

This works fine on my end:

local png = fe.add_text( "", 0, 0, 1000, 25 )
png.align = Align.MiddleLeft

local mp4 = fe.add_text( "", 0, 25, 1000, 25 )
mp4.align = Align.MiddleLeft

function on_transition( ttype, var, ttime ) {
    switch( ttype ) {
        case Transition.ToNewList:
        case Transition.FromOldSelection:
            png.msg = fe.get_art( "snap", 0, 0, Art.ImagesOnly )
            mp4.msg = fe.get_art( "snap" )
        default:
            break
    }
}

fe.add_transition_callback( "on_transition" )
zpaolo11x commented 5 years ago

Oh wow now I see, I forgot to put the "0" in filter offset!

oomek commented 5 years ago

Solved, so I'm closing the issue