mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
@@ -1279,16 +1279,21 @@ void MapInvenPoolSlotsMove( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if( iReason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
|
||||
{
|
||||
iCurrentlyHighLightedItem = iCounter;
|
||||
fChangedInventorySlots = TRUE;
|
||||
gfCheckForCursorOverMapSectorInventoryItem = TRUE;
|
||||
if (gpItemPointer == NULL)
|
||||
{
|
||||
iCurrentlyHighLightedItem = iCounter;
|
||||
fChangedInventorySlots = TRUE;
|
||||
gfCheckForCursorOverMapSectorInventoryItem = TRUE;
|
||||
}
|
||||
}
|
||||
else if( iReason & MSYS_CALLBACK_REASON_LOST_MOUSE )
|
||||
{
|
||||
iCurrentlyHighLightedItem = -1;
|
||||
fChangedInventorySlots = TRUE;
|
||||
gfCheckForCursorOverMapSectorInventoryItem = FALSE;
|
||||
|
||||
if (gpItemPointer == NULL)
|
||||
{
|
||||
iCurrentlyHighLightedItem = NO_SLOT;
|
||||
fChangedInventorySlots = TRUE;
|
||||
gfCheckForCursorOverMapSectorInventoryItem = FALSE;
|
||||
}
|
||||
// re render radar map
|
||||
RenderRadarScreen( );
|
||||
}
|
||||
@@ -2749,6 +2754,12 @@ void MapInventoryPoolNextBtn( GUI_BUTTON *btn, INT32 reason )
|
||||
if( iCurrentInventoryPoolPage < ( iLastInventoryPoolPage ) )
|
||||
{
|
||||
iCurrentInventoryPoolPage++;
|
||||
//shadooow: this will re-render item compatibility highlighting when changing pages for currently held item
|
||||
if (gpItemPointer != NULL)
|
||||
{
|
||||
fChangedInventorySlots = TRUE;
|
||||
gfCheckForCursorOverMapSectorInventoryItem = TRUE;
|
||||
}
|
||||
fMapPanelDirty = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2771,6 +2782,12 @@ void MapInventoryPoolPrevBtn( GUI_BUTTON *btn, INT32 reason )
|
||||
if( iCurrentInventoryPoolPage > 0 )
|
||||
{
|
||||
iCurrentInventoryPoolPage--;
|
||||
//shadooow: this will re-render item compatibility highlighting when changing pages for currently held item
|
||||
if (gpItemPointer != NULL)
|
||||
{
|
||||
fChangedInventorySlots = TRUE;
|
||||
gfCheckForCursorOverMapSectorInventoryItem = TRUE;
|
||||
}
|
||||
fMapPanelDirty = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2924,7 +2941,12 @@ void MapInventoryPoolFilterBtn( GUI_BUTTON *btn, INT32 reason )
|
||||
{
|
||||
MapInventoryFilterToggle( btn->UserData[1] );
|
||||
}
|
||||
|
||||
//shadooow: this will re-render item compatibility highlighting when changing filters for currently held item
|
||||
if (gpItemPointer != NULL)
|
||||
{
|
||||
fChangedInventorySlots = TRUE;
|
||||
gfCheckForCursorOverMapSectorInventoryItem = TRUE;
|
||||
}
|
||||
// HEADROCK HAM 5: Disabled for now, as we've got buttons for this.
|
||||
//CreateMapInventoryFilterMenu( );
|
||||
}
|
||||
@@ -2941,7 +2963,12 @@ void MapInventoryPoolFilterBtn( GUI_BUTTON *btn, INT32 reason )
|
||||
{
|
||||
MapInventoryFilterToggle( btn->UserData[3] );
|
||||
}
|
||||
|
||||
//shadooow: this will re-render item compatibility highlighting when changing filters for currently held item
|
||||
if (gpItemPointer != NULL)
|
||||
{
|
||||
fChangedInventorySlots = TRUE;
|
||||
gfCheckForCursorOverMapSectorInventoryItem = TRUE;
|
||||
}
|
||||
// HEADROCK HAM 5: Disabled for now, as we've got buttons for this.
|
||||
//CreateMapInventoryFilterMenu( );
|
||||
}
|
||||
@@ -3630,9 +3657,9 @@ void HandleMouseInCompatableItemForMapSectorInventory( INT32 iCurrentSlot )
|
||||
}
|
||||
|
||||
//Nothing selected or out of bounds or empty slot selected; highlightings reseted already, return
|
||||
if ( iCurrentSlot == NO_SLOT ||
|
||||
if ( gpItemPointer == NULL && (iCurrentSlot == NO_SLOT ||
|
||||
(pInventoryPoolList.size() < (UINT32)(iCurrentSlot + ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) )) ||
|
||||
pInventoryPoolList[ iCurrentSlot + iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ].fExists == FALSE )
|
||||
pInventoryPoolList[ iCurrentSlot + iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ].fExists == FALSE ))
|
||||
{
|
||||
fChangedInventorySlots = FALSE;
|
||||
if (fItemWasHighLighted)
|
||||
|
||||
+25
-15
@@ -9567,9 +9567,7 @@ void MAPInvMoveCallback( MOUSE_REGION *pRegion, INT32 iReason )
|
||||
|
||||
uiHandPos = MSYS_GetRegionUserData( pRegion, 0 );
|
||||
|
||||
//gbCheckForMouseOverItemPos = -1;
|
||||
|
||||
if ( pSoldier->inv[ uiHandPos ].exists() == false )
|
||||
if (pSoldier->inv[uiHandPos].exists() == false)
|
||||
return;
|
||||
|
||||
if (iReason == MSYS_CALLBACK_REASON_MOVE)
|
||||
@@ -9577,19 +9575,25 @@ void MAPInvMoveCallback( MOUSE_REGION *pRegion, INT32 iReason )
|
||||
}
|
||||
else if (iReason == MSYS_CALLBACK_REASON_GAIN_MOUSE )
|
||||
{
|
||||
gubMAP_HandInvDispText[uiHandPos] = 2;
|
||||
guiMouseOverItemTime = GetJA2Clock();
|
||||
gfCheckForMouseOverItem = TRUE;
|
||||
gbCheckForMouseOverItemPos = (INT8)uiHandPos;
|
||||
fTeamPanelDirty = TRUE;
|
||||
if (gpItemPointer == NULL)
|
||||
{
|
||||
gubMAP_HandInvDispText[uiHandPos] = 2;
|
||||
guiMouseOverItemTime = GetJA2Clock();
|
||||
gfCheckForMouseOverItem = TRUE;
|
||||
gbCheckForMouseOverItemPos = (INT8)uiHandPos;
|
||||
fTeamPanelDirty = TRUE;
|
||||
}
|
||||
}
|
||||
if (iReason == MSYS_CALLBACK_REASON_LOST_MOUSE )
|
||||
{
|
||||
gubMAP_HandInvDispText[uiHandPos] = 1;
|
||||
HandleCompatibleAmmoUI(pSoldier, (INT8)uiHandPos, FALSE);
|
||||
gfCheckForMouseOverItem = FALSE;
|
||||
gbCheckForMouseOverItemPos = NO_SLOT;
|
||||
fTeamPanelDirty = TRUE;
|
||||
if (gpItemPointer == NULL)
|
||||
{
|
||||
gubMAP_HandInvDispText[uiHandPos] = 1;
|
||||
HandleCompatibleAmmoUI(pSoldier, (INT8)uiHandPos, FALSE);
|
||||
gfCheckForMouseOverItem = FALSE;
|
||||
gbCheckForMouseOverItemPos = NO_SLOT;
|
||||
fTeamPanelDirty = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9864,7 +9868,9 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason )
|
||||
MSYS_SetCurrentCursor( EXTERN_CURSOR );
|
||||
fMapInventoryItem=TRUE;
|
||||
fTeamPanelDirty=TRUE;
|
||||
|
||||
//shadooow: this resets the current highlight item selection for swapped item
|
||||
HandleCompatibleAmmoUI(pSoldier, NO_SLOT, FALSE);
|
||||
gfCheckForMouseOverItem = TRUE;
|
||||
// remember which gridno the object came from
|
||||
sObjectSourceGridNo = pSoldier->sGridNo;
|
||||
// and who owned it last
|
||||
@@ -15029,7 +15035,11 @@ void ChangeSelectedInfoChar( INT8 bCharNumber, BOOLEAN fResetSelectedList )
|
||||
fShowInventoryFlag = FALSE;
|
||||
}
|
||||
//shadooow: this resets the current highlight item selection to be redrawn again
|
||||
HandleCompatibleAmmoUI(MercPtrs[gCharactersList[bCharNumber].usSolID], NULL, FALSE);
|
||||
HandleCompatibleAmmoUI(MercPtrs[gCharactersList[bCharNumber].usSolID], NO_SLOT, FALSE);
|
||||
if (gpItemPointer != NULL)
|
||||
{
|
||||
gfCheckForMouseOverItem = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
fCharacterInfoPanelDirty = TRUE;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -706,16 +706,10 @@ void SetSMPanelCurrentMerc( UINT8 ubNewID )
|
||||
SetAllAutoFacesInactive( );
|
||||
|
||||
// Turn off compat ammo....
|
||||
if ( gpItemPointer == NULL )
|
||||
HandleCompatibleAmmoUI(gpSMCurrentMerc, NO_SLOT, FALSE);
|
||||
if (gpItemPointer != NULL)
|
||||
{
|
||||
HandleCompatibleAmmoUI( gpSMCurrentMerc, (INT8)HANDPOS, FALSE );
|
||||
gfCheckForMouseOverItem = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Turn it all false first....
|
||||
InternalHandleCompatibleAmmoUI( gpSMCurrentMerc, gpItemPointer, FALSE );
|
||||
InternalHandleCompatibleAmmoUI( gpSMCurrentMerc, gpItemPointer, TRUE );
|
||||
gfCheckForMouseOverItem = TRUE;
|
||||
}
|
||||
|
||||
// Remove item desc panel if one up....
|
||||
@@ -3224,14 +3218,12 @@ void UpdateStatColor( UINT32 uiTimer, BOOLEAN fIncrease, BOOLEAN fDamaged, BOOLE
|
||||
|
||||
void SMInvMoveCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
UINT32 uiHandPos;
|
||||
|
||||
uiHandPos = MSYS_GetRegionUserData( pRegion, 0 );
|
||||
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UINT32 uiHandPos = MSYS_GetRegionUserData( pRegion, 0 );
|
||||
|
||||
if ( gpSMCurrentMerc->inv[ uiHandPos ].exists() == false )
|
||||
return;
|
||||
@@ -3256,7 +3248,8 @@ void SMInvMoveCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
HandleCompatibleAmmoUI( gpSMCurrentMerc, (INT8)uiHandPos, FALSE );
|
||||
gfCheckForMouseOverItem = FALSE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
gbCheckForMouseOverItemPos = NO_SLOT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3279,23 +3272,28 @@ void InvPanelButtonClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
|
||||
void SMInvMoveCammoCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (iReason == MSYS_CALLBACK_REASON_GAIN_MOUSE )
|
||||
{
|
||||
// Setup a timer....
|
||||
guiMouseOverItemTime = GetJA2Clock( );
|
||||
gfCheckForMouseOverItem = TRUE;
|
||||
gbCheckForMouseOverItemPos = NO_SLOT;
|
||||
if (gpItemPointer == NULL)
|
||||
{
|
||||
// Setup a timer....
|
||||
guiMouseOverItemTime = GetJA2Clock();
|
||||
gfCheckForMouseOverItem = TRUE;
|
||||
gbCheckForMouseOverItemPos = NO_SLOT;
|
||||
}
|
||||
}
|
||||
if (iReason == MSYS_CALLBACK_REASON_LOST_MOUSE )
|
||||
{
|
||||
//gfSM_HandInvDispText[ uiHandPos ] = 1;
|
||||
HandleCompatibleAmmoUI( gpSMCurrentMerc, (INT8)NO_SLOT, FALSE );
|
||||
gfCheckForMouseOverItem = FALSE;
|
||||
if (gpItemPointer == NULL)
|
||||
{
|
||||
//gfSM_HandInvDispText[ uiHandPos ] = 1;
|
||||
HandleCompatibleAmmoUI(gpSMCurrentMerc, (INT8)NO_SLOT, FALSE);
|
||||
gfCheckForMouseOverItem = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user