From 6f5e2471e04f6a5e310a36550cea1e26b3ced4b1 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 14 Aug 2021 15:56:14 +0000 Subject: [PATCH] Fix: display for other properties in EDB advanced page uses wrong line git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9151 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Enhanced.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index acac39f67..4bb1d32f7 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -5733,15 +5733,7 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) // Flugente // new line is necessary (Moa: only if needed) - INT16 fDrawGenIndexes = FALSE; - if ( gGameExternalOptions.fWeaponOverheating ) - { - if( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[gpItemDescObject->usItem].barrel == TRUE || ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) || - ( fComparisonMode && ( Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[gpComparedItemDescObject->usItem].barrel == TRUE || ( Item[gpComparedItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) ) ) - { - if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // new index line here? - } - } + INT16 fDrawGenIndexes = 0; // Flugente if ( gGameExternalOptions.fWeaponOverheating ) @@ -5749,6 +5741,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) if( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) || ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) ) { + if ( !fDrawGenIndexes ) fDrawGenIndexes = ++cnt; // new index line here? + ///////////////////// SINGLE SHOT TEMPERATURE if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5777,9 +5771,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } cnt++; } + if( ( Item[gpItemDescObject->usItem].barrel == TRUE ) || // for barrel items ( fComparisonMode && Item[gpComparedItemDescObject->usItem].barrel == TRUE ) ) { + if ( !fDrawGenIndexes ) fDrawGenIndexes = ++cnt; // new index line here? + ///////////////////// COOLDOWN FACTOR if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5792,6 +5789,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) if ( ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) || ( fComparisonMode && ( ( Item[gpComparedItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) ) ) { + if ( !fDrawGenIndexes ) fDrawGenIndexes = ++cnt; // new index line here? + ///////////////////// TEMPERATURE MODIFICATOR if ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( fComparisonMode && Item[gpComparedItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) ) @@ -5843,6 +5842,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) || ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) ) { + if ( !fDrawGenIndexes ) fDrawGenIndexes = ++cnt; // new index line here? + if (cnt >= sFirstLine && cnt < sLastLine) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 55, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -5855,6 +5856,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) if ( gGameOptions.fNewTraitSystem && gSkillTraitValues.fCanFanTheHammer && ( ( Item[gpItemDescObject->usItem].usItemClass & IC_BOBBY_GUN ) || ( fComparisonMode && ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_BOBBY_GUN ) ) ) ) { + if ( !fDrawGenIndexes ) fDrawGenIndexes = ++cnt; // new index line here? + if ( cnt >= sFirstLine && cnt < sLastLine ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 65, gItemDescAdvRegions[cnt - sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt - sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -5865,6 +5868,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) ///////////////////// MULTIPLE BARRELS if ( ( ( Item[gpItemDescObject->usItem].usItemClass & IC_BOBBY_GUN ) || ( fComparisonMode && ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_BOBBY_GUN ) ) ) ) { + if ( !fDrawGenIndexes ) fDrawGenIndexes = ++cnt; // new index line here? + if ( cnt >= sFirstLine && cnt < sLastLine ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 66, gItemDescAdvRegions[cnt - sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt - sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -13461,7 +13466,7 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) // Flugente: draw a new description line // Moa: only if required - INT16 fDrawGenIndexes = FALSE; + INT16 fDrawGenIndexes = 0; // Flugente if ( gGameExternalOptions.fWeaponOverheating )