New option ALTERNATE_MOUSE_COMMANDS in Ja2_Options.ini (by Sevenfm)

- With this option = TRUE, mousewheel is inverted for changing stance with ALT+mousewheel, also some new mouse actions are possible.
- Alternate mouse actions: see "Docs\Manual\JA2_113_Alternate_Mouse_Commands.xlsx"
  https://ja2svn.no-ip.org/source/ja2_v1.13_data/GameDir/Docs/Manuals/JA2_113_Alternate_Mouse_Commands.xlsx

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6684 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-12-06 16:47:10 +00:00
parent 4cf6aa49d2
commit 0bae7724a0
6 changed files with 1493 additions and 713 deletions
+104 -1
View File
@@ -7314,7 +7314,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
}
void CycleThroughKnownEnemies( )
void CycleThroughKnownEnemies( BOOLEAN backward )
{
// static to indicate last position we were at:
SOLDIERTYPE *pSoldier;
@@ -7328,9 +7328,43 @@ void CycleThroughKnownEnemies( )
{
fFirstTime = FALSE;
if(backward)
usStartToLook = TOTAL_SOLDIERS;
else
usStartToLook = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
}
if(backward)
for ( cnt = TOTAL_SOLDIERS-1 , pSoldier = MercPtrs[ cnt ]; cnt >= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt--, pSoldier-- )
{
// try to find first active, OK enemy
if ( pSoldier->bActive && pSoldier->bInSector && !pSoldier->aiData.bNeutral && (pSoldier->bSide != gbPlayerNum) && (pSoldier->stats.bLife > 0) )
{
if ( pSoldier->bVisible != -1 )
{
fEnemiesFound = TRUE;
// If we are < ok start, this is the one!
if ( cnt < usStartToLook )
{
usStartToLook = (UINT16)cnt;
// Locate to!
//LocateSoldier( pSoldier->ubID, 1 );
//ATE: Change to Slide To...
SlideTo( 0, pSoldier->ubID, 0, SETANDREMOVEPREVIOUSLOCATOR );
return;
}
else
{
fEnemyBehindStartLook = TRUE;
}
}
}
}
else
for ( cnt = gTacticalStatus.Team[ gbPlayerNum ].bLastID, pSoldier = MercPtrs[ cnt ]; cnt < TOTAL_SOLDIERS; cnt++, pSoldier++ )
{
// try to find first active, OK enemy
@@ -7369,10 +7403,18 @@ void CycleThroughKnownEnemies( )
// If to, recurse!
if ( fEnemyBehindStartLook )
{
if( backward )
{
usStartToLook = TOTAL_SOLDIERS ;
CycleThroughKnownEnemies( TRUE );
}
else
{
usStartToLook = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
CycleThroughKnownEnemies( );
}
}
}
@@ -7438,6 +7480,67 @@ void CycleVisibleEnemies( SOLDIERTYPE *pSrcSoldier )
}
void CycleVisibleEnemiesBackward( SOLDIERTYPE *pSrcSoldier )
{
// static to indicate last position we were at:
SOLDIERTYPE *pSoldier;
UINT16 usStartToLook;
UINT32 cnt;
usStartToLook = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
// for ( cnt = gTacticalStatus.Team[ gbPlayerNum ].bLastID, pSoldier = MercPtrs[ cnt ]; cnt < TOTAL_SOLDIERS; cnt++, pSoldier++ )
for ( cnt = TOTAL_SOLDIERS-1, pSoldier = MercPtrs[ cnt ]; cnt >= gTacticalStatus.Team[ gbPlayerNum ].bLastID ; cnt--, pSoldier-- )
{
// try to find first active, OK enemy
if ( pSoldier->bActive && pSoldier->bInSector && !pSoldier->aiData.bNeutral && (pSoldier->bSide != gbPlayerNum) && (pSoldier->stats.bLife > 0) )
{
if ( pSrcSoldier->aiData.bOppList[ pSoldier->ubID ] == SEEN_CURRENTLY )
{
// If we are > ok start, this is the one!
if ( cnt < pSrcSoldier->ubLastEnemyCycledID )
{
pSrcSoldier->ubLastEnemyCycledID = (UINT8)cnt;
//ATE: Change to Slide To...
SlideTo( 0, pSoldier->ubID, 0, SETANDREMOVEPREVIOUSLOCATOR );
ChangeInterfaceLevel( pSoldier->pathing.bLevel );
return;
}
}
}
}
// If here.. reset to max
pSrcSoldier->ubLastEnemyCycledID = TOTAL_SOLDIERS;
usStartToLook = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
//for ( cnt = gTacticalStatus.Team[ gbPlayerNum ].bLastID, pSoldier = MercPtrs[ cnt ]; cnt >= 0; cnt--, pSoldier-- )
for ( cnt = TOTAL_SOLDIERS-1, pSoldier = MercPtrs[ cnt ]; cnt >= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt--, pSoldier-- )
{
// try to find first active, OK enemy
if ( pSoldier->bActive && pSoldier->bInSector && !pSoldier->aiData.bNeutral && (pSoldier->bSide != gbPlayerNum) && (pSoldier->stats.bLife > 0) )
{
if ( pSrcSoldier->aiData.bOppList[ pSoldier->ubID ] == SEEN_CURRENTLY )
{
// If we are > ok start, this is the one!
if ( cnt < pSrcSoldier->ubLastEnemyCycledID )
{
pSrcSoldier->ubLastEnemyCycledID = (UINT8)cnt;
//ATE: Change to Slide To...
SlideTo( 0, pSoldier->ubID, 0, SETANDREMOVEPREVIOUSLOCATOR );
ChangeInterfaceLevel( pSoldier->pathing.bLevel );
return;
}
}
}
}
}
UINT32 CountNonVehiclesOnPlayerTeam( )
{