-
Notifications
You must be signed in to change notification settings - Fork 33
[Fix] Incorrect displaying info and tooltips in Advances Properties Tab #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1621,8 +1621,8 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr | |
|
|
||
| /////////////////// PROJECTION FACTOR / NCTH BEST LASER RANGE | ||
| // with the reworked NCTH code and the laser performance factor we will display BestLaserRange instead of ProjectionFactor but we still need the mouse region | ||
| if (UsingNewCTHSystem() && ( GetProjectionFactor( gpItemDescObject ) > 1.0 || GetBestLaserRange( gpItemDescObject ) > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) | ||
| if (UsingNewCTHSystem() && ( GetProjectionFactor( gpItemDescObject ) > 1.0 || (GetBestLaserRange(gpItemDescObject) / CELL_X_SIZE > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0)) ) ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this also be checking if it's higher than zero? gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE > 0
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe. But this was out of the scope of issue I resolved. |
||
| { | ||
| ubRegionOffset = 6; | ||
| MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + ubRegionOffset ] ); | ||
|
|
@@ -1637,7 +1637,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr | |
| } | ||
|
|
||
| /////////////////// OCTH BEST LASER RANGE | ||
| if (!UsingNewCTHSystem() && (Item[gpItemDescObject->usItem].bestlaserrange > 0 || GetAverageBestLaserRange( gpItemDescObject ) > 0 ) ) | ||
| if ( UsingNewCTHSystem() == false && (GetAverageBestLaserRange(gpItemDescObject) / CELL_X_SIZE) > 0 ) | ||
| { | ||
| ubRegionOffset = 7; | ||
| MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + ubRegionOffset ] ); | ||
|
|
@@ -2874,10 +2874,10 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr | |
| ///////////////////// ACCURACY MODIFIER | ||
| if (GetAccuracyModifier( gpItemDescObject ) != 0 ) | ||
| { | ||
| if (cnt >= sFirstLine && cnt < sLastLine) | ||
| { | ||
| if( UsingNewCTHSystem() == true ) | ||
| if (UsingNewCTHSystem() == true) | ||
| { | ||
| if (cnt >= sFirstLine && cnt < sLastLine) | ||
| { | ||
| if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_WEAPON|IC_PUNCH)) | ||
| { | ||
| swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 0 ], szUDBAdvStatsExplanationsTooltipTextForWeapons[ 0 ]); | ||
|
|
@@ -3255,9 +3255,9 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr | |
|
|
||
| ///////////////////// PROJECTION FACTOR / BEST LASER RANGE | ||
| // with the reworked NCTH code and the laser performance factor we will display BestLaserRange instead of ProjectionFactor | ||
| if ( ( UsingNewCTHSystem() && GetBestLaserRange( gpItemDescObject ) > 0 | ||
| if ( ( UsingNewCTHSystem() && (GetBestLaserRange(gpItemDescObject) / CELL_X_SIZE) > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) | ||
| || ( !UsingNewCTHSystem() && GetBestLaserRange( gpItemDescObject ) > 0 ) ) | ||
| || ( !UsingNewCTHSystem() && (GetBestLaserRange(gpItemDescObject) / CELL_X_SIZE) > 0 ) ) | ||
| { | ||
| if (cnt >= sFirstLine && cnt < sLastLine) | ||
| { | ||
|
|
@@ -4434,10 +4434,12 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) | |
|
|
||
| //////////////////// PROJECTION FACTOR / NCTH BEST LASER RANGE | ||
| // with the reworked NCTH code and the laser performance factor we will display BestLaserRange instead of ProjectionFactor but we use the same icon | ||
| if ( (UsingNewCTHSystem() && ( GetProjectionFactor( gpItemDescObject ) > 1.0 || ( GetBestLaserRange( gpItemDescObject ) > 0 | ||
| INT16 itemLaserRangeTiles = GetBestLaserRange(gpItemDescObject) / CELL_X_SIZE; | ||
| INT16 comparedLaserRangeTiles = fComparisonMode ? GetBestLaserRange(gpComparedItemDescObject) / CELL_X_SIZE : 0; | ||
| if ( (UsingNewCTHSystem() && ( GetProjectionFactor( gpItemDescObject ) > 1.0 || ( itemLaserRangeTiles > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) || | ||
| ( fComparisonMode && UsingNewCTHSystem() && ( (GetProjectionFactor( gpItemDescObject ) > 1.0 || GetProjectionFactor( gpComparedItemDescObject ) > 1.0) || | ||
| ( GetBestLaserRange( gpComparedItemDescObject ) > 0 | ||
| ( comparedLaserRangeTiles > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) ) | ||
| { | ||
| ubNumLine = 6; | ||
|
|
@@ -4455,8 +4457,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) | |
| } | ||
|
|
||
| //////////////////// OCTH BEST LASER RANGE | ||
| if ( !UsingNewCTHSystem() && ( GetBestLaserRange( gpItemDescObject ) || | ||
| ( fComparisonMode && GetBestLaserRange( gpComparedItemDescObject ) ) ) ) | ||
| if ( UsingNewCTHSystem() == false && | ||
| (itemLaserRangeTiles != 0 || (fComparisonMode && comparedLaserRangeTiles != 0)) ) | ||
| { | ||
| ubNumLine = 7; | ||
| BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 14, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); | ||
|
|
@@ -5347,11 +5349,13 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) | |
|
|
||
| ///////////////////// PROJECTION FACTOR / BEST LASER RANGE | ||
| // with the reworked NCTH code and the laser performance factor we will display BestLaserRange instead of ProjectionFactor but we use the same icon | ||
| if ( ( UsingNewCTHSystem() && ( GetProjectionFactor( gpItemDescObject ) > 1.0 || ( GetBestLaserRange( gpItemDescObject ) > 0 | ||
| INT16 itemLaserRangeTiles = GetBestLaserRange(gpItemDescObject) / CELL_X_SIZE; | ||
| INT16 comparedLaserRangeTiles = fComparisonMode ? GetBestLaserRange(gpComparedItemDescObject) / CELL_X_SIZE : 0; | ||
| if ( ( UsingNewCTHSystem() && ( GetProjectionFactor( gpItemDescObject ) > 1.0 || ( itemLaserRangeTiles > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) || | ||
| ( fComparisonMode && ( GetProjectionFactor( gpComparedItemDescObject ) > 1.0 || ( GetBestLaserRange( gpComparedItemDescObject ) > 0 | ||
| ( fComparisonMode && ( GetProjectionFactor( gpComparedItemDescObject ) > 1.0 || ( comparedLaserRangeTiles > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) ) || | ||
| ( !UsingNewCTHSystem() && ( GetBestLaserRange( gpItemDescObject ) > 0 || ( fComparisonMode && GetBestLaserRange( gpComparedItemDescObject ) > 0 ) ) ) ) | ||
| ( !UsingNewCTHSystem() && ( itemLaserRangeTiles > 0 || ( fComparisonMode && comparedLaserRangeTiles > 0 ) ) ) ) | ||
| { | ||
| if (cnt >= sFirstLine && cnt < sLastLine) | ||
| { | ||
|
|
@@ -7532,9 +7536,11 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) | |
|
|
||
| ///////////////// (LASER) PROJECTION FACTOR | ||
| // with the reworked NCTH code and the laser performance factor we will display BestLaserRange instead of ProjectionFactor | ||
| INT16 itemLaserRangeTiles = GetBestLaserRange(gpItemDescObject) / CELL_X_SIZE; | ||
| INT16 comparedLaserRangeTiles = fComparisonMode ? GetBestLaserRange(gpComparedItemDescObject) / CELL_X_SIZE : 0; | ||
| if (UsingNewCTHSystem() == true && | ||
| ( (Item[gpItemDescObject->usItem].projectionfactor > 1.0 || GetProjectionFactor( gpItemDescObject ) > 1.0) || | ||
| ( GetBestLaserRange( gpItemDescObject ) > 0 | ||
| ( itemLaserRangeTiles > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) | ||
| { | ||
| // Set line to draw into | ||
|
|
@@ -7545,13 +7551,13 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) | |
| FLOAT iFinalProjectionValue = 0; | ||
| BOOLEAN bNewCode = FALSE; | ||
|
|
||
| if ( GetBestLaserRange( gpItemDescObject ) > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) | ||
| if ( itemLaserRangeTiles > 0 && | ||
| (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) | ||
| { | ||
| // Get base laser range | ||
| iProjectionValue = __max(0, Item[ gpItemDescObject->usItem ].bestlaserrange * gItemSettings.fBestLaserRangeModifier / CELL_X_SIZE); | ||
| // Get best laser range | ||
| iProjectionModifier = ((FLOAT)GetBestLaserRange( gpItemDescObject ) / CELL_X_SIZE); | ||
| iProjectionModifier = (FLOAT)itemLaserRangeTiles; | ||
| // Get final laser range | ||
| iFinalProjectionValue = __max( iProjectionValue, iProjectionModifier ); | ||
| bNewCode = TRUE; | ||
|
|
@@ -7609,7 +7615,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) | |
| // Get base laser range | ||
| iComparedProjectionValue = __max(0, Item[ gpComparedItemDescObject->usItem ].bestlaserrange * gItemSettings.fBestLaserRangeModifier / CELL_X_SIZE); | ||
| // Get best laser range | ||
| iComparedProjectionModifier = ((FLOAT)GetBestLaserRange( gpComparedItemDescObject ) / CELL_X_SIZE); | ||
| iComparedProjectionModifier = (FLOAT)comparedLaserRangeTiles; | ||
| // Get final laser range | ||
| iComparedFinalProjectionValue = __max( iComparedProjectionValue, iComparedProjectionModifier ); | ||
| } | ||
|
|
@@ -7632,7 +7638,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) | |
| } | ||
| else if( fComparisonMode && UsingNewCTHSystem() == true && | ||
| ( (Item[gpComparedItemDescObject->usItem].projectionfactor > 1.0 || GetProjectionFactor( gpComparedItemDescObject ) > 1.0) || | ||
| ( GetBestLaserRange( gpItemDescObject ) > 0 | ||
| ( itemLaserRangeTiles > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) | ||
| { | ||
| ubNumLine = 6; | ||
|
|
@@ -7642,13 +7648,13 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) | |
| FLOAT iFinalProjectionValue = 0; | ||
| BOOLEAN bNewCode = FALSE; | ||
|
|
||
| if ( GetBestLaserRange( gpComparedItemDescObject ) > 0 | ||
| if ( comparedLaserRangeTiles > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) | ||
| { | ||
| // Get base laser range | ||
| iProjectionValue = __max(0, Item[ gpComparedItemDescObject->usItem ].bestlaserrange * gItemSettings.fBestLaserRangeModifier / CELL_X_SIZE); | ||
| // Get best laser range | ||
| iProjectionModifier = ((FLOAT)GetBestLaserRange( gpComparedItemDescObject ) / CELL_X_SIZE); | ||
| iProjectionModifier = (FLOAT)comparedLaserRangeTiles; | ||
| // Get final laser range | ||
| iFinalProjectionValue = __max( iProjectionValue, iProjectionModifier ); | ||
| bNewCode = TRUE; | ||
|
|
@@ -7752,7 +7758,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) | |
| } | ||
|
|
||
| ///////////////// OCTH BEST LASER RANGE | ||
| if ( !UsingNewCTHSystem() && GetBestLaserRange( gpItemDescObject ) > 0 ) | ||
| if ( !UsingNewCTHSystem() && itemLaserRangeTiles > 0 ) | ||
| { | ||
| // Set line to draw into | ||
| ubNumLine = 7; | ||
|
|
@@ -7789,7 +7795,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) | |
| DrawPropertyValueInColour( iComparedFinalBestLaserRangeValue - iFinalBestLaserRangeValue, ubNumLine, 3, fComparisonMode, FALSE, TRUE ); | ||
| } | ||
| } | ||
| else if( !UsingNewCTHSystem() && ( fComparisonMode && GetBestLaserRange( gpComparedItemDescObject ) > 0 ) ) | ||
| else if( !UsingNewCTHSystem() && ( fComparisonMode && comparedLaserRangeTiles > 0 ) ) | ||
| { | ||
| // Set line to draw into | ||
| ubNumLine = 7; | ||
|
|
@@ -11366,14 +11372,16 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) | |
| cnt++; | ||
| } | ||
|
|
||
| BOOLEAN bNewCode = FALSE; | ||
| ///////////////////// PROJECTION FACTOR / BEST LASER RANGE | ||
| // with the reworked NCTH code and the laser performance factor we will display BestLaserRange instead of ProjectionFactor | ||
| if ( ( UsingNewCTHSystem() && ( GetBestLaserRange( gpItemDescObject ) > 0 || ( fComparisonMode && GetBestLaserRange( gpComparedItemDescObject ) > 0 | ||
| BOOLEAN bNewCode = FALSE; | ||
| INT16 itemLaserRangeTiles = GetBestLaserRange(gpItemDescObject) / CELL_X_SIZE; | ||
| INT16 comparedLaserRangeTiles = fComparisonMode ? GetBestLaserRange(gpComparedItemDescObject) / CELL_X_SIZE : 0; | ||
| if ( ( UsingNewCTHSystem() && (itemLaserRangeTiles > 0 || ( fComparisonMode && comparedLaserRangeTiles > 0 | ||
| && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) | ||
| || ( !UsingNewCTHSystem() && ( GetBestLaserRange( gpItemDescObject ) > 0 || ( fComparisonMode && GetBestLaserRange( gpComparedItemDescObject ) > 0 ) ) ) ) | ||
| || ( !UsingNewCTHSystem() && (itemLaserRangeTiles > 0 || ( fComparisonMode && comparedLaserRangeTiles > 0 ) ) ) ) | ||
| { | ||
| iFloatModifier[0] = ((FLOAT)GetBestLaserRange( gpItemDescObject ) / CELL_X_SIZE); | ||
| iFloatModifier[0] = (FLOAT)itemLaserRangeTiles; | ||
| bNewCode = TRUE; | ||
| } | ||
| else | ||
|
|
@@ -11384,7 +11392,7 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) | |
| if( fComparisonMode ) | ||
| { | ||
| if ( bNewCode ) | ||
| iComparedFloatModifier[0] = ((FLOAT)GetBestLaserRange( gpComparedItemDescObject ) / CELL_X_SIZE); | ||
| iComparedFloatModifier[0] = (FLOAT)comparedLaserRangeTiles; | ||
| else | ||
| iComparedFloatModifier[0] = GetProjectionFactor( gpComparedItemDescObject ); | ||
| iComparedFloatModifier[1] = iComparedFloatModifier[0]; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
/ CELL_X_SIZEdoesn't change the evaluation of the condition unless CELL_X_SIZE can be negative. I see CELL_X_SIZE is a constant defined as 10.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It changes condition for cases when GetBestLaserRange(gpItemDescObject) returns [0..9]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. The division is evaluated to an integer. Thank you for the clarification.