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
+3
View File
@@ -1318,6 +1318,9 @@ void LoadGameExternalOptions()
// *** ddd - BEGIN
gGameExternalOptions.fExtMouseKeyEnabled = iniReader.ReadBoolean("Tactical Interface Settings", "ENABLE_EXT_MOUSE_KEYS", FALSE);
// sevenfm: new mouse commands
gGameExternalOptions.bAlternateMouseCommands = iniReader.ReadBoolean("Tactical Interface Settings", "ALTERNATE_MOUSE_COMMANDS", FALSE);
// New setting to change stamina
gGameExternalOptions.uStaminaHit = iniReader.ReadInteger("Tactical Interface Settings", "STAMINA_HIT", 10000);
+2
View File
@@ -780,6 +780,8 @@ typedef struct
//** ddd
//enable ext mouse key
BOOLEAN fExtMouseKeyEnabled;
// sevenfm: new mouse commands
BOOLEAN bAlternateMouseCommands;
// for small progress bar
BOOLEAN fSmallSizeProgressbar;
// stamina multiplier (for all weapons eg knife fist gun
+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( )
{
+2 -1
View File
@@ -278,7 +278,7 @@ void ExitCombatMode( );
void HandleTeamServices( UINT8 ubTeamNum );
void HandlePlayerServices( SOLDIERTYPE *pTeamSoldier );
void SetEnemyPresence( );
void CycleThroughKnownEnemies( );
void CycleThroughKnownEnemies( BOOLEAN backward = FALSE );
BOOLEAN CheckForEndOfCombatMode( BOOLEAN fIncrementTurnsNotSeen );
SOLDIERTYPE * FreeUpAttacker( );
BOOLEAN PlayerTeamFull( );
@@ -309,6 +309,7 @@ INT32 FindAdjacentPunchTarget( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTargetSold
SOLDIERTYPE * CivilianGroupMemberChangesSides( SOLDIERTYPE * pAttacked );
void CivilianGroupChangesSides( UINT8 ubCivilianGroup );
void CycleVisibleEnemies( SOLDIERTYPE *pSrcSoldier );
void CycleVisibleEnemiesBackward( SOLDIERTYPE *pSrcSoldier );
UINT8 CivilianGroupMembersChangeSidesWithinProximity( SOLDIERTYPE * pAttacked );
void PauseAITemporarily( );
void PauseAIUntilManuallyUnpaused( );
+372 -87
View File
@@ -110,6 +110,58 @@ void QueryRTWheels( UINT32 *puiNewEvent );
void QueryRTX1Button( UINT32 *puiNewEvent );
void QueryRTX2Button( UINT32 *puiNewEvent );
// sevenfm: new mouse commands
void HandleAltMouseRTWheel( void );
void HandleAltMouseRTMButton( UINT32 *puiNewEvent );
void HandleAltMouseRTX1Button( UINT32 *puiNewEvent );
void HandleAltMouseRTX2Button( UINT32 *puiNewEvent );
// sevenfm: original mouse commands functionality
void HandleMouseRTWheel( void );
void HandleMouseRTMButton( UINT32 *puiNewEvent );
void HandleMouseRTX1Button( UINT32 *puiNewEvent );
void HandleMouseRTX2Button( UINT32 *puiNewEvent );
// sevenfm: common functionality
void HandleRTToggleFireMode( void );
void HandleRTJumpThroughWindow( void );
void HandleRTJump( void );
void HandleRTLook( UINT32 *puiNewEvent );
void HandleRTLocateSoldier( void );
extern void SetScopeMode( INT32 usMapPos );
extern void HandleStealthChangeFromUIKeys( );
extern void HandleTBReloadAll( void );
extern void HandleTBEnterTurnbased( void );
extern void HandleTBToggleSneak( void );
extern void HandleTBSoldierRun( void );
extern void HandleTBPickUpBackpacks( void );
extern void HandleTBDropBackpacks( void );
extern void HandleTBLocatePrevMerc( void );
extern void HandleTBLocateNextMerc( void );
extern void HandleTBSwapGoogles( void );
extern void HandleTBSwapSidearm( void );
extern void HandleTBSwapKnife( void );
extern void HandleTBSwapGunsling( void );
extern void HandleTBSwapHands( void );
extern void HandleTBChangeLevel( void );
extern void HandleTBCycleThroughKnownEnemies( void );
extern void HandleTBGotoHigherStance( void );
extern void HandleTBCycleThroughVisibleEnemies( void );
extern void HandleTBCycleThroughKnownEnemiesBackward( void );
extern void HandleTBGotoLowerStance( void );
extern void HandleTBCycleThroughVisibleEnemiesBackward( void );
extern void HandleTBLocateSoldier( void );
extern void HandleTBToggleFormation( void );
extern void HandleTBToggleTrapNetworkView( void );
extern void HandleTBShowMines( void );
extern void HandleTBToggleStealthAll( void );
extern void HandleTBShowLOS( void );
extern void HandleTBShowCover( void );
extern void HandleTBReload( void );
extern void HandleTBToggleStealth( void );
void GetRTMouseButtonInput( UINT32 *puiNewEvent )
{
QueryRTLeftButton( puiNewEvent );
@@ -1688,28 +1740,11 @@ void QueryRTMButton( UINT32 *puiNewEvent )
else if ( fMiddleButtonDown )
{
/////ddd{ test okop placement
//if ( _KeyDown( CTRL ) )
//{
//
// PlaceSandbag(1);
// fMiddleButtonDown = FALSE;
// return;
//}
/////ddd }
if ( _KeyDown( ALT ) )
{
//ïåðåêëþ÷åíèå ðåæèìà îãíÿ
if ( ( gpItemPointer == NULL ) && ( gusSelectedSoldier != NOBODY ) &&
( ( gsCurInterfacePanel != SM_PANEL ) || ( ButtonList[ iSMPanelButtons[ BURSTMODE_BUTTON ] ]->uiFlags & BUTTON_ENABLED ) ) )
ChangeWeaponMode( MercPtrs[ gusSelectedSoldier ] );
}
if(gGameExternalOptions.bAlternateMouseCommands)
HandleAltMouseRTMButton( puiNewEvent );
else
*puiNewEvent = LC_LOOK;
HandleMouseRTMButton( puiNewEvent );
fMiddleButtonDown = FALSE;
// Reset counter
//RESETCOUNTER( RMOUSECLICK_DELAY_COUNTER );
@@ -1721,7 +1756,6 @@ void QueryRTMButton( UINT32 *puiNewEvent )
void QueryRTWheels( UINT32 *puiNewEvent )
{
INT32 sMapPos=0;
UINT8 bID;
gViewportRegion.WheelState = gViewportRegion.WheelState * ( gGameSettings.fOptions[TOPTION_INVERT_WHEEL] ? -1 : 1 );
if ( gViewportRegion.uiFlags & MSYS_MOUSE_IN_AREA )
@@ -1740,53 +1774,14 @@ void QueryRTWheels( UINT32 *puiNewEvent )
{
case IDLE_MODE:
case MOVE_MODE:
// nothing in hand and either not in SM panel, or the matching button is enabled if we are in SM panel
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) &&
( ( gsCurInterfacePanel != SM_PANEL ) || ( ButtonList[ iSMPanelButtons[ NEXTMERC_BUTTON ] ]->uiFlags & BUTTON_ENABLED ) ) )
{
if ( gViewportRegion.WheelState > 0 ) //êîëåñî îò ñåáÿ
{
//change stance ->DOWN
if ( _KeyDown( ALT ) )
{ if ( (gusSelectedSoldier != NOBODY) && ( gpItemPointer == NULL ) )
GotoLowerStance(MercPtrs[ gusSelectedSoldier ]);
break;
}
if ( gusSelectedSoldier != NOBODY )
{ //Select prev merc
bID = FindPrevActiveAndAliveMerc( MercPtrs[ gusSelectedSoldier ], TRUE, TRUE );
HandleLocateSelectMerc( bID, LOCATEANDSELECT_MERC );
// Center to guy....
LocateSoldier( gusSelectedSoldier, SETLOCATOR );
}
}
else
{
//change stance ->UP
if ( _KeyDown( ALT ) )
{ if ( (gusSelectedSoldier != NOBODY) && ( gpItemPointer == NULL ) )
GotoHeigherStance( MercPtrs[ gusSelectedSoldier ] );
break;
}
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"wheel %d", gViewportRegion.WheelState);
if ( gusSelectedSoldier != NOBODY )
{ //Select next merc
bID = FindNextMercInTeamPanel( MercPtrs[ gusSelectedSoldier ], FALSE, FALSE );
HandleLocateSelectMerc( bID, LOCATEANDSELECT_MERC );
// Center to guy....
LocateSoldier( gusSelectedSoldier, SETLOCATOR );
}
}
//*puiNewEvent = M_ON_TERRAIN; ????????????????
}
case HANDCURSOR_MODE:
if(gGameExternalOptions.bAlternateMouseCommands)
HandleAltMouseRTWheel();
else
HandleMouseRTWheel();
break;
case ACTION_MODE:
case CONFIRM_MOVE_MODE:
case HANDCURSOR_MODE:
case CONFIRM_MOVE_MODE:
case LOOKCURSOR_MODE:
case TALKCURSOR_MODE:
case MENU_MODE:
@@ -1821,6 +1816,246 @@ void QueryRTX1Button( UINT32 *puiNewEvent )
else if ( fX1ButtonDown )
{
fX1ButtonDown = FALSE;
if(gGameExternalOptions.bAlternateMouseCommands)
HandleAltMouseRTX1Button( puiNewEvent );
else
HandleMouseRTX1Button( puiNewEvent );
}
}
}
void QueryRTX2Button( UINT32 *puiNewEvent )
{
INT32 sMapPos;
if ( gViewportRegion.uiFlags & MSYS_MOUSE_IN_AREA )
{
if (!GetMouseMapPos( &sMapPos ) )
return;
if (gViewportRegion.ButtonState & MSYS_X2_BUTTON) // MID MOUSE BUTTON
{
if ( !fX2ButtonDown )
{
fX2ButtonDown = TRUE;
}
}
else if ( fX2ButtonDown )
{
fX2ButtonDown = FALSE;
if(gGameExternalOptions.bAlternateMouseCommands)
HandleAltMouseRTX2Button( puiNewEvent );
else
HandleMouseRTX2Button( puiNewEvent );
}
}
}
// sevenfm: new mouse commands
void HandleAltMouseRTWheel( void )
{
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) &&
( ( gsCurInterfacePanel != SM_PANEL ) || ( ButtonList[ iSMPanelButtons[ NEXTMERC_BUTTON ] ]->uiFlags & BUTTON_ENABLED ) ) )
{
if ( gViewportRegion.WheelState > 0 ) // wheel up
{
if ( _KeyDown( ALT ) )
if( _KeyDown( SHIFT ) )
{
if( _KeyDown( CTRL ) ) // SHIFT+CTRL+ALT
HandleTBPickUpBackpacks();
else // SHIFT+ALT
CycleThroughKnownEnemies();
}
else if ( _KeyDown( CTRL ) ) // CTRL+ALT
HandleTBSwapGoogles();
else // ALT
HandleTBGotoHigherStance();
else if( _KeyDown( CTRL ) )
{
if( _KeyDown( SHIFT ) ) // SHIFT+CTRL
HandleTBSwapGunsling();
else // CTRL
HandleTBSoldierRun();
}
else if( _KeyDown( SHIFT ) ) // SHIFT
HandleTBCycleThroughVisibleEnemies();
else
HandleTBLocatePrevMerc();
}
else // wheel down
{
if ( _KeyDown( ALT ) )
if( _KeyDown( SHIFT ) )
{
if( _KeyDown( CTRL ) ) // SHIFT+CTRL+ALT
HandleTBDropBackpacks();
else // SHIFT+ALT
CycleThroughKnownEnemies( TRUE );
}
else if ( _KeyDown( CTRL ) ) // CTRL+ALT
HandleTBSwapSidearm();
else // ALT
HandleTBGotoLowerStance();
else if( _KeyDown( CTRL ) )
{
if( _KeyDown( SHIFT ) ) // SHIFT+CTRL
HandleTBSwapKnife();
else // CTRL
HandleTBSwapHands();
}
else if( _KeyDown( SHIFT ) ) // SHIFT
HandleTBCycleThroughVisibleEnemiesBackward();
else
HandleTBLocateNextMerc();
}
}
}
void HandleAltMouseRTMButton( UINT32 *puiNewEvent )
{
INT32 usMapPos;
GetMouseMapPos( &usMapPos );
if ( _KeyDown( ALT ) )
if( _KeyDown( SHIFT ) )
{
if( _KeyDown( CTRL ) ) // SHIFT+CTRL+ALT
HandleRTJumpThroughWindow();
else // SHIFT+ALT
;// reserved
}
else if ( _KeyDown( CTRL ) ) // CTRL+ALT
HandleTBChangeLevel();
else // ALT
HandleRTToggleFireMode();
else if( _KeyDown( CTRL ) )
{
if( _KeyDown( SHIFT ) ) // SHIFT+CTRL
HandleRTJump();
else // CTRL
SetScopeMode( usMapPos );
}
else if( _KeyDown( SHIFT ) ) // SHIFT
HandleTBLocateSoldier();
else // Button
HandleRTLook( puiNewEvent );
}
void HandleAltMouseRTX1Button( UINT32 *puiNewEvent )
{
if ( _KeyDown( ALT ) )
if( _KeyDown( SHIFT ) )
{
if( _KeyDown( CTRL ) ) // SHIFT+CTRL+ALT
HandleTBToggleSneak();
else // SHIFT+ALT
HandleTBToggleFormation();
}
else if ( _KeyDown( CTRL ) ) // CTRL+ALT
HandleTBSwapGoogles();
else // ALT
HandleTBSwapKnife();
else if( _KeyDown( CTRL ) )
{
if( _KeyDown( SHIFT ) ) // SHIFT+CTRL
HandleTBEnterTurnbased();
else // CTRL
HandleTBSwapSidearm();
}
else if( _KeyDown( SHIFT ) ) // SHIFT
HandleTBSwapGunsling();
else // Button
HandleTBSwapHands();
}
void HandleAltMouseRTX2Button( UINT32 *puiNewEvent )
{
if ( _KeyDown( ALT ) )
if( _KeyDown( SHIFT ) )
{
if( _KeyDown( CTRL ) ) // SHIFT+CTRL+ALT
HandleTBToggleTrapNetworkView();
else // SHIFT+ALT
HandleTBReloadAll();
}
else if ( _KeyDown( CTRL ) ) // CTRL+ALT
HandleTBShowMines();
else // ALT
HandleTBToggleStealthAll();
else if( _KeyDown( CTRL ) )
{
if( _KeyDown( SHIFT ) ) // SHIFT+CTRL
HandleTBShowLOS();
else // CTRL
HandleTBShowCover();
}
else if( _KeyDown( SHIFT ) ) // SHIFT
HandleTBReload();
else // Button
HandleTBToggleStealth();
}
// sevenfm: original mouse commands functionality
void HandleMouseRTWheel( void )
{
UINT8 bID;
// nothing in hand and either not in SM panel, or the matching button is enabled if we are in SM panel
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) &&
( ( gsCurInterfacePanel != SM_PANEL ) || ( ButtonList[ iSMPanelButtons[ NEXTMERC_BUTTON ] ]->uiFlags & BUTTON_ENABLED ) ) )
{
if ( gViewportRegion.WheelState > 0 ) //êîëåñî îò ñåáÿ
{
//change stance ->DOWN
if ( _KeyDown( ALT ) )
{
if ( (gusSelectedSoldier != NOBODY) && ( gpItemPointer == NULL ) )
GotoLowerStance(MercPtrs[ gusSelectedSoldier ]);
return;
}
if ( gusSelectedSoldier != NOBODY )
{ //Select prev merc
bID = FindPrevActiveAndAliveMerc( MercPtrs[ gusSelectedSoldier ], TRUE, TRUE );
HandleLocateSelectMerc( bID, LOCATEANDSELECT_MERC );
// Center to guy....
LocateSoldier( gusSelectedSoldier, SETLOCATOR );
}
}
else
{
//change stance ->UP
if ( _KeyDown( ALT ) )
{
if ( (gusSelectedSoldier != NOBODY) && ( gpItemPointer == NULL ) )
GotoHeigherStance( MercPtrs[ gusSelectedSoldier ] );
return;
}
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"wheel %d", gViewportRegion.WheelState);
if ( gusSelectedSoldier != NOBODY )
{ //Select next merc
bID = FindNextMercInTeamPanel( MercPtrs[ gusSelectedSoldier ], FALSE, FALSE );
HandleLocateSelectMerc( bID, LOCATEANDSELECT_MERC );
// Center to guy....
LocateSoldier( gusSelectedSoldier, SETLOCATOR );
}
}
//*puiNewEvent = M_ON_TERRAIN; ????????????????
}
}
void HandleMouseRTMButton( UINT32 *puiNewEvent )
{
if ( _KeyDown( ALT ) )
{
// toggle fire mode
if ( ( gpItemPointer == NULL ) && ( gusSelectedSoldier != NOBODY ) &&
( ( gsCurInterfacePanel != SM_PANEL ) || ( ButtonList[ iSMPanelButtons[ BURSTMODE_BUTTON ] ]->uiFlags & BUTTON_ENABLED ) ) )
ChangeWeaponMode( MercPtrs[ gusSelectedSoldier ] );
}
else
*puiNewEvent = LC_LOOK;
}
void HandleMouseRTX1Button( UINT32 *puiNewEvent )
{
if ( !_KeyDown( ALT ) && !_KeyDown( SHIFT ))
{
UIHandleChangeLevel( NULL );
@@ -1875,28 +2110,10 @@ void QueryRTX1Button( UINT32 *puiNewEvent )
pjSoldier->BeginSoldierClimbFence( );
}
}
}
}
}
void QueryRTX2Button( UINT32 *puiNewEvent )
{
INT32 sMapPos;
if ( gViewportRegion.uiFlags & MSYS_MOUSE_IN_AREA )
{
if (!GetMouseMapPos( &sMapPos ) )
return;
if (gViewportRegion.ButtonState & MSYS_X2_BUTTON) // MID MOUSE BUTTON
{
if ( !fX2ButtonDown )
{
fX2ButtonDown = TRUE;
}
}
else if ( fX2ButtonDown )
{
fX2ButtonDown = FALSE;
void HandleMouseRTX2Button( UINT32 *puiNewEvent )
{
if ( _KeyDown( ALT ) )
AutoReload( MercPtrs[ gusSelectedSoldier ] );
else
@@ -1946,7 +2163,75 @@ void QueryRTX2Button( UINT32 *puiNewEvent )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_OFF_STEALTHMODE ] );
}
}
}
// sevenfm: common functionality
void HandleRTLook( UINT32 *puiNewEvent )
{
*puiNewEvent = LC_LOOK;
}
void HandleRTJump( void )
{
// Climb on roofs
SOLDIERTYPE *pjSoldier;
if ( GetSoldier( &pjSoldier, gusSelectedSoldier ) )
{
BOOLEAN fNearHeigherLevel;
BOOLEAN fNearLowerLevel;
INT8 bDirection;
// CHRISL: Turn off manual jumping while wearing a backpack
if(UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true)
return;
// Make sure the merc is not collapsed!
if (!IsValidStance(pjSoldier, ANIM_CROUCH) )
{
if ( pjSoldier->bCollapsed && pjSoldier->bBreath < OKBREATH )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, gzLateLocalizedString[ 4 ], pjSoldier->name );
return;
}
GetMercClimbDirection( pjSoldier->ubID, &fNearLowerLevel, &fNearHeigherLevel );
if ( fNearLowerLevel )
pjSoldier->BeginSoldierClimbDownRoof( );
if ( fNearHeigherLevel )
pjSoldier->BeginSoldierClimbUpRoof( );
if ( FindFenceJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) )
pjSoldier->BeginSoldierClimbFence( );
}
}
}
void HandleRTJumpThroughWindow( void )
{
if (gGameExternalOptions.fCanJumpThroughWindows == TRUE )
{
INT8 bDirection;
SOLDIERTYPE *lSoldier;
if ( GetSoldier( &lSoldier, gusSelectedSoldier ) )
{
if ( FindWindowJumpDirection( lSoldier, lSoldier->sGridNo, lSoldier->ubDirection, &bDirection ) )
{
lSoldier->BeginSoldierClimbWindow( );
}
}
}
}
void HandleRTToggleFireMode( void )
{
// toggle fire mode
if ( ( gpItemPointer == NULL ) && ( gusSelectedSoldier != NOBODY ) &&
( ( gsCurInterfacePanel != SM_PANEL ) || ( ButtonList[ iSMPanelButtons[ BURSTMODE_BUTTON ] ]->uiFlags & BUTTON_ENABLED ) ) )
ChangeWeaponMode( MercPtrs[ gusSelectedSoldier ] );
}
void HandleRTLocateSoldier( void )
{
if ( gusSelectedSoldier != NOBODY )
{
LocateSoldier( gusSelectedSoldier, 10 );
}
}
File diff suppressed because it is too large Load Diff