New feature for UDB

It is now possible to see secondary attributes on the general tab for weapons. Just click on the tab a second time.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6428 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2013-09-21 16:03:47 +00:00
parent 6f2c3bc833
commit f3a36ee7c6
13 changed files with 57 additions and 22 deletions
+16 -8
View File
@@ -1401,7 +1401,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
/////////////////////////////////////////////////////////////////////////////////
// WEAPONS
/////////////////////////////////////////////////////////////////////////////////
if ( Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH )
if ( (Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH) && gubDescGenPage == 0 )
{
if (gubDescBoxPage == 1)
{
@@ -2281,6 +2281,8 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
//////////////////// REPAIR EASE
// not for weapons. They have this one their primary page
if ( !(Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH) )
{
swprintf( pStr, L"%s%s", szUDBGenCommonStatsTooltipText[ 0 ], szUDBGenCommonStatsExplanationsTooltipText[ 0 ]);
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + 0 ]), pStr );
@@ -2295,7 +2297,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
// UDB page. They appear only for non-weapon items (no room in the weapon page).
if (gubDescBoxPage == 1 &&
!(Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH ) )
( !(Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH ) || gubDescGenPage == 1 ) )
{
iFirstDataRegion = iRegionsCreated;
CHAR16 pStr[1000];
@@ -5592,13 +5594,17 @@ void DrawMiscStats( OBJECTTYPE * gpItemDescObject )
if (gubDescBoxPage == 1)
{
////////////////// REPAIR EASE
if ( !Item[gpItemDescObject->usItem].repairable )
// not for weapons. They have this one their primary page
if ( !(Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[0][0].sLeft + sOffsetX, gItemDescGenRegions[0][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
else
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 10, gItemDescGenRegions[0][0].sLeft + sOffsetX, gItemDescGenRegions[0][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
if ( !Item[gpItemDescObject->usItem].repairable )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[0][0].sLeft + sOffsetX, gItemDescGenRegions[0][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
else
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 10, gItemDescGenRegions[0][0].sLeft + sOffsetX, gItemDescGenRegions[0][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
}
DrawSecondaryStats( gpItemDescObject );
@@ -12426,6 +12432,8 @@ void DrawMiscValues( OBJECTTYPE * gpItemDescObject )
SetFontForeground( 6 );
//////////////////// REPAIR EASE
// not for weapons. They have this one their primary page
if ( !(Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH) )
{
// Set line to draw into
ubNumLine = 0;
+28 -5
View File
@@ -6288,7 +6288,7 @@ INT8 DetermineShowBox( )
{
if (UsingEDBSystem() > 0)
{
if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH))
if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH) && gubDescGenPage == 0)
{
switch (gubDescBoxPage)
{
@@ -6332,7 +6332,7 @@ INT8 DetermineShowBox( )
}
else if(UsingNewInventorySystem() == true) //NIV
{
if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH) && UsingEDBSystem() > 0 )
if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH) && UsingEDBSystem() > 0 && gubDescGenPage == 0 )
{
if (guiCurrentItemDescriptionScreen == MAP_SCREEN)
{
@@ -6769,10 +6769,14 @@ void RenderItemDescriptionBox( )
//HEADROCK/CHRISL: This condition needs to run differently depending on whether EDB is active of not
if(UsingEDBSystem() > 0)
{
if ( Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH )
if ( (Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH) && gubDescGenPage == 0)
{
DrawWeaponStats(gpItemDescObject);
}
else if ( (Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH) && gubDescGenPage == 1)
{
DrawMiscStats(gpItemDescObject);
}
else if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_AMMO )
{
DrawAmmoStats(gpItemDescObject);
@@ -7169,8 +7173,19 @@ void RenderItemDescriptionBox( )
{
if(UsingEDBSystem() > 0)
{
SetFontShadow( ITEMDESC_FONTSHADOW3 );
DrawWeaponValues(gpItemDescObject);
if ( gubDescGenPage == 0)
{
SetFontShadow( ITEMDESC_FONTSHADOW3 );
DrawWeaponValues(gpItemDescObject);
}
else
{
//Labels
SetFont( BLOCKFONT2 );
SetFontForeground( 6 );
SetFontShadow( DEFAULT_SHADOW );
DrawMiscValues(gpItemDescObject);
}
}
else
{
@@ -12538,6 +12553,14 @@ void DeletePool(ITEM_POOL *pItemPool)
void ItemDescTabButtonCallback( GUI_BUTTON *btn, INT32 reason )
{
// silversurfer: We clicked on the general tab a second time. Make it toggle between first and second page.
// This is only used for weapons at the moment because there was no space for the secondary attributes.
if ( gubDescBoxPage == 1 && btn->UserData[0] == 1 && gfLeftButtonState )
if ( gubDescGenPage == 0 )
gubDescGenPage = 1;
else
gubDescGenPage = 0;
gubDescBoxPage = btn->UserData[0];
HandleItemDescTabButton( );
}
+2
View File
@@ -438,6 +438,8 @@ BOOLEAN gfDeductPoints;
// By saving this in memory, we tell the DescBox which background and values to draw, and make sure that we end up
// on the same page every time we open the description box. UDB buttons allow switching between pages.
UINT8 gubDescBoxPage;
// silversurfer: Now we also have a secondary page on the general tab for weapons so we can look at their secondary attributes.
UINT8 gubDescGenPage;
// Record which line we're looking at. This only applied to the Advanced tab in description boxes.
UINT8 gubDescBoxLine;
// Record how many lines this item has to display. This only applies to the Advanced tab.
+2
View File
@@ -161,6 +161,8 @@ BOOLEAN ChangeDropPackStatus(SOLDIERTYPE *pSoldier, BOOLEAN newStatus);
// By saving this in memory, we tell the DescBox which background and values to draw, and make sure that we end up
// on the same page every time we open the description box. UDB buttons allow switching between pages.
extern UINT8 gubDescBoxPage;
// silversurfer: Now we also have a secondary page on the general tab for weapons so we can look at their secondary attributes.
extern UINT8 gubDescGenPage;
// Record which line we're looking at. This only applied to the Advanced tab in description boxes.
extern UINT8 gubDescBoxLine;
// Record how many lines there are for the current item in the Advanced tab.