diff --git a/Tactical/Real Time Input.cpp b/Tactical/Real Time Input.cpp index 650d71bd4..c47476118 100644 --- a/Tactical/Real Time Input.cpp +++ b/Tactical/Real Time Input.cpp @@ -148,6 +148,8 @@ extern void HandleTBPickUpBackpacks( void ); extern void HandleTBDropBackpacks( void ); extern void HandleTBLocatePrevMerc( void ); extern void HandleTBLocateNextMerc( void ); +extern void HandleTBLevelDown(void); +extern void HandleTBLevelUp(void); extern void HandleTBSwapGoogles( void ); extern void HandleTBSwapSidearm( void ); extern void HandleTBSwapKnife( void ); @@ -1957,7 +1959,7 @@ void HandleAltMouseRTWheel(void) else if (_KeyDown(SHIFT)) // SHIFT HandleTBCycleThroughVisibleEnemiesBackward(); else - ; + HandleTBLevelUp(); } else // wheel down { @@ -1983,7 +1985,7 @@ void HandleAltMouseRTWheel(void) else if (_KeyDown(SHIFT)) // SHIFT HandleTBCycleThroughVisibleEnemies(); else - ; + HandleTBLevelDown(); } } } diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 6ef82ab5d..bc30f4463 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -336,6 +336,8 @@ void HandleTBGotoHigherStance(void); void HandleTBGotoLowerStance(void); void HandleTBLocateNextMerc( void ); void HandleTBLocatePrevMerc( void ); +void HandleTBLevelDown(void); +void HandleTBLevelUp(void); void HandleTBDropBackpacks( void ); void HandleTBPickUpBackpacks( void ); void HandleTBSoldierRun( void ); @@ -5614,7 +5616,7 @@ void HandleRadioCursorClick(INT32 usMapPos, UINT32 *puiNewEvent) INT32 sMoveSpot = usMapPos; BOOLEAN fClimbingNecessary; INT32 sClimbSpot; - INT32 iPathCost = EstimatePathCostToLocation(pTMilitiaSoldier, sMoveSpot, gsInterfaceLevel, FALSE, &fClimbingNecessary, &sClimbSpot); + INT32 iPathCost = EstimatePathCostToLocation(pTMilitiaSoldier, sMoveSpot, (INT8)gsInterfaceLevel, FALSE, &fClimbingNecessary, &sClimbSpot); // See if we can get there if (iPathCost > 0) @@ -7251,7 +7253,7 @@ void HandleAltMouseTBWheel( void ) else if (_KeyDown(SHIFT)) // SHIFT HandleTBCycleThroughVisibleEnemiesBackward(); else - ; + HandleTBLevelUp(); } else // wheel down { @@ -7277,7 +7279,7 @@ void HandleAltMouseTBWheel( void ) else if (_KeyDown(SHIFT)) // SHIFT HandleTBCycleThroughVisibleEnemies(); else - ; + HandleTBLevelDown(); } } } @@ -8196,6 +8198,38 @@ void HandleTBLocatePrevMerc( void ) } } +void HandleTBLevelDown(void) +{ + if (gsInterfaceLevel > 0 && + gpItemPointer == NULL && + (gsCurInterfacePanel != SM_PANEL || ButtonList[iSMPanelButtons[UPDOWN_BUTTON]]->uiFlags & BUTTON_ENABLED)) + { + UIHandleChangeLevel(NULL); + + if (gsCurInterfacePanel == SM_PANEL) + { + // Remember soldier's new value + gpSMCurrentMerc->bUIInterfaceLevel = (INT8)gsInterfaceLevel; + } + } +} + +void HandleTBLevelUp(void) +{ + if (gsInterfaceLevel == 0 && + gpItemPointer == NULL && + (gsCurInterfacePanel != SM_PANEL || ButtonList[iSMPanelButtons[UPDOWN_BUTTON]]->uiFlags & BUTTON_ENABLED)) + { + UIHandleChangeLevel(NULL); + + if (gsCurInterfacePanel == SM_PANEL) + { + // Remember soldier's new value + gpSMCurrentMerc->bUIInterfaceLevel = (INT8)gsInterfaceLevel; + } + } +} + void HandleTBDropBackpacks( void ) { //if( UsingNewInventorySystem() && gusSelectedSoldier != NOBODY )