Here's an updated version.. now just set Is Artwork to Yes and you can use snap, marquee, wheel, etc as the image:
class UserConfig </ help="This plugin will show a popup image when the specified button is pressed." /> {
</ label="Image", help="The full path to the image that will be displayed", order=1 />
image="";
</ label="Is Artwork" help="If enabled, the image is the selected artwork type", options="Yes,No" order=2 />
is_art=false;
</ label="Key", help="The key that will display the image", is_input="yes", order=3 />
key="";
</ label="Hold Key", help="If enabled, you must hold the key down", options="Yes,No", order=4 />
hold="No";
};
class PopUpImage
{
_image = null;
_key = null;
_hold = false;
_showing = false;
_key_delay = 250;
_last_check = 0;
_is_art = false;
constructor()
{
local config = fe.get_config();
_is_art = config["is_art"];
_image = ( _is_art ) ? fe.add_artwork( config["image"], 0, 0, fe.layout.width, fe.layout.height ) : fe.add_image( config["image"], 0, 0, fe.layout.width, fe.layout.height );
_image.visible=false;
_image.preserve_aspect_ratio = true;
_key = config["key"];
_hold = config["hold"];
fe.add_ticks_callback( this, "on_tick" );
}
function on_tick( ttime )
{
if ( !fe.overlay.is_up )
{
local is_down = fe.get_input_state( _key );
if ( _hold == "Yes" )
{
_image.visible = is_down;
_showing = is_down;
} else
{
if ( is_down )
{
if ( ttime - _last_check > _key_delay )
{
_last_check = ttime;
_image.visible = !_showing;
_showing = !_showing;
}
}
}
}
}
}
fe.plugin[ "PopUpImage" ] <- PopUpImage();
Also fixed so the key has no effect when the fe.overlay is up (i.e. in config)