diff --git a/sc2/src/sc2code/sounds.c b/sc2/src/sc2code/sounds.c index c7dccdfce..494f12d48 100644 --- a/sc2/src/sc2code/sounds.c +++ b/sc2/src/sc2code/sounds.c @@ -27,7 +27,6 @@ static BYTE num_sounds = 0; static SOUND sound_buf[MAX_SOUNDS]; static ELEMENTPTR sound_posobj[MAX_SOUNDS]; - void PlaySound (SOUND S, SoundPosition Pos, ELEMENTPTR PositionalObject, BYTE Priority) @@ -73,6 +72,14 @@ PlaySound (SOUND S, SoundPosition Pos, ELEMENTPTR PositionalObject, PlaySoundEffect (S, chan + MIN_FX_CHANNEL, Pos, PositionalObject, Priority); } +void +PlayMenuSound (MENU_SOUND_EFFECT S) +{ + PlaySoundEffect (SetAbsSoundIndex (MenuSounds, S), + 0, NotPositional (), NULL, + GAME_SOUND_PRIORITY); +} + void ProcessSound (SOUND Sound, ELEMENTPTR PositionalObject) { diff --git a/sc2/src/sc2code/sounds.h b/sc2/src/sc2code/sounds.h index 817acddae..c8892c46f 100644 --- a/sc2/src/sc2code/sounds.h +++ b/sc2/src/sc2code/sounds.h @@ -33,6 +33,14 @@ typedef enum TARGET_DAMAGED_FOR_6_PLUS_PT } SOUND_EFFECTS; +typedef enum +{ + MENU_SOUND_MOVE = 0, + MENU_SOUND_SUCCESS, + MENU_SOUND_FAILURE, + MENU_SOUND_INVOKED, +} MENU_SOUND_EFFECT; + extern SOUND MenuSounds; extern SOUND GameSounds; @@ -58,6 +66,7 @@ extern void GetMenuSounds (MENU_SOUND_FLAGS *sound_0, extern void PlaySound (SOUND S, SoundPosition Pos, ELEMENTPTR PositionalObject, BYTE Priority); +extern void PlayMenuSound (MENU_SOUND_EFFECT S); extern void ProcessSound (SOUND Sound, ELEMENTPTR PositionalObject); extern SoundPosition CalcSoundPosition (ELEMENTPTR ElementPtr); extern SoundPosition NotPositional (void);