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:
avolkov
2006-03-24 20:38:48 +00:00
parent dc09f3f8fd
commit de9ccfe5b5
9 changed files with 50 additions and 21 deletions
+2 -5
View File
@@ -142,8 +142,7 @@ DoConfirmExit (void)
if (PulsedInputState.key[KEY_MENU_SELECT]) if (PulsedInputState.key[KEY_MENU_SELECT])
{ {
done = TRUE; done = TRUE;
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1), PlayMenuSound (MENU_SOUND_SUCCESS);
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
} }
else if (PulsedInputState.key[KEY_MENU_CANCEL]) else if (PulsedInputState.key[KEY_MENU_CANCEL])
{ {
@@ -154,9 +153,7 @@ DoConfirmExit (void)
{ {
response = !response; response = !response;
DrawConfirmationWindow (response); DrawConfirmationWindow (response);
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 0), PlayMenuSound (MENU_SOUND_MOVE);
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
} }
TaskSwitch (); TaskSwitch ();
} while (!done); } while (!done);
+1 -1
View File
@@ -289,7 +289,7 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
S = MenuSounds; S = MenuSounds;
if (input & sound_1) if (input & sound_1)
S = SetAbsSoundIndex (S, 1); S = SetAbsSoundIndex (S, MENU_SOUND_SUCCESS);
PlaySoundEffect (S, 0, NotPositional (), NULL, 0); PlaySoundEffect (S, 0, NotPositional (), NULL, 0);
} }
+1 -2
View File
@@ -402,8 +402,7 @@ DoTextEntry (PTEXTENTRY_STATE pTES)
pTES->InsPt = CacheInsPt; pTES->InsPt = CacheInsPt;
pTES->CursorPos = CacheCursorPos; pTES->CursorPos = CacheCursorPos;
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 2), PlayMenuSound (MENU_SOUND_FAILURE);
0, NotPositional (), NULL, 0);
} }
} }
+2 -4
View File
@@ -1712,8 +1712,7 @@ DoMelee (PMELEE_STATE pMS)
case START_MELEE: case START_MELEE:
if (pMS->star_bucks[0] == 0 || pMS->star_bucks[1] == 0) if (pMS->star_bucks[0] == 0 || pMS->star_bucks[1] == 0)
{ {
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 2), PlayMenuSound (MENU_SOUND_FAILURE);
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
break; break;
} }
@@ -1781,8 +1780,7 @@ DoMelee (PMELEE_STATE pMS)
if (pMS->star_bucks[pMS->side]) if (pMS->star_bucks[pMS->side])
DoSaveTeam (pMS); DoSaveTeam (pMS);
else else
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 2), PlayMenuSound (MENU_SOUND_FAILURE);
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
break; break;
case CONTROLS_TOP: case CONTROLS_TOP:
case CONTROLS_BOT: case CONTROLS_BOT:
+20
View File
@@ -244,16 +244,22 @@ DoInstallModule (PMENU_STATE pMS)
if (GLOBAL_SIS (ResUnits) < if (GLOBAL_SIS (ResUnits) <
(DWORD)(GLOBAL (ModuleCost[new_slot_piece]) (DWORD)(GLOBAL (ModuleCost[new_slot_piece])
* MODULE_COST_SCALE)) * MODULE_COST_SCALE))
{ // not enough RUs to build
PlayMenuSound (MENU_SOUND_FAILURE);
return (TRUE); return (TRUE);
} }
}
else if (new_slot_piece == EMPTY_SLOT + 2) else if (new_slot_piece == EMPTY_SLOT + 2)
{ {
if (old_slot_piece == CREW_POD) if (old_slot_piece == CREW_POD)
{ {
if (GLOBAL_SIS (CrewEnlisted) > CREW_POD_CAPACITY if (GLOBAL_SIS (CrewEnlisted) > CREW_POD_CAPACITY
* (CountSISPieces (CREW_POD) - 1)) * (CountSISPieces (CREW_POD) - 1))
{ // crew pod still needed for crew recruited
PlayMenuSound (MENU_SOUND_FAILURE);
return (TRUE); return (TRUE);
} }
}
else if (old_slot_piece == FUEL_TANK else if (old_slot_piece == FUEL_TANK
|| old_slot_piece == HIGHEFF_FUELSYS) || old_slot_piece == HIGHEFF_FUELSYS)
{ {
@@ -266,16 +272,22 @@ DoInstallModule (PMENU_STATE pMS)
volume -= (old_slot_piece == FUEL_TANK volume -= (old_slot_piece == FUEL_TANK
? FUEL_TANK_CAPACITY : HEFUEL_TANK_CAPACITY); ? FUEL_TANK_CAPACITY : HEFUEL_TANK_CAPACITY);
if (GLOBAL_SIS (FuelOnBoard) > volume + FUEL_RESERVE) if (GLOBAL_SIS (FuelOnBoard) > volume + FUEL_RESERVE)
{ // fuel tank still needed for the fuel on board
PlayMenuSound (MENU_SOUND_FAILURE);
return (TRUE); return (TRUE);
} }
}
else if (old_slot_piece == STORAGE_BAY) else if (old_slot_piece == STORAGE_BAY)
{ {
if (GLOBAL_SIS (TotalElementMass) > STORAGE_BAY_CAPACITY if (GLOBAL_SIS (TotalElementMass) > STORAGE_BAY_CAPACITY
* (CountSISPieces (STORAGE_BAY) - 1)) * (CountSISPieces (STORAGE_BAY) - 1))
{ // storage bay still needed for the cargo
PlayMenuSound (MENU_SOUND_FAILURE);
return (TRUE); return (TRUE);
} }
} }
} }
}
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
SetContext (SpaceContext); SetContext (SpaceContext);
@@ -552,6 +564,10 @@ ChangeFuelQuantity (void)
GetGaugeRect (&r, FALSE); GetGaugeRect (&r, FALSE);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r, (FRAME)0);
} }
else
{ // no more room for fuel or not enough RUs
PlayMenuSound (MENU_SOUND_FAILURE);
}
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
else if (PulsedInputState.key[KEY_MENU_DOWN]) else if (PulsedInputState.key[KEY_MENU_DOWN])
@@ -571,6 +587,10 @@ ChangeFuelQuantity (void)
DrawFilledRectangle (&r); DrawFilledRectangle (&r);
} }
} }
else
{ // no fuel left to drain
PlayMenuSound (MENU_SOUND_FAILURE);
}
SetContext (StatusContext); SetContext (StatusContext);
GetGaugeRect (&r, FALSE); GetGaugeRect (&r, FALSE);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r, (FRAME)0);
+2 -3
View File
@@ -151,7 +151,7 @@ DoGetMelee (GETMELEE_STATE *gms)
gms->row = new_row; gms->row = new_row;
gms->col = new_col; gms->col = new_col;
PlaySoundEffect (MenuSounds, 0, NotPositional (), NULL, 0); PlayMenuSound (MENU_SOUND_MOVE);
ChangeSelection: ChangeSelection:
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
gms->flash_rect.corner.x = PICK_X_OFFS gms->flash_rect.corner.x = PICK_X_OFFS
@@ -363,8 +363,7 @@ GetMeleeStarShip (STARSHIPPTR LastStarShipPtr, COUNT which_player)
StarShipPtr->captains_name_index = 0; StarShipPtr->captains_name_index = 0;
UnlockStarShip (&race_q[which_player], gmstate.hBattleShip); UnlockStarShip (&race_q[which_player], gmstate.hBattleShip);
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1), 0, PlayMenuSound (MENU_SOUND_SUCCESS);
NotPositional (), NULL, 0);
WaitForSoundEnd (0); WaitForSoundEnd (0);
} }
+2 -4
View File
@@ -63,8 +63,7 @@ DoPickBattleShip (PMENU_STATE pMS)
{ {
if ((HSTARSHIP)pMS->CurFrame) if ((HSTARSHIP)pMS->CurFrame)
{ {
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1), PlayMenuSound (MENU_SOUND_SUCCESS);
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
return (FALSE); return (FALSE);
} }
} }
@@ -99,8 +98,7 @@ DoPickBattleShip (PMENU_STATE pMS)
else if (new_row == NUM_PICK_SHIP_ROWS) else if (new_row == NUM_PICK_SHIP_ROWS)
new_row = 0; new_row = 0;
PlaySoundEffect (MenuSounds, 0, NotPositional (), PlayMenuSound (MENU_SOUND_MOVE);
NULL, GAME_SOUND_PRIORITY);
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
-2
View File
@@ -196,8 +196,6 @@ else if (InputState & DEVICE_EXIT) return (FALSE);
UnbatchGraphics (); UnbatchGraphics ();
return TRUE; return TRUE;
case QUIT_GAME: case QUIT_GAME:
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1),
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
fade_buf[0] = FadeAllToBlack; fade_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2)); SleepThreadUntil (XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2));
+20
View File
@@ -767,6 +767,10 @@ DoModifyShips (PMENU_STATE pMS)
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r, (FRAME)0);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
else
{ // not enough RUs to build
PlayMenuSound (MENU_SOUND_FAILURE);
}
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN,
MENU_SOUND_SELECT | MENU_SOUND_CANCEL); MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
@@ -890,6 +894,10 @@ DoModifyShips (PMENU_STATE pMS)
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r, (FRAME)0);
SetContext (SpaceContext); SetContext (SpaceContext);
} }
else
{ // at capacity or not enough RUs
PlayMenuSound (MENU_SOUND_FAILURE);
}
} }
else else
{ {
@@ -925,6 +933,10 @@ DoModifyShips (PMENU_STATE pMS)
SetContext (SpaceContext); SetContext (SpaceContext);
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r, (FRAME)0);
} }
else
{ // at capacity or not enough RUs
PlayMenuSound (MENU_SOUND_FAILURE);
}
UnlockStarShip (&GLOBAL (avail_race_q), UnlockStarShip (&GLOBAL (avail_race_q),
hTemplate); hTemplate);
} }
@@ -952,6 +964,10 @@ DoModifyShips (PMENU_STATE pMS)
SetFlashRect (&r, (FRAME)0); SetFlashRect (&r, (FRAME)0);
SetContext (SpaceContext); SetContext (SpaceContext);
} }
else
{ // no crew to dismiss
PlayMenuSound (MENU_SOUND_FAILURE);
}
} }
else else
{ {
@@ -967,6 +983,10 @@ DoModifyShips (PMENU_STATE pMS)
crew_delta = -1; crew_delta = -1;
--StarShipPtr->ShipInfo.crew_level; --StarShipPtr->ShipInfo.crew_level;
} }
else
{ // no crew to dismiss
PlayMenuSound (MENU_SOUND_FAILURE);
}
ShowShipCrew (StarShipPtr, &pMS->flash_rect0); ShowShipCrew (StarShipPtr, &pMS->flash_rect0);
r.corner.x = pMS->flash_rect0.corner.x; r.corner.x = pMS->flash_rect0.corner.x;
r.corner.y = pMS->flash_rect0.corner.y r.corner.y = pMS->flash_rect0.corner.y