Music in the menu

Locked
Rawing
Posts: 107
Joined: Tue Oct 23, 2007 1:40 pm

Music in the menu

Post 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?
[color=#FF0000]/callvote kick all_enemies[/color]
corncobman
Posts: 304
Joined: Fri Aug 08, 2003 7:00 am

Re: Music in the menu

Post 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.
-It is not the fall that kills you. It's the sudden stop at the end. (Douglas Adams)-

[url=http://www.violationentertainment.com/misc/ccm]-An eyeful a day is bloody fantastic!-[/url]
Rawing
Posts: 107
Joined: Tue Oct 23, 2007 1:40 pm

Re: Music in the menu

Post 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...??
[color=#FF0000]/callvote kick all_enemies[/color]
Locked