mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
New feature: guns can now be fed externally
- a machinegun can be fed by another emc if he has an ammo blet in his hands - a merc can also feed his gun with ammo belts in his inventory - the necessary tags can be set in Items.xml in the <ItemFlag> -tag - this feature can be turned on and off via the JA2_Options.iniReader - for more info, see http://www.bears-pit.com/board/ubbthreads.php/topics/307574/New_feature_Externally_fed_mac.html#Post307574 - this feature requires the newest GameDir files, as a new face icon was added git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5415 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4128,6 +4128,38 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
|
||||
mprintf( sNewX, sNewY, pStr );
|
||||
gprintfinvalidate( sNewX, sNewY, pStr );
|
||||
}
|
||||
|
||||
// Flugente: if ammo is used to feed a gun externally, show ammo count left on this ammo
|
||||
if ( gGameExternalOptions.ubExternalFeeding > 0 && (Item[pObject->usItem].usItemClass & (IC_AMMO)) && ObjectIsExternalFeeder(pSoldier, pObject) )
|
||||
{
|
||||
sNewY = sY + sHeight - 10;
|
||||
|
||||
UINT16 usAmmoItem = pObject->usItem;
|
||||
UINT16 usMagIndex = Item[usAmmoItem].ubClassIndex;
|
||||
UINT16 usAmmoMagSize = Magazine[usMagIndex].ubMagSize;
|
||||
UINT8 usAmmoAmmoType = Magazine[usMagIndex].ubAmmoType;
|
||||
|
||||
SetFontForeground ( AmmoTypes[usAmmoAmmoType].fontColour );
|
||||
|
||||
swprintf( pStr, L"%d", (*pObject)[iter]->data.ubShotsLeft );
|
||||
|
||||
// Get length of string
|
||||
uiStringLength=StringPixLength(pStr, ITEM_FONT );
|
||||
|
||||
sNewX = sX + 1;
|
||||
//sNewX = sX + sWidth - uiStringLength - 4;
|
||||
|
||||
if ( uiBuffer == guiSAVEBUFFER )
|
||||
{
|
||||
RestoreExternBackgroundRect( sNewX, sNewY, 20, 15 );
|
||||
}
|
||||
mprintf( sNewX, sNewY, pStr );
|
||||
gprintfinvalidate( sNewX, sNewY, pStr );
|
||||
|
||||
//sNewX = sX + 1;
|
||||
|
||||
//SetFontForeground( FONT_MCOLOR_DKGRAY );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user