Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: qqplayer on April 21, 2018, 02:40:01 AM
-
Any way to reload a module when I change to another gamelist?
I mean , I have made a little change to the conveyour_helper from Arcadebliss:
http://forum.attractmode.org/index.php?topic=1945.45
Lines 1989 - 1990
filename = "fe.script_dir "+fe.game_info(Info.Emulator)+".png";
filename = (fileExist(filename)) ? filename : amPath + "modules/conveyour_helper/"+fe.game_info(Info.Emulator)+".png";
So , if I have the same layout for different systems it doesnt change my "emulatorbackground" I need the layout to reload the module every time I change to another list,system,emulator...
-
Anyone can explain me why this doesn`t work?
////////////////
//Reload Module
////////////
function myModule_transitions( ttype, var, ttime ) {
switch ( ttype ) {
case Transition.StartLayout:
//fe.load_module("conveyour_helper_mod");
fe.do_nut("../../modules/conveyour_helper_mod.nut");
break;
}
return false;
}
fe.add_transition_callback( "myModule_transitions" );
-
Any way to reload a module when I change to another gamelist?
With a code like this
function onTransition( ttype, var, transition_time )
{
local redraw_needed = false;
if (ttype == Transition.ToNewList && currentGameList!=fe.list.name){
fe.signal("reload");
}
...
So , if I have the same layout for different systems it doesnt change my "emulatorbackground" I need the layout to reload the module every time I change to another list,system,emulator...
In my layout the background image changes for different systems with this line of code
local systemImage = fs.add_image("[System]/"+ThemeResource.SystemImage, 21*xs,184*ys,242*xs,179*ys);
-
Thanks I'll try.