From 51dcf322aada984ee22a046c87d0e2e37a0007ce Mon Sep 17 00:00:00 2001 From: silversurfer Date: Wed, 13 May 2015 20:10:08 +0000 Subject: [PATCH] EDB now displays the spread pattern of shotguns on the description tab. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7859 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Enhanced.cpp | 5 +++- Tactical/Interface Items.cpp | 52 +++++++++++++++++++++------------ Tactical/Interface Items.h | 2 +- Utils/Text.h | 2 +- Utils/_ChineseText.cpp | 3 +- Utils/_DutchText.cpp | 3 +- Utils/_EnglishText.cpp | 3 +- Utils/_FrenchText.cpp | 3 +- Utils/_GermanText.cpp | 3 +- Utils/_ItalianText.cpp | 3 +- Utils/_PolishText.cpp | 3 +- Utils/_RussianText.cpp | 3 +- 12 files changed, 55 insertions(+), 30 deletions(-) diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index a71eaa81..92b98e8c 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -200,9 +200,12 @@ void InitEDBCoords(OBJECTTYPE * pObject) // CONS text gItemDescTextRegions[6].sLeft = 50 + UDBOffsetX; gItemDescTextRegions[6].sTop = 292 + UDBOffsetY; gItemDescTextRegions[6].sRight = 230 + UDBOffsetX; gItemDescTextRegions[6].sBottom = 300 + UDBOffsetY; - // Flugente FTW 1: Temperature. Is displayed between Weight and the PROS label, so the indexes should be moved... but it is unclear if this description is needed, anyway + // silversurfer: spread patterns. Is displayed above the Pros label. gItemDescTextRegions[7].sLeft = 20 + UDBOffsetX; gItemDescTextRegions[7].sTop = 254 + UDBOffsetY; gItemDescTextRegions[7].sRight = 230 + UDBOffsetX; gItemDescTextRegions[7].sBottom = 262 + UDBOffsetY; + // Flugente FTW 1: Temperature. Is displayed between Weight and the PROS label, so the indexes should be moved... but it is unclear if this description is needed, anyway + gItemDescTextRegions[8].sLeft = 20 + UDBOffsetX; gItemDescTextRegions[8].sTop = 266 + UDBOffsetY; gItemDescTextRegions[8].sRight = 230 + UDBOffsetX; gItemDescTextRegions[8].sBottom = 274 + UDBOffsetY; + ////////////////// MONEY TEXT COORDINATES gMoneyStats[0].sX = 20 + UDBOffsetX; gMoneyStats[0].sY = 230 + UDBOffsetY; // Money gMoneyStats[1].sX = 63 + UDBOffsetX; gMoneyStats[1].sY = 230 + UDBOffsetY; // Remaining diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index f276a924..c5f94526 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -576,7 +576,7 @@ INV_DESC_REGIONS gItemDescGenHeaderRegions[3]; // Header text regions for variou INV_DESC_REGIONS gItemDescGenIndexRegions[3][4]; // Index text regions for various parts of the General Tab INV_DESC_REGIONS gItemDescGenRegions[NUM_UDB_GEN_LINES * 2][4]; // Data regions, 4 sub-columns each INV_DESC_REGIONS gItemDescGenSecondaryRegions[26]; // Secondary data regions, 3x5 -INV_DESC_REGIONS gItemDescTextRegions[8]; // Main description regions +INV_DESC_REGIONS gItemDescTextRegions[9]; // Main description regions INV_DESC_REGIONS gItemDescAdvIndexRegions[1][4]; INV_DESC_REGIONS gItemDescAdvRegions[NUM_UDB_ADV_LINES][4]; // Advanced data regions, 4 sub-columns each @@ -7178,11 +7178,25 @@ void RenderItemDescriptionBox( ) ////////// label if (UsingEDBSystem()) { + // silversurfer: spread pattern for shotguns + if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && Weapon[ gpItemDescObject->usItem ].ubWeaponType == GUN_SHOTGUN ) + { + int regionindex = 7; + // print label + mprintf( gItemDescTextRegions[regionindex].sLeft, gItemDescTextRegions[regionindex].sTop, gWeaponStatsDesc[20] ); + + // print value + SetFontForeground( 5 ); + MultiByteToWideChar( CP_UTF8, 0, gpSpreadPattern[GetSpreadPattern( gpItemDescObject )].Name, -1, pStr, sizeof(pStr)/sizeof(pStr[0]) ); + FindFontRightCoordinates( gItemDescTextRegions[regionindex].sLeft, gItemDescTextRegions[regionindex].sTop, gItemDescTextRegions[regionindex].sRight - gItemDescTextRegions[regionindex].sLeft ,gItemDescTextRegions[regionindex].sBottom - gItemDescTextRegions[regionindex].sTop ,pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + // Flugente: display temperature string if ( gGameExternalOptions.fWeaponOverheating && ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN || Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER || Item[gpItemDescObject->usItem].barrel == TRUE ) ) { // UDB system displays a string with colored condition text. - int regionindex = 7; + int regionindex = 8; SetFontForeground( ForegroundColor ); swprintf( pStr, L"%s", gTemperatureDesc[0] ); // "Temperature is " mprintf( gItemDescTextRegions[regionindex].sLeft, gItemDescTextRegions[regionindex].sTop, pStr ); @@ -14486,29 +14500,29 @@ void UpdateMercBodyRegionHelpText( ) // person (health/energy/morale) GetMoraleString( pSoldier, pMoraleStr ); - if ( pSoldier->bPoisonSum ) - { - INT8 bPoisonBandaged = pSoldier->bPoisonSum - pSoldier->bPoisonBleeding - pSoldier->bPoisonLife; + if ( pSoldier->bPoisonSum ) + { + INT8 bPoisonBandaged = pSoldier->bPoisonSum - pSoldier->bPoisonBleeding - pSoldier->bPoisonLife; swprintf( sString, L"%s: %d/%d, %s: %d/%d/%d - %d, %s: %d/%d, %s: %s", - pMapScreenStatusStrings[0], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, - pMapScreenStatusStrings[5], pSoldier->bPoisonBleeding, bPoisonBandaged, pSoldier->bPoisonLife, pSoldier->bPoisonSum, - pMapScreenStatusStrings[1], pSoldier->bBreath, pSoldier->bBreathMax, - pMapScreenStatusStrings[2], pMoraleStr ); - } - else - { - swprintf( sString, L"%s: %d/%d, %s: %d/%d, %s: %s", - pMapScreenStatusStrings[0], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, - pMapScreenStatusStrings[1], pSoldier->bBreath, pSoldier->bBreathMax, - pMapScreenStatusStrings[2], pMoraleStr ); - } + pMapScreenStatusStrings[0], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, + pMapScreenStatusStrings[5], pSoldier->bPoisonBleeding, bPoisonBandaged, pSoldier->bPoisonLife, pSoldier->bPoisonSum, + pMapScreenStatusStrings[1], pSoldier->bBreath, pSoldier->bBreathMax, + pMapScreenStatusStrings[2], pMoraleStr ); + } + else + { + swprintf( sString, L"%s: %d/%d, %s: %d/%d, %s: %s", + pMapScreenStatusStrings[0], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, + pMapScreenStatusStrings[1], pSoldier->bBreath, pSoldier->bBreathMax, + pMapScreenStatusStrings[2], pMoraleStr ); + } pSoldier->PrintFoodDesc( sString, TRUE ); - pSoldier->PrintDiseaseDesc( sString, TRUE ); + pSoldier->PrintDiseaseDesc( sString, TRUE ); + } } } - } SetRegionFastHelpText( &gSMInvCamoRegion, sString ); } diff --git a/Tactical/Interface Items.h b/Tactical/Interface Items.h index b23b54b9..52c7a9f7 100644 --- a/Tactical/Interface Items.h +++ b/Tactical/Interface Items.h @@ -37,7 +37,7 @@ extern INV_DESC_REGIONS gItemDescGenHeaderRegions[3]; // Header text regions for extern INV_DESC_REGIONS gItemDescGenIndexRegions[3][4]; // Index text regions for various parts of the General Tab extern INV_DESC_REGIONS gItemDescGenRegions[NUM_UDB_GEN_LINES * 2][4]; // Data regions, 4 sub-columns each extern INV_DESC_REGIONS gItemDescGenSecondaryRegions[26]; // Secondary data regions, 3x5 for now (possible 3x6?) -extern INV_DESC_REGIONS gItemDescTextRegions[8]; // Main description regions +extern INV_DESC_REGIONS gItemDescTextRegions[9]; // Main description regions extern INV_DESC_REGIONS gItemDescAdvIndexRegions[1][4]; extern INV_DESC_REGIONS gItemDescAdvRegions[NUM_UDB_ADV_LINES][4]; // Advanced data regions, 4 sub-columns each diff --git a/Utils/Text.h b/Utils/Text.h index 55884f64..c7efac80 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -713,7 +713,7 @@ extern STR16 gFoodDesc[ 8 ]; extern CHAR16 gMoneyStatsDesc[][ 14 ]; // HEADROCK: Altered value to 16 //WarmSteel - And I need 17. // Flugente: 17->19 -extern CHAR16 gWeaponStatsDesc[][ 19 ]; +extern CHAR16 gWeaponStatsDesc[][ 20 ]; // HEADROCK: Added externs for Item Description Box icon and stat tooltips // Note that I've inflated some of these to 20 to avoid issues. extern STR16 gzWeaponStatsFasthelpTactical[ 33 ]; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 1c0f733f..e6d8bb28 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -2869,7 +2869,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 19 ] = +CHAR16 gWeaponStatsDesc[][ 20 ] = { // HEADROCK: Changed this for Extended Description project L"状态: ", @@ -2896,6 +2896,7 @@ CHAR16 gWeaponStatsDesc[][ 19 ] = L"默认:", //17 //WarmSteel - So we can also display default attachments L"污垢:", // 18 //added by Flugente L"空位:", // 19 //space left on Molle items L"Space:", + L"Spread Pattern:", // 20 // TODO.Translate }; diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 1c04f259..6da2ffe6 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -2866,7 +2866,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 19 ] = +CHAR16 gWeaponStatsDesc[][ 20 ] = { // HEADROCK: Changed this for Extended Description project L"Status:", @@ -2893,6 +2893,7 @@ CHAR16 gWeaponStatsDesc[][ 19 ] = L"Default:", //17 //WarmSteel - So we can also display default attachments L"Dirt:", // 18 //added by Flugente // TODO.Translate L"Space:", // 19 //space left on Molle items // TODO.Translate + L"Spread Pattern:", // 20 // TODO.Translate }; diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 9d285d51..760c9df8 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -2869,7 +2869,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 19 ] = +CHAR16 gWeaponStatsDesc[][ 20 ] = { // HEADROCK: Changed this for Extended Description project L"Status:", @@ -2896,6 +2896,7 @@ CHAR16 gWeaponStatsDesc[][ 19 ] = L"Default:", //17 //WarmSteel - So we can also display default attachments L"Dirt:", // 18 //added by Flugente L"Space:", // 19 //space left on Molle items + L"Spread Pattern:", // 20 }; diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 1b958542..d9a8c396 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -2875,7 +2875,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 19 ] = +CHAR16 gWeaponStatsDesc[][ 20 ] = { // HEADROCK: Changed this for Extended Description project L"État :", @@ -2900,6 +2900,7 @@ CHAR16 gWeaponStatsDesc[][ 19 ] = L"Par défaut :", //17 //WarmSteel - So we can also display default attachments L"Encras. :", // 18 //added by Flugente L"Place :", // 19 //space left on Molle items + L"Spread Pattern:", // 20 // TODO.Translate }; diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index c69bd2f6..dd68e2b1 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -2877,7 +2877,7 @@ STR16 sKeyDescriptionStrings[2]= }; //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 19 ] = +CHAR16 gWeaponStatsDesc[][ 20 ] = { // HEADROCK: Changed this for Extended Description project L"Status:", @@ -2903,6 +2903,7 @@ CHAR16 gWeaponStatsDesc[][ 19 ] = L"Standard:", //17 //WarmSteel - So we can also display default attachments L"Schmutz:", // 18 //added by Flugente L"Platz:", // 19 //space left on Molle items + L"Streumuster:", // 20 }; diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 2b29e1a1..29a32d27 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -2862,7 +2862,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 19 ] = +CHAR16 gWeaponStatsDesc[][ 20 ] = { // HEADROCK: Changed this for Extended Description project L"Stato:", @@ -2889,6 +2889,7 @@ CHAR16 gWeaponStatsDesc[][ 19 ] = L"Default:", //17 //WarmSteel - So we can also display default attachments L"Dirt:", // 18 //added by Flugente // TODO.Translate L"Space:", // 19 //space left on Molle items // TODO.Translate + L"Spread Pattern:", // 20 // TODO.Translate }; diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 7ddaa5b5..a3239522 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -2877,7 +2877,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 19 ] = +CHAR16 gWeaponStatsDesc[][ 20 ] = { // HEADROCK: Changed this for Extended Description project L"Stan:", @@ -2903,6 +2903,7 @@ CHAR16 gWeaponStatsDesc[][ 19 ] = L"Domyślne:", //17 //WarmSteel - So we can also display default attachments L"Dirt:", // 18 //added by Flugente // TODO.Translate L"Space:", // 19 //space left on Molle items // TODO.Translate + L"Spread Pattern:", // 20 // TODO.Translate }; diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 5d610f5a..1e5415b1 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -2867,7 +2867,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 19 ] = +CHAR16 gWeaponStatsDesc[][ 20 ] = { // HEADROCK: Changed this for Extended Description project L"Состояние:", @@ -2893,6 +2893,7 @@ CHAR16 gWeaponStatsDesc[][ 19 ] = L"Предустановка:", //17 //WarmSteel - So we can also display default attachments L"Нагар:", // 18 L"Место:", // 19 //space left on Molle items + L"Spread Pattern:", // 20 // TODO.Translate };