diff --git a/GameSettings.cpp b/GameSettings.cpp index 804169425..1eb2c9d48 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1446,9 +1446,6 @@ void LoadGameExternalOptions() gGameExternalOptions.iQuickItem8 = iniReader.ReadInteger("Tactical Interface Settings", "QUICK_ITEM_8", 0, -100, MAXITEMS); gGameExternalOptions.iQuickItem9 = iniReader.ReadInteger("Tactical Interface Settings", "QUICK_ITEM_9", 0, -100, MAXITEMS); gGameExternalOptions.iQuickItem0 = iniReader.ReadInteger("Tactical Interface Settings", "QUICK_ITEM_0", 0, -100, MAXITEMS); - - // New setting to change stamina - gGameExternalOptions.uStaminaHit = iniReader.ReadInteger("Tactical Interface Settings", "STAMINA_HIT", 10000); // Alternative system for aiming - progressive method depending on marksmanship of Merc gGameExternalOptions.bAltAimEnabled = iniReader.ReadBoolean("Tactical Interface Settings","ALT_AIMING_ENABLED",FALSE); diff --git a/GameSettings.h b/GameSettings.h index bc4dcb7fd..88662621a 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -816,8 +816,6 @@ typedef struct // for small progress bar BOOLEAN fSmallSizeProgressbar; - // stamina multiplier (for all weapons eg knife fist gun - INT32 uStaminaHit; //enable ext mouse key BOOLEAN bAltAimEnabled; BOOLEAN bAimedBurstEnabled; diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 6cd54d7b1..48ece55a2 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -1323,8 +1323,8 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) { DeleteItemDescriptionBox(); } - // HEADROCK HAM 5: Sector Inventory Item Desc Box no longer accessible during combat. + // HEADROCK HAM 5: Sector Inventory Item Desc Box no longer accessible during combat. if( !CanPlayerUseSectorInventory( &(Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ]) ) ) { DoScreenIndependantMessageBox( New113HAMMessage[ 22 ], MSG_BOX_FLAG_OK, NULL ); @@ -1343,9 +1343,18 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) } else if(fValidPointer) { - InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, (SCREEN_WIDTH - INTERFACE_WIDTH)/2, yResOffset - 10, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); - fTeamPanelDirty=TRUE; - fInterfacePanelDirty = DIRTYLEVEL2; + // Sector Inventory Stack Popup no longer accessible during combat. + if( !CanPlayerUseSectorInventory( &(Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ]) ) ) + { + DoScreenIndependantMessageBox( New113HAMMessage[ 22 ], MSG_BOX_FLAG_OK, NULL ); + return; + } + else + { + InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, xResOffset, yResOffset - 10, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); + fTeamPanelDirty=TRUE; + fInterfacePanelDirty = DIRTYLEVEL2; + } } } } @@ -3689,18 +3698,18 @@ BOOLEAN CanPlayerUseSectorInventory( SOLDIERTYPE *pSelectedSoldier ) if(gGameExternalOptions.fEnableInventoryPoolQ) return(TRUE); #endif - INT16 sSectorX, sSectorY, sSectorZ; + INT16 sX, sY, sZ; //Get the sector that has a battle - BOOLEAN fInCombat = GetCurrentBattleSectorXYZAndReturnTRUEIfThereIsABattle( &sSectorX, &sSectorY, &sSectorZ ); + BOOLEAN fInCombat = GetCurrentBattleSectorXYZAndReturnTRUEIfThereIsABattle( &sX, &sY, &sZ ); //if there is a battle going on if( fInCombat ) { - //if the selected map is the one with the combat - if( ( ( sSelMapX == sSectorX ) && - ( sSelMapY == sSectorY ) && - ( iCurrentMapSectorZ == sSectorZ ) + //if the selected soldier is in combat sector + if( ( ( pSelectedSoldier->sSectorX == sX ) && + ( pSelectedSoldier->sSectorY == sY ) && + ( pSelectedSoldier->bSectorZ == sZ ) ) ) { diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 4b5565b39..9cdd6f8f1 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -888,6 +888,7 @@ void InvmaskRegionBtnCallBack( MOUSE_REGION *pRegion, INT32 iReason ); void TrashCanBtnCallback( MOUSE_REGION *pRegion, INT32 iReason); extern void KeyRingItemPanelButtonCallback( MOUSE_REGION *pRegion, INT32 iReason ); +extern BOOLEAN CanPlayerUseSectorInventory( SOLDIERTYPE *pSelectedSoldier ); // handle talking void HandleSpontanousTalking( void ); @@ -9801,7 +9802,7 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason ) if ( !InItemStackPopup( ) ) { // CHRISL: Changed final parameter so that we fill the inventory screen - InitItemStackPopup( pSoldier, (UINT8)uiHandPos, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); + InitItemStackPopup( pSoldier, (UINT8)uiHandPos, xResOffset, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); fTeamPanelDirty=TRUE; fInterfacePanelDirty = DIRTYLEVEL2; } @@ -9890,10 +9891,17 @@ void MAPBeginItemPointer( SOLDIERTYPE *pSoldier, UINT8 ubHandPos ) pSoldier->inv[ubHandPos].MoveThisObjectTo(gItemPointer, numToMove, pSoldier, ubHandPos); - //Autoplace to map sector invectory + //Autoplace to map sector inventory if ( _KeyDown(CTRL) ) { - if( AutoPlaceObjectToWorld(pSoldier, &gItemPointer) ) + // if in battle inform player they will have to do this in tactical + if( !CanPlayerUseSectorInventory( &Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ] ) ) + { + // return item to original slot + PlaceObject( pSoldier, ubHandPos, &gItemPointer ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapInventoryErrorString[ 4 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + } + else if( AutoPlaceObjectToWorld(pSoldier, &gItemPointer) ) { //INVRenderINVPanelItem( pSoldier, uiHandPos, DIRTYLEVEL2); // redraw the empty slot diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index cc45a444b..1dbe71b42 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -9581,7 +9581,7 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX } // Set some globals - gsItemPopupInvX = sInvX + xResOffset; + gsItemPopupInvX = sInvX; gsItemPopupInvY = sInvY; gsItemPopupInvWidth = sInvWidth; gsItemPopupInvHeight = sInvHeight; @@ -9715,7 +9715,7 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX gfInItemStackPopup = TRUE; //Restrict mouse cursor to panel - aRect.iLeft = sInvX + xResOffset; + aRect.iLeft = sInvX + sOffSetX; aRect.iTop = sInvY + sOffSetY; aRect.iRight = aRect.iLeft + min(cnt,sItemWidth) * usPopupWidth; aRect.iBottom = aRect.iTop + (INT32)(ceil((float)cnt/(float)sItemWidth)+1) * usPopupHeight; diff --git a/Tactical/Interface Panels.cpp b/Tactical/Interface Panels.cpp index 96e773be1..fa948d2bd 100644 --- a/Tactical/Interface Panels.cpp +++ b/Tactical/Interface Panels.cpp @@ -4218,7 +4218,7 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason ) inv_interface_start_x = 213; else inv_interface_start_x = 248; - InitItemStackPopup( gpSMCurrentMerc, (UINT8)uiHandPos, inv_interface_start_x, INV_INTERFACE_START_Y, invWidth, ( SCREEN_HEIGHT - INV_INTERFACE_START_Y ) ); + InitItemStackPopup( gpSMCurrentMerc, (UINT8)uiHandPos, inv_interface_start_x + xResOffset, INV_INTERFACE_START_Y, invWidth, ( SCREEN_HEIGHT - INV_INTERFACE_START_Y ) ); } }