From b4f60527cda27f79755870b2acf216cf8205b1d8 Mon Sep 17 00:00:00 2001 From: Flugente Date: Wed, 27 Feb 2013 23:13:27 +0000 Subject: [PATCH] added squadnames to a few locations git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5879 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 5 ++++- Strategic/Strategic Movement.cpp | 6 +++++- Tactical/Interface.cpp | 7 ++++++- Tactical/Turn Based Input.cpp | 7 +++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 8009e6e3d..f0e2137af 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -10621,7 +10621,10 @@ void CreateAssignmentsBox( void ) if( ( uiCounter == ASSIGN_MENU_ON_DUTY ) && ( pSoldier != NULL ) && ( pSoldier->bAssignment < ON_DUTY ) ) { // show his squad # in brackets - swprintf( sString, L"%s(%d)", pAssignMenuStrings[uiCounter], pSoldier->bAssignment + 1 ); + if ( gGameExternalOptions.fUseXMLSquadNames ) + swprintf( sString, L"%s(%s)", pAssignMenuStrings[uiCounter], SquadNames[ pSoldier->bAssignment ].squadname ); + else + swprintf( sString, L"%s(%d)", pAssignMenuStrings[uiCounter], pSoldier->bAssignment + 1 ); } else { diff --git a/Strategic/Strategic Movement.cpp b/Strategic/Strategic Movement.cpp index f972a74ee..0d55fc28f 100644 --- a/Strategic/Strategic Movement.cpp +++ b/Strategic/Strategic Movement.cpp @@ -5269,7 +5269,11 @@ BOOLEAN HandlePlayerGroupEnteringSectorToCheckForNPCsOfNote( GROUP *pGroup ) // build string for squad GetSectorIDString( sSectorX, sSectorY, bSectorZ, wSectorName, FALSE ); - swprintf( sString, pLandMarkInSectorString[ 0 ], pGroup->pPlayerList->pSoldier->bAssignment + 1, wSectorName ); + + if ( gGameExternalOptions.fUseXMLSquadNames && pGroup->pPlayerList->pSoldier->bAssignment < ON_DUTY ) + swprintf( sString, pLandMarkInSectorString[ 0 ], SquadNames[ pGroup->pPlayerList->pSoldier->bAssignment ].squadname, wSectorName ); + else + swprintf( sString, pLandMarkInSectorString[ 0 ], pGroup->pPlayerList->pSoldier->bAssignment + 1, wSectorName ); if ( GroupAtFinalDestination( pGroup ) ) { diff --git a/Tactical/Interface.cpp b/Tactical/Interface.cpp index aa3d868fd..fbac8f1b4 100644 --- a/Tactical/Interface.cpp +++ b/Tactical/Interface.cpp @@ -60,6 +60,7 @@ #include "Queen Command.h" // HEADROCK HAM 4: Included for new CTH indicator #include "weapons.h" + #include "Map Screen Interface.h" // added by Flugente for SquadNames #endif @@ -1884,7 +1885,11 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID ) } else if ( pSoldier->bTeam == gbPlayerNum && pSoldier->bAssignment < ON_DUTY && pSoldier->bAssignment != CurrentSquad() && !( pSoldier->flags.uiStatusFlags & SOLDIER_MULTI_SELECTED ) ) { - swprintf( NameStr, gzLateLocalizedString[ 34 ], ( pSoldier->bAssignment + 1 ) ); + if ( gGameExternalOptions.fUseXMLSquadNames ) + swprintf( NameStr, SquadNames[ pSoldier->bAssignment ].squadname ); + else + swprintf( NameStr, gzLateLocalizedString[ 34 ], ( pSoldier->bAssignment + 1 ) ); + FindFontCenterCoordinates( sXPos, (INT16)(sYPos ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY ); gprintfdirty( sX, sY, NameStr ); mprintf( sX, sY, NameStr ); diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 7c570e844..437167bb3 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -2091,8 +2091,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) { HandleLocateSelectMerc( pNewSoldier->ubID, LOCATEANDSELECT_MERC ); - //ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( CurrentSquad( ) + 1 ) ); - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( pNewSoldier->bAssignment + 1 ) ); + if ( gGameExternalOptions.fUseXMLSquadNames && pNewSoldier->bAssignment < ON_DUTY ) + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], SquadNames[ pNewSoldier->bAssignment ].squadname ); + else + //ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( CurrentSquad( ) + 1 ) ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( pNewSoldier->bAssignment + 1 ) ); // Center to guy.... LocateSoldier( gusSelectedSoldier, SETLOCATOR );