Page 1 of 1

Music in the menu

Posted: Tue Dec 23, 2008 6:12 pm
by Rawing
There is music in both the main and the ingame menu now; the only problem is that I have no idea about how to stop playing it when the ingame menu disappears. All I have done is caching the music file and this in UI_Refresh:

Code: Select all

if (m_entersound && !menu_music_playing)
	{
		//trap_S_StartLocalSound( menu_in_sound, CHAN_LOCAL_SOUND );
		trap_S_StartLocalSound( menu_music, CHAN_LOCAL );
		menu_music_playing = qtrue;
		m_entersound = qfalse;
	}
It doesn't start when it's running already and the menu_in_sound always disrupted it, so I commented it out. How can I stop the music when the ingame menu is closed?

Re: Music in the menu

Posted: Tue Dec 23, 2008 7:43 pm
by corncobman
What you could do is have a blank sound file play when you exit the menu. Hopefully that should override the already playing sound.

Re: Music in the menu

Posted: Wed Dec 24, 2008 1:58 pm
by Rawing
okay... as long as it works it's good :) I looked into the ingame menu code already but I couldn't find out when it is OPENED and when it is CLOSED, so I don't know how to start another sound...??