Author Topic: Reload a module "Transition.ToNewList"  (Read 2976 times)

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Reload a module "Transition.ToNewList"
« 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

Code: [Select]
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...

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: Reload a module "Transition.ToNewList"
« Reply #1 on: April 22, 2018, 03:31:56 AM »
Anyone can explain me why this doesn`t work?

Code: [Select]
////////////////
//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" );

alucard

  • Full Member
  • ***
  • Posts: 34
    • View Profile
Re: Reload a module "Transition.ToNewList"
« Reply #2 on: December 30, 2018, 01:59:23 PM »
Any way to reload a module when I change to another gamelist?

With a code like this

Code: [Select]
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

Code: [Select]
local systemImage = fs.add_image("[System]/"+ThemeResource.SystemImage, 21*xs,184*ys,242*xs,179*ys);

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: Reload a module "Transition.ToNewList"
« Reply #3 on: January 08, 2019, 01:22:01 PM »
Thanks I'll try.