Skill Tooltip on Merc Portrait (by Buggler)

- Skills/Traits tooltip over merc portrait in Tactical & Strategic screen
- Fixed Traits tooltip on 'more' popup in personnel screen 
- Increased Energy Bar Color Contrast
- Swapped Mechanical & Explosive Skill in Tactical & Strategic screen to standardize across all screens including AIM, MERC & Personnel screen

Optional Skill Tooltip On Merc Portrait (by Buggler)
- Option to show skill/traits tooltip on merc portrait in AIM/MERC hire screen
- Enhanced merc inventory tooltip to show full BR info in AIM/MERC hire screen
- Fixed BR heavy weapon AP tooltip display bug
- Fixed MERC Exp Lv statistic color

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5802 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-01-22 13:21:01 +00:00
parent fb3d410dd9
commit 6c91b61e6f
20 changed files with 893 additions and 539 deletions
+91 -1
View File
@@ -54,6 +54,8 @@
#include "Queen Command.h"
#include "Render Fun.h"
#include "Food.h"
#include "Personnel.h"
#include "mapscreen.h"
#endif
#include "connect.h"
@@ -232,6 +234,7 @@ BOOLEAN fShowMapScreenMovementList = FALSE;
MapScreenCharacterSt gCharactersList[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS+1];
extern MOUSE_REGION gCharInfoHandRegion;
extern MOUSE_REGION gCharInfoFaceRegion;
MOUSE_REGION gMapStatusBarsRegion;
SGPPoint MovePosition={450, 100 };
@@ -1942,7 +1945,7 @@ void RemoveMapStatusBarsRegion( void )
void UpdateCharRegionHelpText( void )
{
CHAR16 sString[ 128 ];
CHAR16 sString[ 128 ], sTemp[ 20 ];
CHAR16 pMoraleStr[ 128 ];
SOLDIERTYPE *pSoldier = NULL;
@@ -2031,6 +2034,93 @@ void UpdateCharRegionHelpText( void )
SetRegionFastHelpText( &gMapStatusBarsRegion, sString );
// Buggler: skills/traits tooltip on merc portrait
if( ( pSoldier->stats.bLife != 0 ) && !AM_A_ROBOT( pSoldier ) && !IsVehicle( pSoldier ) )
{
// clear pStr value
swprintf( sString, L"");
if (gGameOptions.fNewTraitSystem) // SANDRO - old/new traits check
{
UINT8 ubTempSkillArray[30];
INT8 bNumSkillTraits = 0;
// lets rearrange our skills to a temp array
// we also get the number of lines (skills) to be displayed
for ( UINT8 ubCnt = 1; ubCnt < NUM_SKILLTRAITS_NT; ubCnt++ )
{
if ( ProfileHasSkillTrait( pSoldier->ubProfile, ubCnt ) == 2 )
{
ubTempSkillArray[bNumSkillTraits] = (ubCnt + NEWTRAIT_MERCSKILL_EXPERTOFFSET);
bNumSkillTraits++;
}
else if ( ProfileHasSkillTrait( pSoldier->ubProfile, ubCnt ) == 1 )
{
ubTempSkillArray[bNumSkillTraits] = ubCnt;
bNumSkillTraits++;
}
}
if ( bNumSkillTraits == 0 )
{
swprintf( sString, L"%s", pPersonnelScreenStrings[ PRSNL_TXT_NOSKILLS ] );
}
else
{
for ( UINT8 ubCnt = 0; ubCnt < bNumSkillTraits; ubCnt++ )
{
// Flugente: as the whole trait display is fubar, we have to to a special treatment here for new traits
UINT8 display1 = ubTempSkillArray[ubCnt];
if ( display1 > SCOUTING_NT + NEWTRAIT_MERCSKILL_EXPERTOFFSET )
display1 -= NUM_MINOR_TRAITS;
else if ( display1 >= AMBIDEXTROUS_NT && display1 <= SCOUTING_NT )
display1++;
else if ( display1 == NEWTRAIT_MERCSKILL_EXPERTOFFSET )
display1 -= NUM_MINOR_TRAITS;
swprintf( sTemp, L"%s\n", gzMercSkillTextNew[ display1 ] );
wcscat( sString, sTemp );
}
}
}
else
{
INT8 bSkill1 = 0, bSkill2 = 0;
bSkill1 = gMercProfiles[ pSoldier->ubProfile ].bSkillTraits[0];
bSkill2 = gMercProfiles[ pSoldier->ubProfile ].bSkillTraits[1];
if ( bSkill1 == 0 && bSkill2 == 0 )
{
swprintf( sString, L"%s", pPersonnelScreenStrings[ PRSNL_TXT_NOSKILLS ] );
}
else
{
//if the 2 skills are the same, add the '(expert)' at the end
if( bSkill1 == bSkill2 )
{
swprintf( sString, L"%s %s", gzMercSkillText[bSkill1], gzMercSkillText[EXPERT] );
}
else
{
//Display the first skill
if( bSkill1 != 0 )
{
swprintf( sString, L"%s\n", gzMercSkillText[bSkill1] );
}
if( bSkill2 != 0 )
{
swprintf( sTemp, L"%s", gzMercSkillText[bSkill2] );
wcscat( sString, sTemp );
}
}
}
}
SetRegionFastHelpText( &gCharInfoFaceRegion, sString );
}
else
{
SetRegionFastHelpText( &gCharInfoFaceRegion, L"" );
}
// update CONTRACT button help text
if ( CanExtendContractForCharSlot( bSelectedInfoChar ) )
+2
View File
@@ -147,6 +147,7 @@ BOOLEAN gfBlinkHeader = FALSE;
// mouse regions in mapscreen proper than must have thier help text disabled then re-enabled
extern MOUSE_REGION gMapStatusBarsRegion;
extern MOUSE_REGION gCharInfoFaceRegion;
extern MOUSE_REGION gCharInfoHandRegion;
extern INT32 giMapContractButton;
@@ -351,6 +352,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
// reset the help text for mouse regions
SetRegionFastHelpText( &gCharInfoHandRegion, L"" );
SetRegionFastHelpText( &gCharInfoFaceRegion, L"" );
SetRegionFastHelpText( &gMapStatusBarsRegion, L"" );
gfDisplayPotentialRetreatPaths = FALSE;
+37 -37
View File
@@ -296,10 +296,10 @@ int LVL_X;
int LVL_Y;
int MRK_X;
int MRK_Y;
int EXP_X;
int EXP_Y;
int MEC_X;
int MEC_Y;
int EXP_X;
int EXP_Y;
int MED_X;
int MED_Y;
@@ -1294,10 +1294,10 @@ BOOLEAN InitializeInvPanelCoordsOld()
LVL_Y = AGL_Y;
MRK_X = LVL_X;
MRK_Y = DEX_Y;
EXP_X = LVL_X;
EXP_Y = STR_Y;
MEC_X = LVL_X;
MEC_Y = LDR_Y;
MEC_Y = STR_Y;
EXP_X = LVL_X;
EXP_Y = LDR_Y;
MED_X = LVL_X;
MED_Y = WIS_Y;
@@ -1624,10 +1624,10 @@ BOOLEAN InitializeInvPanelCoordsNew()
LVL_Y = AGL_Y;
MRK_X = LVL_X;
MRK_Y = DEX_Y;
EXP_X = LVL_X;
EXP_Y = STR_Y;
MEC_X = LVL_X;
MEC_Y = LDR_Y;
MEC_Y = STR_Y;
EXP_X = LVL_X;
EXP_Y = LDR_Y;
MED_X = LVL_X;
MED_Y = WIS_Y;
@@ -2157,7 +2157,6 @@ void DrawFace( INT16 sCharNumber )
return;
}
if( ( gCharactersList[ bSelectedInfoChar ].usSolID == sOldId )&&( fReDrawFace == FALSE ) )
{
// are the same, return
@@ -2548,34 +2547,6 @@ void DrawCharStats( INT16 sCharNum )
FindFontRightCoordinates(MRK_X,MRK_Y,STAT_WID ,STAT_HEI,sString , CHAR_FONT, &usX, &usY);
DrawString(sString,usX, MRK_Y,CHAR_FONT );
// explosives
swprintf( sString, L"%d", pSoldier->stats.bExplosive );
// SANDRO - if damaged stat we could regain, show in red until repaired
if( gGameOptions.fNewTraitSystem && ( pSoldier->ubCriticalStatDamage[DAMAGED_STAT_EXPLOSIVES] > 0 ))
{
SetFontForeground( FONT_RED );
}
else if( ( GetJA2Clock() < CHANGE_STAT_RECENTLY_DURATION + pSoldier->timeChanges.uiChangeExplosivesTime)&& ( pSoldier->timeChanges.uiChangeExplosivesTime != 0 ) )
{
if( pSoldier->usValueGoneUp & EXP_INCREASE )
{
SetFontForeground( FONT_LTGREEN );
}
else
{
SetFontForeground( FONT_RED );
}
}
else
{
SetFontForeground(CHAR_TEXT_FONT_COLOR);
}
// right justify
FindFontRightCoordinates(EXP_X,EXP_Y,STAT_WID ,STAT_HEI,sString , CHAR_FONT, &usX, &usY);
DrawString(sString,usX, EXP_Y,CHAR_FONT );
// mechanical
swprintf( sString, L"%d", pSoldier->stats.bMechanical );
@@ -2603,6 +2574,34 @@ void DrawCharStats( INT16 sCharNum )
// right justify
FindFontRightCoordinates(MEC_X,MEC_Y,STAT_WID ,STAT_HEI,sString , CHAR_FONT, &usX, &usY);
DrawString(sString,usX, MEC_Y,CHAR_FONT );
// explosives
swprintf( sString, L"%d", pSoldier->stats.bExplosive );
// SANDRO - if damaged stat we could regain, show in red until repaired
if( gGameOptions.fNewTraitSystem && ( pSoldier->ubCriticalStatDamage[DAMAGED_STAT_EXPLOSIVES] > 0 ))
{
SetFontForeground( FONT_RED );
}
else if( ( GetJA2Clock() < CHANGE_STAT_RECENTLY_DURATION + pSoldier->timeChanges.uiChangeExplosivesTime)&& ( pSoldier->timeChanges.uiChangeExplosivesTime != 0 ) )
{
if( pSoldier->usValueGoneUp & EXP_INCREASE )
{
SetFontForeground( FONT_LTGREEN );
}
else
{
SetFontForeground( FONT_RED );
}
}
else
{
SetFontForeground(CHAR_TEXT_FONT_COLOR);
}
// right justify
FindFontRightCoordinates(EXP_X,EXP_Y,STAT_WID ,STAT_HEI,sString , CHAR_FONT, &usX, &usY);
DrawString(sString,usX, EXP_Y,CHAR_FONT );
// medical
swprintf( sString, L"%d", pSoldier->stats.bMedical );
@@ -9836,6 +9835,7 @@ void MAPBeginItemPointer( SOLDIERTYPE *pSoldier, UINT8 ubHandPos )
{
numToMove = 1;
}
pSoldier->inv[ubHandPos].MoveThisObjectTo(gItemPointer, numToMove, pSoldier, ubHandPos);
//Autoplace to map sector invectory