More highlighting changes (by Shadooow):

- unified the highlight behavior with currently held item in cursor to only ever highlight compatible items for that item (was the case in tactical, not in map screen)
- enabled the body silhouette in map screen to be lit up when hovering/holding consumable item just as it happens in tactical mode
- few small fixes correcting code I sent previously

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8999 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-05-04 09:56:58 +00:00
parent a9a6193a81
commit 239005365f
4 changed files with 106 additions and 59 deletions
+23 -11
View File
@@ -2831,11 +2831,7 @@ BOOLEAN CompatibleItemForApplyingOnMerc(OBJECTTYPE *pTestObject)
{
UINT16 usItem = pTestObject->usItem;
// ATE: If in mapscreen, return false always....
if (guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN)
{
return(FALSE);
}
//Shadooow: rewritten to use new item flags and check canteen not empty
if (((HasItemFlag(usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving) || Item[usItem].camouflagekit || usItem == JAR_ELIXIR ||
Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!Item[usItem].canteen || (*pTestObject)[0]->data.objectStatus > 1))
@@ -2946,7 +2942,14 @@ BOOLEAN HandleCompatibleAmmoUIForMapScreen( SOLDIERTYPE *pSoldier, INT32 bInvPos
if( fFromMerc == FALSE )
{
pTestObject = &( pInventoryPoolList[ bInvPos ].object );
if (gpItemPointer != NULL)
{
pTestObject = gpItemPointer;
}
else
{
pTestObject = &(pInventoryPoolList[bInvPos].object);
}
}
else
{
@@ -3094,7 +3097,14 @@ BOOLEAN HandleCompatibleAmmoUIForMapInventory(SOLDIERTYPE *pSoldier, INT32 bInvP
if( fFromMerc == FALSE )
{
pTestObject = &( pInventoryPoolList[ iStartSlotNumber + bInvPos ].object);
if (gpItemPointer != NULL)
{
pTestObject = gpItemPointer;
}
else
{
pTestObject = &(pInventoryPoolList[iStartSlotNumber + bInvPos].object);
}
}
else
{
@@ -3334,7 +3344,7 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest
}
}
//If we are currently NOT in the Shopkeeper interface and item is not gun or ammo
if (!(guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE) && ((Item[pTestObject->usItem].usItemClass & IC_GUN) || (Item[pTestObject->usItem].usItemClass & IC_AMMO)))
if (!(guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE) && !((Item[pTestObject->usItem].usItemClass & IC_GUN) || (Item[pTestObject->usItem].usItemClass & IC_AMMO)))
{
if (CompatibleItemForApplyingOnMerc(pTestObject))
{
@@ -3439,9 +3449,11 @@ BOOLEAN HandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, INT8 bInvPos, BOOLEAN fOn
}
else
{
// if( fOn )
if ( bInvPos == NO_SLOT )
if (gpItemPointer != NULL)
{
pTestObject = gpItemPointer;
}
else if ( bInvPos == NO_SLOT )
{
pTestObject = NULL;
}