Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: qqplayer on October 17, 2017, 04:49:58 AM

Title: [Solved] Add click sound "case Transition.ToNewSelection" gamelist
Post by: qqplayer on October 17, 2017, 04:49:58 AM
I see some layouts with "click" sounds but only using wheel module.
I want to add a "click.mp3" sound when I select a new game but with for example the "Basic" layout.
Tried this example:

Code: [Select]
function transition_callback(ttype, var, ttime)
{
    switch ( ttype )
    {
        //case Transition.StartLayout:
case Transition.ToNewSelection:
                 local Wheelclick = fe.add_sound("Click.mp3")
Wheelclick.playing=true
            break;
    }
    return false;
}

http://forum.attractmode.org/index.php?topic=221.0


But doesnt work.

UPDATE: Solved found the solution on fry theme , thanks @jedione

Code: [Select]
function fade_transitions( ttype, var, ttime ) {
 switch ( ttype ) {
  case Transition.ToNewSelection:
  case Transition.ToNewList:
local Wheelclick = fe.add_sound("Click.mp3")
      Wheelclick.playing=true
  break;
  }
 return false;
}

fe.add_transition_callback( "fade_transitions" );