Number and type of prisoners in player-controlled prisons is now displayed in sector info box.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7185 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-05-02 23:06:54 +00:00
parent 3a7f7b263b
commit b571d62a8b
10 changed files with 29 additions and 13 deletions
@@ -28,6 +28,7 @@
#include "Tactical Save.h"
#include "GameSettings.h"
#include "debug.h"
#include "Overhead.h" // added by Flugente
#endif
#include "Strategic Mines.h"
@@ -170,9 +171,8 @@ void CreateDestroyTownInfoBox( void )
AddItemsInSectorToBox();
// set font type
SetBoxFont(ghTownMineBox, BLOCKFONT2);
SetBoxFont(ghTownMineBox, BLOCKFONT2);
// set highlight color
SetBoxHighLight(ghTownMineBox, FONT_WHITE);
@@ -228,7 +228,6 @@ void CreateDestroyTownInfoBox( void )
}
else if( ( fCreated == TRUE ) && ( fShowTownInfo == FALSE ) )
{
// get box size
GetBoxSize( ghTownMineBox, &pDimensions );
@@ -247,9 +246,6 @@ void CreateDestroyTownInfoBox( void )
fCreated = FALSE;
}
return;
}
@@ -289,7 +285,6 @@ void AddTextToTownBox( void )
UINT16 usTownSectorIndex;
INT16 sMineSector = 0;
// remember town id
ubTownId = GetTownIdForSector( bCurrentTownMineSectorX, bCurrentTownMineSectorY );
Assert((ubTownId >= FIRST_TOWN) && (ubTownId < NUM_TOWNS));
@@ -395,10 +390,10 @@ void AddTextToTownBox( void )
// town size
if( gfHiddenTown[ GetTownIdForSector( bCurrentTownMineSectorX, bCurrentTownMineSectorY ) ] )
{
swprintf( wString, L"%s:", pwTownInfoStrings[ 0 ] );
AddMonoString( &hStringHandle, wString );
swprintf( wString, L"%d", GetTownSectorSize( ubTownId ) );
AddSecondColumnMonoString( &hStringHandle, wString );
swprintf( wString, L"%s:", pwTownInfoStrings[ 0 ] );
AddMonoString( &hStringHandle, wString );
swprintf( wString, L"%d", GetTownSectorSize( ubTownId ) );
AddSecondColumnMonoString( &hStringHandle, wString );
}
// main facilities
@@ -432,9 +427,21 @@ void AddTextToTownBox( void )
if( sMineSector != -1 && gfHiddenTown[ GetTownIdForSector( bCurrentTownMineSectorX, bCurrentTownMineSectorY ) ] )
{
// Associated Mine: Sector
swprintf( wString, L"%s:", pwTownInfoStrings[ 4 ] );
swprintf( wString, L"%s:", pwTownInfoStrings[ 4 ] );
AddMonoString( &hStringHandle, wString );
GetShortSectorString( ( INT16 )( sMineSector % MAP_WORLD_X ), ( INT16 )( sMineSector / MAP_WORLD_X ), wString );
GetShortSectorString( ( INT16 )( sMineSector % MAP_WORLD_X ), ( INT16 )( sMineSector / MAP_WORLD_X ), wString );
AddSecondColumnMonoString( &hStringHandle, wString );
}
// Flugente: if this is a prison we control, display number of prisoners here
UINT8 prisoners[PRISONER_MAX] = { 0 };
UINT16 numprisoners = GetNumberOfPrisoners( &(SectorInfo[SECTOR( bCurrentTownMineSectorX, bCurrentTownMineSectorY )]), &prisoners[PRISONER_OFFICER], &prisoners[PRISONER_ELITE], &prisoners[PRISONER_REGULAR], &prisoners[PRISONER_ADMIN] );
if ( numprisoners )
{
// prisoners
swprintf( wString, L"%s:", pwTownInfoStrings[13] );
AddMonoString( &hStringHandle, wString );
swprintf( wString, L"%d/%d/%d/%d%", prisoners[PRISONER_ADMIN], prisoners[PRISONER_REGULAR], prisoners[PRISONER_ELITE], prisoners[PRISONER_OFFICER] );
AddSecondColumnMonoString( &hStringHandle, wString );
}
}