Index: src/sc2code/outfit.c =================================================================== RCS file: /cvsroot/sc2/sc2/src/sc2code/outfit.c,v retrieving revision 1.21 diff -u -r1.21 outfit.c --- src/sc2code/outfit.c 22 Jan 2005 21:40:45 -0000 1.21 +++ src/sc2code/outfit.c 19 Jul 2005 05:41:27 -0000 @@ -525,54 +525,79 @@ { RECT r; - r.extent.height = 1; - - if (PulsedInputState.key[KEY_MENU_UP]) + if (PulsedInputState.key[KEY_MENU_UP] || PulsedInputState.key[KEY_MENU_PAGE_UP]) { + SBYTE repeat = 1; LockMutex (GraphicsLock); - SetContext (SpaceContext); - if (GetFTankCapacity (&r.corner) > GLOBAL_SIS (FuelOnBoard) - && GLOBAL_SIS (ResUnits) >= - (DWORD)GLOBAL (FuelCost)) - { - if (GLOBAL_SIS (FuelOnBoard) >= - FUEL_RESERVE - FUEL_TANK_SCALE) - { - r.extent.width = 3; - DrawPoint (&r.corner); - r.corner.x += r.extent.width + 1; - DrawPoint (&r.corner); - r.corner.x -= r.extent.width; - SetContextForeGroundColor (SetContextBackGroundColor (BLACK_COLOR)); - DrawFilledRectangle (&r); - } - DeltaSISGauges (0, FUEL_TANK_SCALE, -GLOBAL (FuelCost)); - SetContext (StatusContext); - GetGaugeRect (&r, FALSE); - SetFlashRect (&r, (FRAME)0); - } + + if ( PulsedInputState.key[KEY_MENU_PAGE_UP] ) + { + repeat = 10; + } + + while ( repeat != 0 ) + { + r.extent.height = 1; + + SetContext (SpaceContext); + if (GetFTankCapacity (&r.corner) > GLOBAL_SIS (FuelOnBoard) + && GLOBAL_SIS (ResUnits) >= + (DWORD)GLOBAL (FuelCost)) + { + if (GLOBAL_SIS (FuelOnBoard) >= + FUEL_RESERVE - FUEL_TANK_SCALE) + { + r.extent.width = 3; + DrawPoint (&r.corner); + r.corner.x += r.extent.width + 1; + DrawPoint (&r.corner); + r.corner.x -= r.extent.width; + SetContextForeGroundColor (SetContextBackGroundColor (BLACK_COLOR)); + DrawFilledRectangle (&r); + } + DeltaSISGauges (0, FUEL_TANK_SCALE, -GLOBAL (FuelCost)); + SetContext (StatusContext); + GetGaugeRect (&r, FALSE); + SetFlashRect (&r, (FRAME)0); + } + repeat--; + } UnlockMutex (GraphicsLock); } - else if (PulsedInputState.key[KEY_MENU_DOWN]) + else if (PulsedInputState.key[KEY_MENU_DOWN] || PulsedInputState.key[KEY_MENU_PAGE_DOWN]) { + SBYTE repeat = 1; + LockMutex (GraphicsLock); - SetContext (SpaceContext); - if (GLOBAL_SIS (FuelOnBoard)) - { - DeltaSISGauges (0, -FUEL_TANK_SCALE, - GLOBAL (FuelCost)); - if (GLOBAL_SIS (FuelOnBoard) - % FUEL_VOLUME_PER_ROW == 0) - { - GetFTankCapacity (&r.corner); - SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xB, 0x00, 0x00), 0x2E)); - r.extent.width = 5; - DrawFilledRectangle (&r); - } - } - SetContext (StatusContext); - GetGaugeRect (&r, FALSE); - SetFlashRect (&r, (FRAME)0); + + if ( PulsedInputState.key[KEY_MENU_PAGE_DOWN] ) + { + repeat = 10; + } + + while ( repeat != 0 ) + { + r.extent.height = 1; + + SetContext (SpaceContext); + if (GLOBAL_SIS (FuelOnBoard)) + { + DeltaSISGauges (0, -FUEL_TANK_SCALE, + GLOBAL (FuelCost)); + if (GLOBAL_SIS (FuelOnBoard) + % FUEL_VOLUME_PER_ROW == 0) + { + GetFTankCapacity (&r.corner); + SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xB, 0x00, 0x00), 0x2E)); + r.extent.width = 5; + DrawFilledRectangle (&r); + } + } + SetContext (StatusContext); + GetGaugeRect (&r, FALSE); + SetFlashRect (&r, (FRAME)0); + repeat--; + } UnlockMutex (GraphicsLock); } } Index: src/sc2code/shipyard.c =================================================================== RCS file: /cvsroot/sc2/sc2/src/sc2code/shipyard.c,v retrieving revision 1.38 diff -u -r1.38 shipyard.c --- src/sc2code/shipyard.c 23 Jan 2005 12:24:15 -0000 1.38 +++ src/sc2code/shipyard.c 19 Jul 2005 05:41:28 -0000 @@ -614,6 +614,7 @@ { SBYTE dx = 0; SBYTE dy = 0; + SBYTE repeat = 0; BYTE NewState; if (!(pMS->delta_item & MODIFY_CREW_FLAG)) @@ -625,6 +626,22 @@ if (PulsedInputState.key[KEY_MENU_LEFT]) dx = -1; if (PulsedInputState.key[KEY_MENU_UP]) dy = -1; if (PulsedInputState.key[KEY_MENU_DOWN]) dy = 1; + + repeat = 1; + if (pMS->delta_item & MODIFY_CREW_FLAG) + { + if (PulsedInputState.key[KEY_MENU_PAGE_UP]) + { + dy = -1; + repeat = 10; + } + if (PulsedInputState.key[KEY_MENU_PAGE_DOWN]) + { + dy = 1; + repeat = 10; + } + } + NewState = pMS->CurState; if (pMS->delta_item & MODIFY_CREW_FLAG) { @@ -712,286 +729,291 @@ } else #endif + if (select || ((pMS->delta_item & MODIFY_CREW_FLAG) && (dx || dy || cancel))) { - COUNT ShipCost[] = - { - RACE_SHIP_COST - }; - - if (hStarShip == 0 && HINIBBLE (pMS->CurState) == 0) - { - COUNT Index; - -// SetFlashRect (NULL_PTR, (FRAME)0); - UnlockMutex (GraphicsLock); - if (!(pMS->delta_item & MODIFY_CREW_FLAG)) - { - pMS->delta_item = MODIFY_CREW_FLAG; - DrawRaceStrings (0); - return TRUE; - } - else if (cancel) - { - pMS->delta_item ^= MODIFY_CREW_FLAG; - LockMutex (GraphicsLock); - SetFlashRect ((PRECT)~0L, (FRAME)0); - UnlockMutex (GraphicsLock); - DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW); - SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); - } - else if (select) - { - Index = GetIndexFromStarShip (&GLOBAL (avail_race_q), - GetAvailableRaceFromIndex ( - LOBYTE (pMS->delta_item))); - - if (GLOBAL_SIS (ResUnits) >= (DWORD)ShipCost[Index] - && CloneShipFragment (Index, - &GLOBAL (built_ship_q), 1)) - { - ShowCombatShip ((COUNT)pMS->CurState, - (SHIP_FRAGMENTPTR) 0); - //Reset flash rectangle - LockMutex (GraphicsLock); - SetFlashRect ((PRECT)~0L, (FRAME)0); - UnlockMutex (GraphicsLock); - DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW); - - LockMutex (GraphicsLock); - DeltaSISGauges (UNDEFINED_DELTA, UNDEFINED_DELTA, - -((int)ShipCost[Index])); - r.corner.x = pMS->flash_rect0.corner.x; - r.corner.y = pMS->flash_rect0.corner.y - + pMS->flash_rect0.extent.height - 6; - r.extent.width = SHIP_WIN_WIDTH; - r.extent.height = 5; - SetContext (SpaceContext); - SetFlashRect (&r, (FRAME)0); - UnlockMutex (GraphicsLock); - } - SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, - MENU_SOUND_SELECT | MENU_SOUND_CANCEL); - - return TRUE; - } - else - { - Index = GetAvailableRaceCount (); - NewState = LOBYTE (pMS->delta_item); - if (dx < 0 || dy < 0) - { - if (NewState-- == 0) - NewState = Index - 1; - } - else if (dx > 0 || dy > 0) - { - if (++NewState == Index) - NewState = 0; - } - - if (NewState != LOBYTE (pMS->delta_item)) - { - DrawRaceStrings (NewState); - pMS->delta_item = NewState | MODIFY_CREW_FLAG; - } - - return TRUE; - } - LockMutex (GraphicsLock); - goto ChangeFlashRect; - } - else if (select || cancel) - { - if ((pMS->delta_item & MODIFY_CREW_FLAG) - && hStarShip != 0) - { - StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip ( - &GLOBAL (built_ship_q), hStarShip); - if (StarShipPtr->ShipInfo.crew_level == 0) - { - SetFlashRect (NULL_PTR, (FRAME)0); - UnlockMutex (GraphicsLock); - ShowCombatShip ((COUNT)pMS->CurState, - StarShipPtr); - LockMutex (GraphicsLock); - UnlockStarShip (&GLOBAL (built_ship_q), - hStarShip); - RemoveQueue (&GLOBAL (built_ship_q), hStarShip); - FreeStarShip (&GLOBAL (built_ship_q), hStarShip); - // refresh SIS display - DeltaSISGauges (UNDEFINED_DELTA, UNDEFINED_DELTA, - UNDEFINED_DELTA); - DrawStatusMessage ((UNICODE *)~0); - r.corner.x = pMS->flash_rect0.corner.x; - r.corner.y = pMS->flash_rect0.corner.y; - r.extent.width = SHIP_WIN_WIDTH; - r.extent.height = SHIP_WIN_HEIGHT; - SetContext (SpaceContext); - SetFlashRect (&r, (FRAME)0); - } - else - { - UnlockStarShip (&GLOBAL (built_ship_q), - hStarShip); - } - } - - if (!(pMS->delta_item ^= MODIFY_CREW_FLAG)) - { - goto ChangeFlashRect; - } - else if (hStarShip == 0) - { - SetContext (StatusContext); - GetGaugeRect (&r, TRUE); - SetFlashRect (&r, (FRAME)0); - SetContext (SpaceContext); - SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, - MENU_SOUND_SELECT | MENU_SOUND_CANCEL); - } - else - { - r.corner.x = pMS->flash_rect0.corner.x; - r.corner.y = pMS->flash_rect0.corner.y - + pMS->flash_rect0.extent.height - 6; - r.extent.width = SHIP_WIN_WIDTH; - r.extent.height = 5; - SetContext (SpaceContext); - SetFlashRect (&r, (FRAME)0); - SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, - MENU_SOUND_SELECT | MENU_SOUND_CANCEL); - } - } - else if (pMS->delta_item & MODIFY_CREW_FLAG) - { - SIZE crew_delta, crew_bought; - - if (hStarShip) - StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip ( - &GLOBAL (built_ship_q), hStarShip); - else - StarShipPtr = NULL; // Keeping compiler quiet. - - SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, - MENU_SOUND_SELECT | MENU_SOUND_CANCEL); - crew_delta = 0; - if (dy < 0) - { - if (hStarShip == 0) - { - if (GetCPodCapacity (&r.corner) > GetCrewCount () - && GLOBAL_SIS (ResUnits) >= - (DWORD)GLOBAL (CrewCost)) - { - DrawPoint (&r.corner); - DeltaSISGauges (1, 0, -GLOBAL (CrewCost)); - crew_delta = 1; - - SetContext (StatusContext); - GetGaugeRect (&r, TRUE); - SetFlashRect (&r, (FRAME)0); - SetContext (SpaceContext); - } - } - else - { - HSTARSHIP hTemplate; - SHIP_FRAGMENTPTR TemplatePtr; - - hTemplate = GetStarShipFromIndex ( - &GLOBAL (avail_race_q), - GET_RACE_ID (StarShipPtr)); - TemplatePtr = (SHIP_FRAGMENTPTR)LockStarShip ( - &GLOBAL (avail_race_q), hTemplate); - if (GLOBAL_SIS (ResUnits) >= - (DWORD)GLOBAL (CrewCost) - && StarShipPtr->ShipInfo.crew_level < - StarShipPtr->ShipInfo.max_crew && - StarShipPtr->ShipInfo.crew_level < - TemplatePtr->RaceDescPtr->ship_info. - crew_level) - { - if (StarShipPtr->ShipInfo.crew_level > 0) - DeltaSISGauges (0, 0, -GLOBAL (CrewCost)); - else - DeltaSISGauges (0, 0, -(COUNT)ShipCost[ - GET_RACE_ID (StarShipPtr) ]); - ++StarShipPtr->ShipInfo.crew_level; - crew_delta = 1; - ShowShipCrew (StarShipPtr, &pMS->flash_rect0); - r.corner.x = pMS->flash_rect0.corner.x; - r.corner.y = pMS->flash_rect0.corner.y - + pMS->flash_rect0.extent.height - 6; - r.extent.width = SHIP_WIN_WIDTH; - r.extent.height = 5; - SetContext (SpaceContext); - SetFlashRect (&r, (FRAME)0); - } - UnlockStarShip (&GLOBAL (avail_race_q), - hTemplate); - } - } - else if (dy > 0) - { - crew_bought = (SIZE)MAKE_WORD ( - GET_GAME_STATE (CREW_PURCHASED0), - GET_GAME_STATE (CREW_PURCHASED1)); - if (hStarShip == 0) - { - if (GetCrewCount ()) - { - DeltaSISGauges (-1, 0, GLOBAL (CrewCost) - - (crew_bought == - CREW_EXPENSE_THRESHOLD ? 2 : 0)); - crew_delta = -1; - - GetCPodCapacity (&r.corner); - SetContextForeGroundColor (BLACK_COLOR); - DrawPoint (&r.corner); - - SetContext (StatusContext); - GetGaugeRect (&r, TRUE); - SetFlashRect (&r, (FRAME)0); - SetContext (SpaceContext); - } - } - else - { - if (StarShipPtr->ShipInfo.crew_level > 0) - { - if (StarShipPtr->ShipInfo.crew_level > 1) - DeltaSISGauges (0, 0, GLOBAL (CrewCost) - - (crew_bought == - CREW_EXPENSE_THRESHOLD ? 2 : 0)); - else - DeltaSISGauges (0, 0, (COUNT)ShipCost[ - GET_RACE_ID (StarShipPtr)]); - crew_delta = -1; - --StarShipPtr->ShipInfo.crew_level; - } - ShowShipCrew (StarShipPtr, &pMS->flash_rect0); - r.corner.x = pMS->flash_rect0.corner.x; - r.corner.y = pMS->flash_rect0.corner.y - + pMS->flash_rect0.extent.height - 6; - r.extent.width = SHIP_WIN_WIDTH; - r.extent.height = 5; - SetContext (SpaceContext); - SetFlashRect (&r, (FRAME)0); - } - } - - if (hStarShip) - { - UnlockStarShip (&GLOBAL (built_ship_q), hStarShip); - - // clear out the bought ship index - // so that flash rects work correctly - pMS->delta_item &= MODIFY_CREW_FLAG; - } - CrewTransaction (crew_delta); - } + while ( repeat != 0 ) + { + COUNT ShipCost[] = + { + RACE_SHIP_COST + }; + + if (hStarShip == 0 && HINIBBLE (pMS->CurState) == 0) + { + COUNT Index; + + // SetFlashRect (NULL_PTR, (FRAME)0); + UnlockMutex (GraphicsLock); + if (!(pMS->delta_item & MODIFY_CREW_FLAG)) + { + pMS->delta_item = MODIFY_CREW_FLAG; + DrawRaceStrings (0); + return TRUE; + } + else if (cancel) + { + pMS->delta_item ^= MODIFY_CREW_FLAG; + LockMutex (GraphicsLock); + SetFlashRect ((PRECT)~0L, (FRAME)0); + UnlockMutex (GraphicsLock); + DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW); + SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); + } + else if (select) + { + Index = GetIndexFromStarShip (&GLOBAL (avail_race_q), + GetAvailableRaceFromIndex ( + LOBYTE (pMS->delta_item))); + + if (GLOBAL_SIS (ResUnits) >= (DWORD)ShipCost[Index] + && CloneShipFragment (Index, + &GLOBAL (built_ship_q), 1)) + { + ShowCombatShip ((COUNT)pMS->CurState, + (SHIP_FRAGMENTPTR) 0); + //Reset flash rectangle + LockMutex (GraphicsLock); + SetFlashRect ((PRECT)~0L, (FRAME)0); + UnlockMutex (GraphicsLock); + DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW); + + LockMutex (GraphicsLock); + DeltaSISGauges (UNDEFINED_DELTA, UNDEFINED_DELTA, + -((int)ShipCost[Index])); + r.corner.x = pMS->flash_rect0.corner.x; + r.corner.y = pMS->flash_rect0.corner.y + + pMS->flash_rect0.extent.height - 6; + r.extent.width = SHIP_WIN_WIDTH; + r.extent.height = 5; + SetContext (SpaceContext); + SetFlashRect (&r, (FRAME)0); + UnlockMutex (GraphicsLock); + } + SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, + MENU_SOUND_SELECT | MENU_SOUND_CANCEL); + + return TRUE; + } + else + { + Index = GetAvailableRaceCount (); + NewState = LOBYTE (pMS->delta_item); + if (dx < 0 || dy < 0) + { + if (NewState-- == 0) + NewState = Index - 1; + } + else if (dx > 0 || dy > 0) + { + if (++NewState == Index) + NewState = 0; + } + + if (NewState != LOBYTE (pMS->delta_item)) + { + DrawRaceStrings (NewState); + pMS->delta_item = NewState | MODIFY_CREW_FLAG; + } + + return TRUE; + } + LockMutex (GraphicsLock); + goto ChangeFlashRect; + } + else if (select || cancel) + { + if ((pMS->delta_item & MODIFY_CREW_FLAG) + && hStarShip != 0) + { + StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip ( + &GLOBAL (built_ship_q), hStarShip); + if (StarShipPtr->ShipInfo.crew_level == 0) + { + SetFlashRect (NULL_PTR, (FRAME)0); + UnlockMutex (GraphicsLock); + ShowCombatShip ((COUNT)pMS->CurState, + StarShipPtr); + LockMutex (GraphicsLock); + UnlockStarShip (&GLOBAL (built_ship_q), + hStarShip); + RemoveQueue (&GLOBAL (built_ship_q), hStarShip); + FreeStarShip (&GLOBAL (built_ship_q), hStarShip); + // refresh SIS display + DeltaSISGauges (UNDEFINED_DELTA, UNDEFINED_DELTA, + UNDEFINED_DELTA); + DrawStatusMessage ((UNICODE *)~0); + r.corner.x = pMS->flash_rect0.corner.x; + r.corner.y = pMS->flash_rect0.corner.y; + r.extent.width = SHIP_WIN_WIDTH; + r.extent.height = SHIP_WIN_HEIGHT; + SetContext (SpaceContext); + SetFlashRect (&r, (FRAME)0); + } + else + { + UnlockStarShip (&GLOBAL (built_ship_q), + hStarShip); + } + } + + if (!(pMS->delta_item ^= MODIFY_CREW_FLAG)) + { + goto ChangeFlashRect; + } + else if (hStarShip == 0) + { + SetContext (StatusContext); + GetGaugeRect (&r, TRUE); + SetFlashRect (&r, (FRAME)0); + SetContext (SpaceContext); + SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, + MENU_SOUND_SELECT | MENU_SOUND_CANCEL); + } + else + { + r.corner.x = pMS->flash_rect0.corner.x; + r.corner.y = pMS->flash_rect0.corner.y + + pMS->flash_rect0.extent.height - 6; + r.extent.width = SHIP_WIN_WIDTH; + r.extent.height = 5; + SetContext (SpaceContext); + SetFlashRect (&r, (FRAME)0); + SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, + MENU_SOUND_SELECT | MENU_SOUND_CANCEL); + } + } + else if (pMS->delta_item & MODIFY_CREW_FLAG) + { + SIZE crew_delta, crew_bought; + + if (hStarShip) + StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip ( + &GLOBAL (built_ship_q), hStarShip); + else + StarShipPtr = NULL; // Keeping compiler quiet. + + SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, + MENU_SOUND_SELECT | MENU_SOUND_CANCEL); + crew_delta = 0; + if (dy < 0) + { + if (hStarShip == 0) + { + if (GetCPodCapacity (&r.corner) > GetCrewCount () + && GLOBAL_SIS (ResUnits) >= + (DWORD)GLOBAL (CrewCost)) + { + DrawPoint (&r.corner); + DeltaSISGauges (1, 0, -GLOBAL (CrewCost)); + crew_delta = 1; + + SetContext (StatusContext); + GetGaugeRect (&r, TRUE); + SetFlashRect (&r, (FRAME)0); + SetContext (SpaceContext); + } + } + else + { + HSTARSHIP hTemplate; + SHIP_FRAGMENTPTR TemplatePtr; + + hTemplate = GetStarShipFromIndex ( + &GLOBAL (avail_race_q), + GET_RACE_ID (StarShipPtr)); + TemplatePtr = (SHIP_FRAGMENTPTR)LockStarShip ( + &GLOBAL (avail_race_q), hTemplate); + if (GLOBAL_SIS (ResUnits) >= + (DWORD)GLOBAL (CrewCost) + && StarShipPtr->ShipInfo.crew_level < + StarShipPtr->ShipInfo.max_crew && + StarShipPtr->ShipInfo.crew_level < + TemplatePtr->RaceDescPtr->ship_info. + crew_level) + { + if (StarShipPtr->ShipInfo.crew_level > 0) + DeltaSISGauges (0, 0, -GLOBAL (CrewCost)); + else + DeltaSISGauges (0, 0, -(COUNT)ShipCost[ + GET_RACE_ID (StarShipPtr) ]); + ++StarShipPtr->ShipInfo.crew_level; + crew_delta = 1; + ShowShipCrew (StarShipPtr, &pMS->flash_rect0); + r.corner.x = pMS->flash_rect0.corner.x; + r.corner.y = pMS->flash_rect0.corner.y + + pMS->flash_rect0.extent.height - 6; + r.extent.width = SHIP_WIN_WIDTH; + r.extent.height = 5; + SetContext (SpaceContext); + SetFlashRect (&r, (FRAME)0); + } + UnlockStarShip (&GLOBAL (avail_race_q), + hTemplate); + } + } + else if (dy > 0) + { + crew_bought = (SIZE)MAKE_WORD ( + GET_GAME_STATE (CREW_PURCHASED0), + GET_GAME_STATE (CREW_PURCHASED1)); + if (hStarShip == 0) + { + if (GetCrewCount ()) + { + DeltaSISGauges (-1, 0, GLOBAL (CrewCost) + - (crew_bought == + CREW_EXPENSE_THRESHOLD ? 2 : 0)); + crew_delta = -1; + + GetCPodCapacity (&r.corner); + SetContextForeGroundColor (BLACK_COLOR); + DrawPoint (&r.corner); + + SetContext (StatusContext); + GetGaugeRect (&r, TRUE); + SetFlashRect (&r, (FRAME)0); + SetContext (SpaceContext); + } + } + else + { + if (StarShipPtr->ShipInfo.crew_level > 0) + { + if (StarShipPtr->ShipInfo.crew_level > 1) + DeltaSISGauges (0, 0, GLOBAL (CrewCost) + - (crew_bought == + CREW_EXPENSE_THRESHOLD ? 2 : 0)); + else + DeltaSISGauges (0, 0, (COUNT)ShipCost[ + GET_RACE_ID (StarShipPtr)]); + crew_delta = -1; + --StarShipPtr->ShipInfo.crew_level; + } + ShowShipCrew (StarShipPtr, &pMS->flash_rect0); + r.corner.x = pMS->flash_rect0.corner.x; + r.corner.y = pMS->flash_rect0.corner.y + + pMS->flash_rect0.extent.height - 6; + r.extent.width = SHIP_WIN_WIDTH; + r.extent.height = 5; + SetContext (SpaceContext); + SetFlashRect (&r, (FRAME)0); + } + } + + if (hStarShip) + { + UnlockStarShip (&GLOBAL (built_ship_q), hStarShip); + + // clear out the bought ship index + // so that flash rects work correctly + pMS->delta_item &= MODIFY_CREW_FLAG; + } + CrewTransaction (crew_delta); + } + repeat--; + } } else if (cancel) {