diff --git a/GameVersion.cpp b/GameVersion.cpp index a65e8b48..77f0a2c7 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -13,12 +13,12 @@ #ifdef JA2EDITOR //MAP EDITOR BUILD VERSION -CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.20469" }; +CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.2058" }; #elif defined JA2BETAVERSION //BETA/TEST BUILD VERSION -CHAR16 zVersionLabel[256] = { L"Debug v1.13.2046" }; +CHAR16 zVersionLabel[256] = { L"Debug v1.13.2058" }; #elif defined CRIPPLED_VERSION @@ -28,11 +28,11 @@ CHAR16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - CHAR16 zVersionLabel[256] = { L"Release v1.13.2046" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.2058" }; #endif -CHAR8 czVersionNumber[16] = { "Build 08.04.18" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 08.04.20" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 2bf8f1e7..edcad4af 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -826,16 +826,16 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) { //CHRISL: Make it possible to right click and pull up stack popup and/or item description boxes WORLDITEM * twItem = &(pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ]); - if ( !InSectorStackPopup( ) && !InItemStackPopup( ) && !InItemDescriptionBox( ) && !InKeyRingPopup( ) && twItem->object.exists() == true) + if ( !InSectorStackPopup( ) && !InItemStackPopup( ) && !InItemDescriptionBox( ) && !InKeyRingPopup( ) && twItem->object.exists() == true && (bSelectedInfoChar != -1 && gCharactersList[bSelectedInfoChar].fValid)) { if(ItemSlotLimit( &twItem->object, STACK_SIZE_LIMIT ) == 1) { fShowInventoryFlag = TRUE; - MAPInternalInitItemDescriptionBox( &twItem->object, 0, 0 ); + MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ); } else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE || ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE) { - InitSectorStackPopup( twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); + InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); fTeamPanelDirty=TRUE; fInterfacePanelDirty = DIRTYLEVEL2; } diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index a0e1f80a..2a1059e4 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -6163,7 +6163,7 @@ BOOLEAN InKeyRingPopup( ) return( gfInKeyRingPopup ); } -BOOLEAN InitSectorStackPopup( WORLDITEM *pInventoryPoolList, INT32 ubPosition, INT16 sInvX, INT16 sInvY, INT16 sInvWidth, INT16 sInvHeight ) +BOOLEAN InitSectorStackPopup( SOLDIERTYPE *pSoldier, WORLDITEM *pInventoryPoolList, INT32 ubPosition, INT16 sInvX, INT16 sInvY, INT16 sInvWidth, INT16 sInvHeight ) { VOBJECT_DESC VObjectDesc; SGPRect aRect; @@ -6184,6 +6184,8 @@ BOOLEAN InitSectorStackPopup( WORLDITEM *pInventoryPoolList, INT32 ubPosition, I gsItemPopupInvY = sInvY; gsItemPopupInvWidth = sInvWidth; gsItemPopupInvHeight = sInvHeight; + // Set soldier + gpItemPopupSoldier = pSoldier; // Determine # of items gpItemPopupObject = &(pInventoryPoolList->object ); gubNumItemPopups = ItemSlotLimit( gpItemPopupObject, STACK_SIZE_LIMIT ); @@ -6225,10 +6227,10 @@ BOOLEAN InitSectorStackPopup( WORLDITEM *pInventoryPoolList, INT32 ubPosition, I MSYS_SetRegionUserData( &gItemPopupRegions[cnt], 0, cnt ); //CHRISL: Include the pockets capacity as UserData 1 MSYS_SetRegionUserData( &gItemPopupRegions[cnt], 1, gubNumItemPopups ); + //CHRISL: Let's also include the ubID for this merc as UserData so we can find the merc again if needed + MSYS_SetRegionUserData( &gItemPopupRegions[cnt], 2, pSoldier->ubID); // Flag this as a sectory item - MSYS_SetRegionUserData( &gItemPopupRegions[cnt], 2, -1); - //CHRISL: Include the pocket we're looking at so we can display the right graphic - MSYS_SetRegionUserData( &gItemPopupRegions[cnt], 3, ubPosition); + MSYS_SetRegionUserData( &gItemPopupRegions[cnt], 3, -1); //OK, for each item, set dirty text if applicable! //CHRISL: @@ -6458,7 +6460,8 @@ void RenderItemStackPopup( BOOLEAN fFullRender ) UINT32 cnt; INT16 sX, sY, sNewX, sNewY; INT16 sItemWidth = 0, sOffSetY = 0, sWidth = 29; - UINT8 ubPosition, image = 0; + INT8 ubPosition; + UINT8 image = 0; int sID; // CHRISL: Setup witdh and offset to layer inventory boxes if necessary @@ -6498,9 +6501,9 @@ void RenderItemStackPopup( BOOLEAN fFullRender ) usWidth = (UINT32)pTrav->usWidth; //CHRISL: resize usPopupWidth based on popup stack location - if(UsingNewInventorySystem() == true || sID == -1) + if(UsingNewInventorySystem() == true || ubPosition == -1) { - if(sID == -1 || (ubPosition >=BIGPOCKSTART && ubPosition < BIGPOCKFINAL) || (gGameExternalOptions.fVehicleInventory && (MercPtrs[sID]->flags.uiStatusFlags & SOLDIER_VEHICLE))) + if(ubPosition == -1 || (ubPosition >=BIGPOCKSTART && ubPosition < BIGPOCKFINAL) || (gGameExternalOptions.fVehicleInventory && (MercPtrs[sID]->flags.uiStatusFlags & SOLDIER_VEHICLE))) { if(guiCurrentScreen != MAP_SCREEN) sItemWidth -= 2; @@ -7074,7 +7077,7 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason ) //If one in our hand, place it if ( gpItemPointer != NULL ) { - if ( !PlaceObjectAtObjectIndex( gpItemPointer, gpItemPopupObject, (UINT8)uiItemPos, iItemCap ) ) + if ( !PlaceObjectAtObjectIndex( gpItemPointer, gpItemPopupObject, (UINT8)uiItemPos, iItemCap ) || gpItemPointer->ubNumberOfObjects == 0 ) { if ( (guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) ) { @@ -7096,6 +7099,23 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason ) // re-evaluate repairs gfReEvaluateEveryonesNothingToDo = TRUE; } + else + { + guiExternVo = GetInterfaceGraphicForItem( &(Item[ gpItemPointer->usItem ]) ); + gusExternVoSubIndex = Item[ gpItemPointer->usItem ].ubGraphicNum; + + MSYS_ChangeRegionCursor( &gMPanelRegion , EXTERN_CURSOR ); + MSYS_SetCurrentCursor( EXTERN_CURSOR ); + fMapInventoryItem=TRUE; + fTeamPanelDirty=TRUE; + + // remember which gridno the object came from + sObjectSourceGridNo = MercPtrs[ubID]->sGridNo; + // and who owned it last + gpItemPointerSoldier = MercPtrs[ubID]; + + ReevaluateItemHatches( MercPtrs[ubID], FALSE ); + } //Dirty interface //fInterfacePanelDirty = DIRTYLEVEL2; @@ -7111,18 +7131,8 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason ) if ( (guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) ) { // pick it up - if(ubID != -1) - { - gpItemPopupObject->RemoveObjectAtIndex( uiItemPos, &gItemPointer ); - InternalMAPBeginItemPointer( gpItemPopupSoldier ); - } - else - { - OBJECTTYPE tSectorItem; - gpItemPopupObject->RemoveObjectAtIndex( uiItemPos, &tSectorItem ); - BeginInventoryPoolPtr(&tSectorItem); - guiCurrentItemDescriptionScreen = MAP_SCREEN; - } + gpItemPopupObject->RemoveObjectAtIndex( uiItemPos, &gItemPointer ); + InternalMAPBeginItemPointer( gpItemPopupSoldier ); } else { diff --git a/Tactical/Interface Items.h b/Tactical/Interface Items.h index 0c5abd38..99385e54 100644 --- a/Tactical/Interface Items.h +++ b/Tactical/Interface Items.h @@ -141,7 +141,7 @@ void DeleteItemDescriptionBox( ); BOOLEAN InItemStackPopup( ); BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX, INT16 sInvY, INT16 sInvWidth, INT16 sInvHeight ); BOOLEAN InSectorStackPopup( ); -BOOLEAN InitSectorStackPopup( WORLDITEM *pInventoryPoolList, INT32 ubPosition, INT16 sInvX, INT16 sInvY, INT16 sInvWidth, INT16 sInvHeight ); +BOOLEAN InitSectorStackPopup( SOLDIERTYPE *pSoldier, WORLDITEM *pInventoryPoolList, INT32 ubPosition, INT16 sInvX, INT16 sInvY, INT16 sInvWidth, INT16 sInvHeight ); void RenderItemStackPopup( BOOLEAN fFullRender ); void HandleItemStackPopup( ); void DeleteItemStackPopup( ); diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index da38c04a..3c1dc207 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -2850,11 +2850,6 @@ BOOLEAN ReloadGun( SOLDIERTYPE * pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo bAPs = 0; - //CHRISL: If we enter here from the sector inventory panel, we won't have soldier info. So setup a blank soldier to - // avoid a crash later in the code. - if(pSoldier == NULL) - pSoldier = new SOLDIERTYPE; - if ( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) ) { //CHRISL: Alter this so we treat clip fed weapons differently from weapons that load with loose rounds diff --git a/ja2_2005Express.vcproj b/ja2_2005Express.vcproj index 89bf4e06..35264e6c 100644 --- a/ja2_2005Express.vcproj +++ b/ja2_2005Express.vcproj @@ -66,7 +66,7 @@