mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
When trading, mark items that the trader won't buy.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8367 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -344,6 +344,8 @@ BOOLEAN TransformationMenuPopup_Arm_TestValid(OBJECTTYPE * pObj);
|
|||||||
void BombInventoryMessageBoxCallBack( UINT8 ubExitValue );
|
void BombInventoryMessageBoxCallBack( UINT8 ubExitValue );
|
||||||
void BombInventoryDisArmMessageBoxCallBack( UINT8 ubExitValue );
|
void BombInventoryDisArmMessageBoxCallBack( UINT8 ubExitValue );
|
||||||
|
|
||||||
|
extern BOOLEAN DoesCurrentDealerRefuseToTradeItem( UINT16 usItem );
|
||||||
|
|
||||||
// sevenfm:
|
// sevenfm:
|
||||||
// delayed grenade explosion
|
// delayed grenade explosion
|
||||||
BOOLEAN TransformationMenuPopup_DelayedGrenadeExplosion_TestValid(OBJECTTYPE* pObj);
|
BOOLEAN TransformationMenuPopup_DelayedGrenadeExplosion_TestValid(OBJECTTYPE* pObj);
|
||||||
@@ -2767,6 +2769,14 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
|
|||||||
UINT32 uiWhichBuffer = ( guiCurrentItemDescriptionScreen == MAP_SCREEN ) ? guiSAVEBUFFER : guiRENDERBUFFER;
|
UINT32 uiWhichBuffer = ( guiCurrentItemDescriptionScreen == MAP_SCREEN ) ? guiSAVEBUFFER : guiRENDERBUFFER;
|
||||||
DrawHatchOnInventory( uiWhichBuffer, sX, sY, (UINT16)(gSMInvData[ sPocket ].sWidth-1), (UINT16)(gSMInvData[ sPocket ].sHeight-1) );
|
DrawHatchOnInventory( uiWhichBuffer, sX, sY, (UINT16)(gSMInvData[ sPocket ].sWidth-1), (UINT16)(gSMInvData[ sPocket ].sHeight-1) );
|
||||||
}
|
}
|
||||||
|
// Flugente: if we are currently trading, hatch all items that the trade won't accept anyway in red. That way the player doesn't have to manually find out
|
||||||
|
else if ( (guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE) && pObject->exists( ) && DoesCurrentDealerRefuseToTradeItem( pObject->usItem ) )
|
||||||
|
{
|
||||||
|
UINT16 usColor = Get16BPPColor( FROMRGB( 150, 0, 50 ) );
|
||||||
|
|
||||||
|
UINT32 uiWhichBuffer = (guiCurrentItemDescriptionScreen == MAP_SCREEN) ? guiSAVEBUFFER : guiRENDERBUFFER;
|
||||||
|
DrawHatchOnInventory_MilitiaAccess( uiWhichBuffer, sX, sY, (UINT16)(gSMInvData[sPocket].sWidth - 1), (UINT16)(gSMInvData[sPocket].sHeight - 1), usColor );
|
||||||
|
}
|
||||||
|
|
||||||
// if there's an item in there
|
// if there's an item in there
|
||||||
if ( pObject->exists() )
|
if ( pObject->exists() )
|
||||||
|
|||||||
@@ -6712,18 +6712,16 @@ void ConfirmToDeductMoneyFromPlayersAccountMessageBoxCallBack( UINT8 bExitValue
|
|||||||
gubSkiDirtyLevel = SKI_DIRTY_LEVEL2;
|
gubSkiDirtyLevel = SKI_DIRTY_LEVEL2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// run through what the player has on the table and see if the shop keep will aceept it or not
|
// run through what the player has on the table and see if the shop keep will aceept it or not
|
||||||
BOOLEAN WillShopKeeperRejectObjectsFromPlayer( INT8 bDealerId, INT8 bSlotId )
|
BOOLEAN WillShopKeeperRejectItemFromPlayer( INT8 bDealerId, UINT16 usItem )
|
||||||
{
|
{
|
||||||
BOOLEAN fRejected = TRUE;
|
BOOLEAN fRejected = TRUE;
|
||||||
|
|
||||||
if( Item[ PlayersOfferArea[ bSlotId ].sItemIndex ].usItemClass == IC_MONEY )
|
if ( Item[usItem].usItemClass == IC_MONEY )
|
||||||
{
|
{
|
||||||
fRejected = FALSE;
|
fRejected = FALSE;
|
||||||
}
|
}
|
||||||
else if( CanDealerTransactItem( gbSelectedArmsDealerID, PlayersOfferArea[ bSlotId ].sItemIndex, TRUE ) )
|
else if ( CanDealerTransactItem( gbSelectedArmsDealerID, usItem, TRUE ) )
|
||||||
{
|
{
|
||||||
fRejected = FALSE;
|
fRejected = FALSE;
|
||||||
}
|
}
|
||||||
@@ -6733,9 +6731,29 @@ BOOLEAN WillShopKeeperRejectObjectsFromPlayer( INT8 bDealerId, INT8 bSlotId )
|
|||||||
fRejected = TRUE;
|
fRejected = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return( fRejected );
|
return fRejected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOLEAN DoesCurrentDealerRefuseToTradeItem( UINT16 usItem )
|
||||||
|
{
|
||||||
|
//if non-repairman
|
||||||
|
if ( armsDealerInfo[gbSelectedArmsDealerID].ubTypeOfArmsDealer != ARMS_DEALER_REPAIRS )
|
||||||
|
{
|
||||||
|
// don't evaluate anything he wouldn't buy!
|
||||||
|
if ( WillShopKeeperRejectItemFromPlayer( gbSelectedArmsDealerID, usItem ) )
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// run through what the player has on the table and see if the shop keep will aceept it or not
|
||||||
|
BOOLEAN WillShopKeeperRejectObjectsFromPlayer( INT8 bDealerId, INT8 bSlotId )
|
||||||
|
{
|
||||||
|
return WillShopKeeperRejectItemFromPlayer( bDealerId, PlayersOfferArea[bSlotId].sItemIndex );
|
||||||
|
}
|
||||||
|
|
||||||
void CheckAndHandleClearingOfPlayerOfferArea( void )
|
void CheckAndHandleClearingOfPlayerOfferArea( void )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user