Fine control on menu sounds (bug #449)
Smoothed out various warts in the interfaces that had to do with the global sound resource going NULL on occasion. Added sounds for page up/down where appropriate. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1294 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
Changes towards version 0.4:
|
||||
- Fine-grained control of menu sounds, "MenuSounds" global now
|
||||
guaranteed to always be non-null -Michael
|
||||
- Added support for stdio file access through temporary files to uio.
|
||||
added uio_copyFile to uio - SvdB
|
||||
- Added uio_getFileLocation() and uio_getMountFileSystemType() to uio.
|
||||
|
||||
@@ -1557,6 +1557,8 @@ AlienTalkSegue (COUNT wait_track)
|
||||
static BOOLEAN
|
||||
DoCommunication (PENCOUNTER_STATE pES)
|
||||
{
|
||||
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT);
|
||||
|
||||
if (!(CommData.AlienTransitionDesc.AnimFlags & (TALK_INTRO | TALK_DONE)))
|
||||
{
|
||||
AlienTalkSegue ((COUNT)~0);
|
||||
|
||||
@@ -150,6 +150,8 @@ DoConfirmExit (void)
|
||||
if (CurrentMenuState.select)
|
||||
{
|
||||
done = TRUE;
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1),
|
||||
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||
}
|
||||
else if (CurrentMenuState.cancel)
|
||||
{
|
||||
@@ -160,6 +162,9 @@ DoConfirmExit (void)
|
||||
{
|
||||
response = !response;
|
||||
DrawConfirmationWindow (response);
|
||||
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 0),
|
||||
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||
|
||||
}
|
||||
TaskSwitch ();
|
||||
} while (!done);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
static BOOLEAN
|
||||
DoSelectAction (PMENU_STATE pMS)
|
||||
{
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||
{
|
||||
pMS->CurState = ATTACK + 1;
|
||||
|
||||
@@ -50,6 +50,8 @@ static DWORD _max_accel, _min_accel, _step_accel;
|
||||
static BOOLEAN _gestalt_keys;
|
||||
int ExitState;
|
||||
|
||||
static MENU_SOUND_FLAGS sound_0, sound_1;
|
||||
|
||||
volatile CONTROLLER_INPUT_STATE ImmediateInputState;
|
||||
volatile MENU_INPUT_STATE ImmediateMenuState;
|
||||
|
||||
@@ -269,6 +271,7 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
|
||||
}
|
||||
do
|
||||
{
|
||||
MENU_SOUND_FLAGS input;
|
||||
TaskSwitch ();
|
||||
|
||||
UpdateInputState ();
|
||||
@@ -284,17 +287,25 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
|
||||
|
||||
if (CurrentInputState.exit)
|
||||
ExitState = ConfirmExit ();
|
||||
|
||||
input = MENU_SOUND_NONE;
|
||||
if (CurrentMenuState.up) input |= MENU_SOUND_UP;
|
||||
if (CurrentMenuState.down) input |= MENU_SOUND_DOWN;
|
||||
if (CurrentMenuState.left) input |= MENU_SOUND_LEFT;
|
||||
if (CurrentMenuState.right) input |= MENU_SOUND_RIGHT;
|
||||
if (CurrentMenuState.select) input |= MENU_SOUND_SELECT;
|
||||
if (CurrentMenuState.cancel) input |= MENU_SOUND_CANCEL;
|
||||
if (CurrentMenuState.special) input |= MENU_SOUND_SPECIAL;
|
||||
if (CurrentMenuState.page_up) input |= MENU_SOUND_PAGEUP;
|
||||
if (CurrentMenuState.page_down) input |= MENU_SOUND_PAGEDOWN;
|
||||
if (CurrentMenuState.del) input |= MENU_SOUND_DELETE;
|
||||
|
||||
if (MenuSounds
|
||||
&& (pSolarSysState == 0
|
||||
/* see if in menu */
|
||||
|| pSolarSysState->MenuState.CurState
|
||||
|| pSolarSysState->MenuState.Initialized > 2)
|
||||
&& (CurrentMenuState.select
|
||||
|| CurrentMenuState.up
|
||||
|| CurrentMenuState.down
|
||||
|| CurrentMenuState.left
|
||||
|| CurrentMenuState.right)
|
||||
&& (input & (sound_0 | sound_1))
|
||||
#ifdef NEVER
|
||||
&& !PLRPlaying ((MUSIC_REF)~0)
|
||||
#endif /* NEVER */
|
||||
@@ -303,7 +314,7 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
|
||||
SOUND S;
|
||||
|
||||
S = MenuSounds;
|
||||
if (CurrentMenuState.select)
|
||||
if (input & sound_1)
|
||||
S = SetAbsSoundIndex (S, 1);
|
||||
|
||||
PlaySoundEffect (S, 0, NotPositional (), NULL, 0);
|
||||
@@ -317,6 +328,21 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SetMenuSounds (MENU_SOUND_FLAGS s0, MENU_SOUND_FLAGS s1)
|
||||
{
|
||||
sound_0 = s0;
|
||||
sound_1 = s1;
|
||||
}
|
||||
|
||||
void
|
||||
GetMenuSounds (MENU_SOUND_FLAGS *s0, MENU_SOUND_FLAGS *s1)
|
||||
{
|
||||
*s0 = sound_0;
|
||||
*s1 = sound_1;
|
||||
}
|
||||
|
||||
|
||||
BATTLE_INPUT_STATE
|
||||
p1_combat_summary (void)
|
||||
{
|
||||
|
||||
@@ -444,6 +444,8 @@ DoNaming (PMENU_STATE pMS)
|
||||
DoInput (pMS, TRUE);
|
||||
DisableCharacterMode ();
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
pMS->InputFunc = DoSettings;
|
||||
pMS->CurState = (BYTE)pMS->delta_item;
|
||||
pMS->delta_item = 0;
|
||||
@@ -502,6 +504,7 @@ DoSettings (PMENU_STATE pMS)
|
||||
return (FALSE);
|
||||
|
||||
cur_speed = (BYTE)(GLOBAL (glob_flags) & COMBAT_SPEED_MASK) >> COMBAT_SPEED_SHIFT;
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
if (!pMS->Initialized)
|
||||
{
|
||||
DrawMenuStateStrings (PM_SOUND_ON, pMS->CurState);
|
||||
@@ -571,6 +574,8 @@ DoQuitMenu (PMENU_STATE pMS)
|
||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||
return (FALSE);
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
if (!pMS->Initialized)
|
||||
{
|
||||
DrawMenuStateStrings (PM_NO_QUIT, pMS->CurState);
|
||||
@@ -984,6 +989,7 @@ DoPickGame (PMENU_STATE pMS)
|
||||
return (FALSE);
|
||||
}
|
||||
first_time = (BOOLEAN)(pMS->Initialized == 0);
|
||||
SetMenuSounds (MENU_SOUND_ARROWS | MENU_SOUND_PAGEUP | MENU_SOUND_PAGEDOWN, MENU_SOUND_SELECT);
|
||||
|
||||
if (!pMS->Initialized)
|
||||
{
|
||||
@@ -1288,8 +1294,7 @@ PickGame (PMENU_STATE pMS)
|
||||
pMS->CurString = (STRING)&desc_array[0];
|
||||
UnlockMutex (GraphicsLock);
|
||||
|
||||
DoInput (pMS, TRUE);
|
||||
|
||||
DoInput (pMS, TRUE);
|
||||
LockMutex (GraphicsLock);
|
||||
pMS->Initialized = -1;
|
||||
pMS->InputFunc = DoGameOptions;
|
||||
@@ -1357,6 +1362,8 @@ DoGameOptions (PMENU_STATE pMS)
|
||||
if (LastActivity == CHECK_LOAD)
|
||||
force_select = TRUE;
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
if (pMS->Initialized <= 0)
|
||||
{
|
||||
if (LastActivity == CHECK_LOAD)
|
||||
@@ -1410,6 +1417,7 @@ GameOptions (void)
|
||||
|
||||
MenuState.InputFunc = DoGameOptions;
|
||||
MenuState.CurState = SAVE_GAME;
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)&MenuState, TRUE);
|
||||
|
||||
pLocMenuState = 0;
|
||||
|
||||
@@ -1614,6 +1614,7 @@ UnbatchGraphics ();
|
||||
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
||||
UnlockMutex (GraphicsLock);
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)&MenuState, TRUE);
|
||||
|
||||
LockMutex (GraphicsLock);
|
||||
|
||||
@@ -445,6 +445,7 @@ TFB_VideoInput (VIDEO_REF VidRef)
|
||||
vis.InputFunc = TFB_DoVideoInput;
|
||||
vis.CurVideo = VidRef;
|
||||
|
||||
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||
DoInput (&vis, TRUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -844,6 +844,8 @@ DoLoadTeam (PMELEE_STATE pMS)
|
||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||
return (FALSE);
|
||||
|
||||
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN | MENU_SOUND_PAGEUP | MENU_SOUND_PAGEDOWN, MENU_SOUND_SELECT);
|
||||
|
||||
if (!pMS->Initialized)
|
||||
{
|
||||
LockMutex (GraphicsLock);
|
||||
@@ -1164,6 +1166,7 @@ DoEdit (PMELEE_STATE pMS)
|
||||
{
|
||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||
return (FALSE);
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT | MENU_SOUND_DELETE);
|
||||
if (!pMS->Initialized)
|
||||
{
|
||||
pMS->CurIndex = pMS->TeamImage[pMS->side].ShipList[pMS->row][pMS->col];
|
||||
@@ -1308,6 +1311,8 @@ DoPickShip (PMELEE_STATE pMS)
|
||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||
return (FALSE);
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
if (pMS->Initialized <= 0)
|
||||
{
|
||||
if (pMS->CurIndex == (BYTE)~0 && pMS->Initialized == 0)
|
||||
@@ -1585,6 +1590,7 @@ DoMelee (PMELEE_STATE pMS)
|
||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||
return (FALSE);
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
if (!pMS->Initialized)
|
||||
{
|
||||
pMS->Initialized = TRUE;
|
||||
@@ -2049,6 +2055,7 @@ Melee (void)
|
||||
MenuState.side = 0;
|
||||
MenuState.star_bucks[0] = GetTeamValue (&MenuState.TeamImage[0]);
|
||||
MenuState.star_bucks[1] = GetTeamValue (&MenuState.TeamImage[1]);
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)&MenuState, TRUE);
|
||||
|
||||
WaitForSoundEnd (TFBSOUND_WAIT_ALL);
|
||||
|
||||
@@ -181,6 +181,8 @@ DoInstallModule (PMENU_STATE pMS)
|
||||
cancel = CurrentMenuState.cancel;
|
||||
motion = CurrentMenuState.left || CurrentMenuState.right || CurrentMenuState.up || CurrentMenuState.down;
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
FirstItem = 0;
|
||||
switch (NewState = pMS->CurState)
|
||||
{
|
||||
@@ -754,6 +756,16 @@ ExitOutfit:
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (pMS->CurState)
|
||||
{
|
||||
case OUTFIT_DOFUEL:
|
||||
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
|
||||
break;
|
||||
default:
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
break;
|
||||
}
|
||||
|
||||
if (pMS->CurState == OUTFIT_DOFUEL)
|
||||
ChangeFuelQuantity ();
|
||||
else
|
||||
|
||||
@@ -249,6 +249,7 @@ OldContext = SetContext (SpaceContext);
|
||||
|
||||
UnlockMutex (GraphicsLock);
|
||||
pMenuState = &MenuState;
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)&MenuState, TRUE);
|
||||
pMenuState = 0;
|
||||
LockMutex (GraphicsLock);
|
||||
|
||||
@@ -358,6 +358,7 @@ Cargo (PMENU_STATE pMS)
|
||||
DrawStatusMessage ((UNICODE *)~0);
|
||||
UnlockMutex (GraphicsLock);
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)pMS, TRUE);
|
||||
|
||||
pMS->InputFunc = DoFlagshipCommands;
|
||||
|
||||
@@ -625,6 +625,7 @@ Devices (PMENU_STATE pMS)
|
||||
pMS->CurFrame = (FRAME)DeviceMap;
|
||||
TFB_ResetControls ();
|
||||
DoManipulateDevices (pMS); /* to make sure it's initialized */
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)pMS, TRUE);
|
||||
pMS->CurFrame = 0;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ GenerateAndrosynth (BYTE control)
|
||||
|
||||
pPSD = (PPLANETSIDE_DESC)pMenuState->ModuleFrame;
|
||||
UnbatchGraphics ();
|
||||
DoDiscoveryReport (pPSD->OldMenuSounds);
|
||||
DoDiscoveryReport (MenuSounds);
|
||||
BatchGraphics ();
|
||||
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString =
|
||||
SetRelStringTableIndex (
|
||||
|
||||
@@ -315,7 +315,7 @@ GenerateVUX (BYTE control)
|
||||
|
||||
pPSD = (PPLANETSIDE_DESC)pMenuState->ModuleFrame;
|
||||
UnbatchGraphics ();
|
||||
DoDiscoveryReport (pPSD->OldMenuSounds);
|
||||
DoDiscoveryReport (MenuSounds);
|
||||
BatchGraphics ();
|
||||
pPSD->InTransit = TRUE;
|
||||
|
||||
|
||||
@@ -611,7 +611,7 @@ CheckObjectCollision (COUNT index)
|
||||
&& CurStarDescPtr->Index != ANDROSYNTH_DEFINED)
|
||||
{
|
||||
UnbatchGraphics ();
|
||||
DoDiscoveryReport (pPSD->OldMenuSounds);
|
||||
DoDiscoveryReport (MenuSounds);
|
||||
BatchGraphics ();
|
||||
}
|
||||
if (ElementPtr->mass_points == 0)
|
||||
@@ -1890,8 +1890,6 @@ PlanetSide (PMENU_STATE pMS)
|
||||
|
||||
memset ((PPLANETSIDE_DESC)&PSD, 0, sizeof (PSD));
|
||||
PSD.InTransit = TRUE;
|
||||
PSD.OldMenuSounds = MenuSounds;
|
||||
MenuSounds = 0;
|
||||
|
||||
PSD.TectonicsChance =
|
||||
TectonicsChanceTab[pSolarSysState->SysInfo.PlanetInfo.Tectonics];
|
||||
@@ -1973,6 +1971,7 @@ PlanetSide (PMENU_STATE pMS)
|
||||
|
||||
pMS->Initialized = FALSE;
|
||||
pMS->InputFunc = DoPlanetSide;
|
||||
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||
DoInput ((PVOID)pMS, FALSE);
|
||||
|
||||
if (!(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
||||
@@ -2079,7 +2078,7 @@ PlanetSide (PMENU_STATE pMS)
|
||||
}
|
||||
|
||||
ZeroVelocityComponents (&GLOBAL (velocity));
|
||||
MenuSounds = PSD.OldMenuSounds;
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
pSolarSysState->MenuState.Initialized -= 4;
|
||||
pSolarSysState->PauseRotate = 0;
|
||||
|
||||
@@ -1078,7 +1078,6 @@ DoneSphereGrowth:
|
||||
static BOOLEAN
|
||||
DoStarMap (void)
|
||||
{
|
||||
SOUND OldMenuSounds;
|
||||
MENU_STATE MenuState;
|
||||
POINT universe;
|
||||
//FRAME OldFrame;
|
||||
@@ -1134,11 +1133,9 @@ DoStarMap (void)
|
||||
UnbatchGraphics ();
|
||||
UnlockMutex (GraphicsLock);
|
||||
|
||||
OldMenuSounds = MenuSounds;
|
||||
MenuSounds = 0;
|
||||
|
||||
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||
DoInput ((PVOID)&MenuState, FALSE);
|
||||
MenuSounds = OldMenuSounds;
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
pMenuState = 0;
|
||||
|
||||
|
||||
@@ -225,6 +225,15 @@ DoModifyRoster (PMENU_STATE pMS)
|
||||
down = CurrentMenuState.down;
|
||||
horiz = CurrentMenuState.left || CurrentMenuState.right;
|
||||
|
||||
if (pMS->Initialized && (pMS->CurState & SHIP_TOGGLE))
|
||||
{
|
||||
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
}
|
||||
|
||||
if (!pMS->Initialized)
|
||||
{
|
||||
pMS->InputFunc = DoModifyRoster;
|
||||
@@ -436,6 +445,7 @@ Roster (void)
|
||||
|
||||
MenuState.flash_frame0 = (FRAME)ship_pos;
|
||||
MenuState.flash_frame1 = (FRAME)modified_ship_pos;
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)&MenuState, TRUE);
|
||||
|
||||
pMenuState = pOldMenuState;
|
||||
|
||||
@@ -669,11 +669,7 @@ PickPlanetSide (PMENU_STATE pMS)
|
||||
{
|
||||
pMS->InputFunc = PickPlanetSide;
|
||||
SetMenuRepeatDelay (0, 0, 0, FALSE);
|
||||
if (pMS->CurFrame == 0)
|
||||
{
|
||||
pMS->CurFrame = (FRAME)MenuSounds;
|
||||
MenuSounds = 0;
|
||||
}
|
||||
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||
if (!select)
|
||||
{
|
||||
RECT r;
|
||||
@@ -706,8 +702,7 @@ PickPlanetSide (PMENU_STATE pMS)
|
||||
{
|
||||
STAMP s;
|
||||
|
||||
MenuSounds = (SOUND)pMS->CurFrame;
|
||||
pMS->CurFrame = 0;
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
LockMutex (GraphicsLock);
|
||||
DrawStatusMessage (NULL_PTR);
|
||||
@@ -801,15 +796,12 @@ PickPlanetSide (PMENU_STATE pMS)
|
||||
UnlockMutex (GraphicsLock);
|
||||
|
||||
ExitPlanetSide:
|
||||
if (pMS->CurFrame)
|
||||
{
|
||||
MenuSounds = (SOUND)pMS->CurFrame;
|
||||
pMS->CurFrame = 0;
|
||||
}
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
pMS->InputFunc = DoScan;
|
||||
pMS->CurState = DISPATCH_SHUTTLE;
|
||||
SetDefaultMenuRepeatDelay ();
|
||||
return (FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1019,7 +1011,7 @@ DoScan (PMENU_STATE pMS)
|
||||
|
||||
pMS->Initialized = FALSE;
|
||||
pMS->CurFrame = 0;
|
||||
return (PickPlanetSide (pMS));
|
||||
return PickPlanetSide (pMS);
|
||||
}
|
||||
|
||||
pSolarSysState->MenuState.Initialized += 4;
|
||||
@@ -1235,6 +1227,7 @@ ScanSystem (void)
|
||||
PrintCoarseScan3DO ();
|
||||
|
||||
pMenuState = &MenuState;
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)&MenuState, FALSE);
|
||||
pMenuState = 0;
|
||||
|
||||
|
||||
@@ -1926,6 +1926,7 @@ ExploreSolarSys (void)
|
||||
SolarSysState.GenFunc = GenerateIP (CurStarDescPtr->Index);
|
||||
|
||||
InitSolarSys ();
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)&SolarSysState.MenuState, FALSE);
|
||||
UninitSolarSys ();
|
||||
pSolarSysState = 0;
|
||||
|
||||
@@ -289,6 +289,7 @@ LastActivity = WON_LAST_BATTLE;
|
||||
|
||||
FlushInput ();
|
||||
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
||||
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)&MenuState, TRUE);
|
||||
|
||||
LockMutex (GraphicsLock);
|
||||
|
||||
@@ -643,6 +643,11 @@ DoModifyShips (PMENU_STATE pMS)
|
||||
SBYTE dx = 0, dy = 0;
|
||||
BYTE NewState;
|
||||
|
||||
if (!(pMS->delta_item & MODIFY_CREW_FLAG))
|
||||
{
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
}
|
||||
|
||||
if (CurrentMenuState.right) dx = 1;
|
||||
if (CurrentMenuState.left) dx = -1;
|
||||
if (CurrentMenuState.up) dy = -1;
|
||||
@@ -709,7 +714,15 @@ DoModifyShips (PMENU_STATE pMS)
|
||||
&GLOBAL (built_ship_q), hStarShip
|
||||
);
|
||||
}
|
||||
|
||||
if ((pMS->delta_item & MODIFY_CREW_FLAG) && (hStarShip))
|
||||
{
|
||||
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
}
|
||||
|
||||
LockMutex (GraphicsLock);
|
||||
|
||||
#ifdef WANT_SHIP_SPINS
|
||||
@@ -759,6 +772,7 @@ DoModifyShips (PMENU_STATE pMS)
|
||||
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
||||
UnlockMutex (GraphicsLock);
|
||||
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
}
|
||||
else if (select)
|
||||
{
|
||||
@@ -845,7 +859,9 @@ DoModifyShips (PMENU_STATE pMS)
|
||||
}
|
||||
|
||||
if (!(pMS->delta_item ^= MODIFY_CREW_FLAG))
|
||||
{
|
||||
goto ChangeFlashRect;
|
||||
}
|
||||
else if (hStarShip == 0)
|
||||
{
|
||||
SetContext (StatusContext);
|
||||
@@ -1201,6 +1217,7 @@ DoShipyard (PMENU_STATE pMS)
|
||||
select = CurrentMenuState.select;
|
||||
cancel = CurrentMenuState.cancel;
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
if (!pMS->Initialized)
|
||||
{
|
||||
pMS->InputFunc = DoShipyard;
|
||||
|
||||
@@ -279,6 +279,7 @@ DoStarBase (PMENU_STATE pMS)
|
||||
pMS->CurState = DEPART_BASE;
|
||||
goto ExitStarBase;
|
||||
}
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
|
||||
if (!pMS->Initialized)
|
||||
{
|
||||
@@ -385,6 +386,7 @@ ExitStarBase:
|
||||
break;
|
||||
}
|
||||
|
||||
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||
DoInput ((PVOID)pMS, TRUE);
|
||||
|
||||
pMS->Initialized = FALSE;
|
||||
|
||||
@@ -171,6 +171,21 @@ extern void Introduction (void);
|
||||
int initIO (void);
|
||||
void uninitIO (void);
|
||||
|
||||
/* Constants for DoInput */
|
||||
typedef UWORD MENU_SOUND_FLAGS;
|
||||
#define MENU_SOUND_UP ((MENU_SOUND_FLAGS)(1 << 0))
|
||||
#define MENU_SOUND_DOWN ((MENU_SOUND_FLAGS)(1 << 1))
|
||||
#define MENU_SOUND_LEFT ((MENU_SOUND_FLAGS)(1 << 2))
|
||||
#define MENU_SOUND_RIGHT ((MENU_SOUND_FLAGS)(1 << 3))
|
||||
#define MENU_SOUND_SELECT ((MENU_SOUND_FLAGS)(1 << 4))
|
||||
#define MENU_SOUND_CANCEL ((MENU_SOUND_FLAGS)(1 << 5))
|
||||
#define MENU_SOUND_SPECIAL ((MENU_SOUND_FLAGS)(1 << 6))
|
||||
#define MENU_SOUND_PAGEUP ((MENU_SOUND_FLAGS)(1 << 7))
|
||||
#define MENU_SOUND_PAGEDOWN ((MENU_SOUND_FLAGS)(1 << 8))
|
||||
#define MENU_SOUND_DELETE ((MENU_SOUND_FLAGS)(1 << 9))
|
||||
#define MENU_SOUND_ARROWS (MENU_SOUND_UP | MENU_SOUND_DOWN | MENU_SOUND_LEFT | MENU_SOUND_RIGHT)
|
||||
#define MENU_SOUND_NONE ((MENU_SOUND_FLAGS)0)
|
||||
|
||||
extern void SetFlashRect (PRECT pRect, FRAME f);
|
||||
|
||||
extern void DrawStarConBox (PRECT pRect, SIZE BorderWidth, COLOR
|
||||
@@ -179,6 +194,8 @@ extern void DrawStarConBox (PRECT pRect, SIZE BorderWidth, COLOR
|
||||
extern BOOLEAN ConfirmExit (void);
|
||||
extern DWORD SeedRandomNumbers (void);
|
||||
extern void DoInput (PVOID pInputState, BOOLEAN resetInput);
|
||||
void SetMenuSounds (MENU_SOUND_FLAGS sound_0, MENU_SOUND_FLAGS sound_1);
|
||||
void GetMenuSounds (MENU_SOUND_FLAGS *sound_0, MENU_SOUND_FLAGS *sound_1);
|
||||
extern BOOLEAN Battle (void);
|
||||
extern void EncounterBattle (void);
|
||||
extern void SetPlayerInput (void);
|
||||
|
||||
Reference in New Issue
Block a user