mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Drivable Cars update (by anv):
- Streamlined vehicle controls - no more selecting driver and vehicle separately, switching displayed APs and other esoteric activities. To move vehicle just select its driver and you're good to go. If you click on vehicle in tactical, also its driver will be selected automatically. Besides driving car, driver can perform other actions normally. - Vehicle's APs, health and fuel are displayed on the steering wheel - thanks to Buggler for idea. Vehicle APs are treated as a resource (so if car changes driver mid-turn, it won't go any further than it would). - Added option Tactical Interface Settings > ADD_PASSENGER_TO_ANY_SQUAD. If you order passenger to exit vehicle by clicking on the seat belt, he'll be added to new squad, so if you ordered six passengers to exit one by one, you'd end up with six new squads. With ADD_PASSENGER_TO_ANY_SQUAD = TRUE, passenger will be added to any existing squad with empty slot if possible. - Added option Tactical Interface Settings > PASSENGER_LEAVING_SWITCH_TO_NEW_SQUAD. If you order passenger to exit vehicle by clicking on the seat belt, by default you get switched to his new squad. With PASSENGER_LEAVING_SWITCH_TO_NEW_SQUAD = FALSE you'll switch only if exiting passenger is the selected one. - Cosmetic fix: changed display above vehicle from "*Merc's name* (VEHICLE)" to "*Merc's name* (*Vehicle's name*)" and colour from yellow to white (since mercs in vehicle are controllable and yellow is reserved for mercs on assignments). - Fixed passengers rotation. Again. - Fixed vehicles getting "tired" - lowered APs due to fuel below max. They can move the same as long as they have any fuel. - Fixed unrelated bug: clicking on any empty slot in team panel would select merc with id 0. - Fixed unrelated bug: switching to squad with less mercs would cause team panel to still show skill tooltips for mercs from previous squad on empty slots. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7204 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
|
||||
#include "SkillMenu.h" // sevenfm: need this for TraitsMenu
|
||||
|
||||
#include "Vehicles.h" // anv: for switching from soldier to vehicle
|
||||
|
||||
#endif
|
||||
|
||||
@@ -177,6 +178,7 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
{
|
||||
UINT16 usSoldierIndex;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
SOLDIERTYPE *pVehicle;
|
||||
UINT32 uiMercFlags;
|
||||
static UINT32 uiSingleClickTime;
|
||||
INT32 usMapPos;
|
||||
@@ -184,7 +186,7 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
static BOOLEAN fValidDoubleClickPossible = FALSE;
|
||||
static BOOLEAN fCanCheckForSpeechAdvance = FALSE;
|
||||
static INT32 sMoveClickGridNo = 0;
|
||||
|
||||
UINT16 usSubjectSoldier = gusSelectedSoldier;
|
||||
|
||||
// LEFT MOUSE BUTTON
|
||||
if ( gViewportRegion.uiFlags & MSYS_MOUSE_IN_AREA )
|
||||
@@ -200,6 +202,11 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( MercPtrs[ gusSelectedSoldier ]->flags.uiStatusFlags & SOLDIER_DRIVER )
|
||||
{
|
||||
pVehicle = GetSoldierStructureForVehicle( MercPtrs[ usSubjectSoldier ]->iVehicleId );
|
||||
usSubjectSoldier = pVehicle->ubID;
|
||||
}
|
||||
}
|
||||
|
||||
if ( gViewportRegion.ButtonState & MSYS_LEFT_BUTTON )
|
||||
@@ -299,9 +306,9 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
{
|
||||
BOOLEAN fResult;
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
if ( usSubjectSoldier != NOBODY )
|
||||
{
|
||||
if ( ( fResult = UIOKMoveDestination( MercPtrs[ gusSelectedSoldier ], usMapPos ) ) == 1 )
|
||||
if ( ( fResult = UIOKMoveDestination( MercPtrs[ usSubjectSoldier ], usMapPos ) ) == 1 )
|
||||
{
|
||||
if ( gsCurrentActionPoints != 0 )
|
||||
{
|
||||
@@ -432,14 +439,14 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
fDoubleClickIntercepted = TRUE;
|
||||
|
||||
// First check if we clicked on a guy, if so, make selected if it's ours
|
||||
if( gusSelectedSoldier != NOBODY )
|
||||
if( usSubjectSoldier != NOBODY )
|
||||
{
|
||||
// Set movement mode
|
||||
// OK, only change this if we are stationary!
|
||||
//if ( gAnimControl[ MercPtrs[ gusSelectedSoldier ]->usAnimState ].uiFlags & ANIM_STATIONARY )
|
||||
//if ( MercPtrs[ gusSelectedSoldier ]->usAnimState == WALKING )
|
||||
{
|
||||
MercPtrs[ gusSelectedSoldier ]->flags.fUIMovementFast = TRUE;
|
||||
MercPtrs[ usSubjectSoldier ]->flags.fUIMovementFast = TRUE;
|
||||
*puiNewEvent = C_MOVE_MERC;
|
||||
}
|
||||
}
|
||||
@@ -578,15 +585,15 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
|
||||
case CONFIRM_MOVE_MODE:
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
if ( usSubjectSoldier != NOBODY )
|
||||
{
|
||||
if ( MercPtrs[ gusSelectedSoldier ]->usAnimState != RUNNING )
|
||||
if ( MercPtrs[ usSubjectSoldier ]->usAnimState != RUNNING )
|
||||
{
|
||||
*puiNewEvent = C_MOVE_MERC;
|
||||
}
|
||||
else
|
||||
{
|
||||
MercPtrs[ gusSelectedSoldier ]->flags.fUIMovementFast = 2;
|
||||
MercPtrs[ usSubjectSoldier ]->flags.fUIMovementFast = 2;
|
||||
*puiNewEvent = C_MOVE_MERC;
|
||||
}
|
||||
}
|
||||
@@ -749,7 +756,7 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
}
|
||||
else if ( bReturnCode == 0 )
|
||||
{
|
||||
if( GetSoldier( &pSoldier, gusSelectedSoldier ) )
|
||||
if( GetSoldier( &pSoldier, usSubjectSoldier ) )
|
||||
{
|
||||
// First check if we clicked on a guy, if so, make selected if it's ours
|
||||
if( FindSoldierFromMouse( &usSoldierIndex, &uiMercFlags ) && ( uiMercFlags & OWNED_MERC ) )
|
||||
@@ -770,9 +777,9 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
{
|
||||
BOOLEAN fResult;
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
if ( usSubjectSoldier != NOBODY )
|
||||
{
|
||||
if ( ( fResult = UIOKMoveDestination( MercPtrs[ gusSelectedSoldier ], usMapPos ) ) == 1 )
|
||||
if ( ( fResult = UIOKMoveDestination( MercPtrs[ usSubjectSoldier ], usMapPos ) ) == 1 )
|
||||
{
|
||||
if ( gfUIAllMoveOn )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user