Author Topic: [Solved] Add click sound "case Transition.ToNewSelection" gamelist  (Read 2108 times)

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
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" );
« Last Edit: October 17, 2017, 05:17:32 AM by qqplayer »