Clear menu sound interface; added missing failure sounds to Outfit and Shipyard (bug #842)
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2289 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -142,8 +142,7 @@ DoConfirmExit (void)
|
||||
if (PulsedInputState.key[KEY_MENU_SELECT])
|
||||
{
|
||||
done = TRUE;
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1),
|
||||
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||
PlayMenuSound (MENU_SOUND_SUCCESS);
|
||||
}
|
||||
else if (PulsedInputState.key[KEY_MENU_CANCEL])
|
||||
{
|
||||
@@ -154,9 +153,7 @@ DoConfirmExit (void)
|
||||
{
|
||||
response = !response;
|
||||
DrawConfirmationWindow (response);
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 0),
|
||||
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||
|
||||
PlayMenuSound (MENU_SOUND_MOVE);
|
||||
}
|
||||
TaskSwitch ();
|
||||
} while (!done);
|
||||
|
||||
@@ -289,7 +289,7 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
|
||||
|
||||
S = MenuSounds;
|
||||
if (input & sound_1)
|
||||
S = SetAbsSoundIndex (S, 1);
|
||||
S = SetAbsSoundIndex (S, MENU_SOUND_SUCCESS);
|
||||
|
||||
PlaySoundEffect (S, 0, NotPositional (), NULL, 0);
|
||||
}
|
||||
|
||||
@@ -402,8 +402,7 @@ DoTextEntry (PTEXTENTRY_STATE pTES)
|
||||
pTES->InsPt = CacheInsPt;
|
||||
pTES->CursorPos = CacheCursorPos;
|
||||
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 2),
|
||||
0, NotPositional (), NULL, 0);
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1712,8 +1712,7 @@ DoMelee (PMELEE_STATE pMS)
|
||||
case START_MELEE:
|
||||
if (pMS->star_bucks[0] == 0 || pMS->star_bucks[1] == 0)
|
||||
{
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 2),
|
||||
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1781,8 +1780,7 @@ DoMelee (PMELEE_STATE pMS)
|
||||
if (pMS->star_bucks[pMS->side])
|
||||
DoSaveTeam (pMS);
|
||||
else
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 2),
|
||||
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
break;
|
||||
case CONTROLS_TOP:
|
||||
case CONTROLS_BOT:
|
||||
|
||||
@@ -244,7 +244,10 @@ DoInstallModule (PMENU_STATE pMS)
|
||||
if (GLOBAL_SIS (ResUnits) <
|
||||
(DWORD)(GLOBAL (ModuleCost[new_slot_piece])
|
||||
* MODULE_COST_SCALE))
|
||||
{ // not enough RUs to build
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
else if (new_slot_piece == EMPTY_SLOT + 2)
|
||||
{
|
||||
@@ -252,7 +255,10 @@ DoInstallModule (PMENU_STATE pMS)
|
||||
{
|
||||
if (GLOBAL_SIS (CrewEnlisted) > CREW_POD_CAPACITY
|
||||
* (CountSISPieces (CREW_POD) - 1))
|
||||
{ // crew pod still needed for crew recruited
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
else if (old_slot_piece == FUEL_TANK
|
||||
|| old_slot_piece == HIGHEFF_FUELSYS)
|
||||
@@ -266,13 +272,19 @@ DoInstallModule (PMENU_STATE pMS)
|
||||
volume -= (old_slot_piece == FUEL_TANK
|
||||
? FUEL_TANK_CAPACITY : HEFUEL_TANK_CAPACITY);
|
||||
if (GLOBAL_SIS (FuelOnBoard) > volume + FUEL_RESERVE)
|
||||
{ // fuel tank still needed for the fuel on board
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
else if (old_slot_piece == STORAGE_BAY)
|
||||
{
|
||||
if (GLOBAL_SIS (TotalElementMass) > STORAGE_BAY_CAPACITY
|
||||
* (CountSISPieces (STORAGE_BAY) - 1))
|
||||
{ // storage bay still needed for the cargo
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -552,6 +564,10 @@ ChangeFuelQuantity (void)
|
||||
GetGaugeRect (&r, FALSE);
|
||||
SetFlashRect (&r, (FRAME)0);
|
||||
}
|
||||
else
|
||||
{ // no more room for fuel or not enough RUs
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
UnlockMutex (GraphicsLock);
|
||||
}
|
||||
else if (PulsedInputState.key[KEY_MENU_DOWN])
|
||||
@@ -571,6 +587,10 @@ ChangeFuelQuantity (void)
|
||||
DrawFilledRectangle (&r);
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // no fuel left to drain
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
SetContext (StatusContext);
|
||||
GetGaugeRect (&r, FALSE);
|
||||
SetFlashRect (&r, (FRAME)0);
|
||||
|
||||
@@ -151,7 +151,7 @@ DoGetMelee (GETMELEE_STATE *gms)
|
||||
gms->row = new_row;
|
||||
gms->col = new_col;
|
||||
|
||||
PlaySoundEffect (MenuSounds, 0, NotPositional (), NULL, 0);
|
||||
PlayMenuSound (MENU_SOUND_MOVE);
|
||||
ChangeSelection:
|
||||
LockMutex (GraphicsLock);
|
||||
gms->flash_rect.corner.x = PICK_X_OFFS
|
||||
@@ -363,8 +363,7 @@ GetMeleeStarShip (STARSHIPPTR LastStarShipPtr, COUNT which_player)
|
||||
StarShipPtr->captains_name_index = 0;
|
||||
UnlockStarShip (&race_q[which_player], gmstate.hBattleShip);
|
||||
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1), 0,
|
||||
NotPositional (), NULL, 0);
|
||||
PlayMenuSound (MENU_SOUND_SUCCESS);
|
||||
|
||||
WaitForSoundEnd (0);
|
||||
}
|
||||
|
||||
@@ -63,8 +63,7 @@ DoPickBattleShip (PMENU_STATE pMS)
|
||||
{
|
||||
if ((HSTARSHIP)pMS->CurFrame)
|
||||
{
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1),
|
||||
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||
PlayMenuSound (MENU_SOUND_SUCCESS);
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
@@ -99,8 +98,7 @@ DoPickBattleShip (PMENU_STATE pMS)
|
||||
else if (new_row == NUM_PICK_SHIP_ROWS)
|
||||
new_row = 0;
|
||||
|
||||
PlaySoundEffect (MenuSounds, 0, NotPositional (),
|
||||
NULL, GAME_SOUND_PRIORITY);
|
||||
PlayMenuSound (MENU_SOUND_MOVE);
|
||||
|
||||
LockMutex (GraphicsLock);
|
||||
|
||||
|
||||
@@ -196,8 +196,6 @@ else if (InputState & DEVICE_EXIT) return (FALSE);
|
||||
UnbatchGraphics ();
|
||||
return TRUE;
|
||||
case QUIT_GAME:
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1),
|
||||
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||
fade_buf[0] = FadeAllToBlack;
|
||||
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2));
|
||||
|
||||
|
||||
@@ -767,6 +767,10 @@ DoModifyShips (PMENU_STATE pMS)
|
||||
SetFlashRect (&r, (FRAME)0);
|
||||
UnlockMutex (GraphicsLock);
|
||||
}
|
||||
else
|
||||
{ // not enough RUs to build
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN,
|
||||
MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
|
||||
|
||||
@@ -890,6 +894,10 @@ DoModifyShips (PMENU_STATE pMS)
|
||||
SetFlashRect (&r, (FRAME)0);
|
||||
SetContext (SpaceContext);
|
||||
}
|
||||
else
|
||||
{ // at capacity or not enough RUs
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -925,6 +933,10 @@ DoModifyShips (PMENU_STATE pMS)
|
||||
SetContext (SpaceContext);
|
||||
SetFlashRect (&r, (FRAME)0);
|
||||
}
|
||||
else
|
||||
{ // at capacity or not enough RUs
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
UnlockStarShip (&GLOBAL (avail_race_q),
|
||||
hTemplate);
|
||||
}
|
||||
@@ -952,6 +964,10 @@ DoModifyShips (PMENU_STATE pMS)
|
||||
SetFlashRect (&r, (FRAME)0);
|
||||
SetContext (SpaceContext);
|
||||
}
|
||||
else
|
||||
{ // no crew to dismiss
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -967,6 +983,10 @@ DoModifyShips (PMENU_STATE pMS)
|
||||
crew_delta = -1;
|
||||
--StarShipPtr->ShipInfo.crew_level;
|
||||
}
|
||||
else
|
||||
{ // no crew to dismiss
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
ShowShipCrew (StarShipPtr, &pMS->flash_rect0);
|
||||
r.corner.x = pMS->flash_rect0.corner.x;
|
||||
r.corner.y = pMS->flash_rect0.corner.y
|
||||
|
||||
Reference in New Issue
Block a user