- Expanded militia training to 6x6 square (by Buggler)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6355 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-09-04 10:28:12 +00:00
parent 92c04a4f60
commit 89194ff11b
10 changed files with 177 additions and 57 deletions
+125 -21
View File
@@ -309,9 +309,9 @@ UINT16 MAP_MILITIA_BOX_POS_Y;
// the max allowable towns militia in a sector // the max allowable towns militia in a sector
#define MAP_MILITIA_MAP_X 4 #define MAP_MILITIA_MAP_X 4
#define MAP_MILITIA_MAP_Y 20 #define MAP_MILITIA_MAP_Y 20
#define MAP_MILITIA_LOWER_ROW_Y 142 #define MAP_MILITIA_LOWER_ROW_Y 250
#define NUMBER_OF_MILITIA_ICONS_PER_LOWER_ROW 25 #define NUMBER_OF_MILITIA_ICONS_PER_LOWER_ROW 50
#define MILITIA_BOX_ROWS 3 #define MILITIA_BOX_ROWS 6
#define MILITIA_BOX_BOX_HEIGHT 36 #define MILITIA_BOX_BOX_HEIGHT 36
#define MILITIA_BOX_BOX_WIDTH 42 #define MILITIA_BOX_BOX_WIDTH 42
@@ -323,14 +323,15 @@ UINT16 MAP_MILITIA_BOX_POS_Y;
#define MILITIA_BTN_OFFSET_X 26 #define MILITIA_BTN_OFFSET_X 26
#define MILITIA_BTN_HEIGHT 11 #define MILITIA_BTN_HEIGHT 11
#define MILITIA_BOX_WIDTH 133 #define MILITIA_BOX_WIDTH 266
#define MILITIA_BOX_TEXT_OFFSET_Y 4 #define MILITIA_BOX_TEXT_OFFSET_Y 4
#define MILITIA_BOX_UNASSIGNED_TEXT_OFFSET_Y 132 #define MILITIA_BOX_UNASSIGNED_TEXT_OFFSET_Y 240
#define MILITIA_BOX_TEXT_TITLE_HEIGHT 13 #define MILITIA_BOX_TEXT_TITLE_HEIGHT 13
#define MAP_MILITIA_BOX_AUTO_BOX_X 4 #define MAP_MILITIA_BOX_AUTO_BOX_X 101
#define MAP_MILITIA_BOX_AUTO_BOX_Y 167 #define MAP_MILITIA_BOX_AUTO_BOX_Y 275
#define MAP_MILITIA_BOX_DONE_BOX_X 67 #define MAP_MILITIA_BOX_DONE_BOX_X 164
#define MAP_MILITIA_BOX_REMOVE_BOX_X 38
#define HELI_ICON 0 #define HELI_ICON 0
#define HELI_SHADOW_ICON 1 #define HELI_SHADOW_ICON 1
@@ -344,8 +345,8 @@ UINT16 MAP_MILITIA_BOX_POS_Y;
// the militia box buttons and images // the militia box buttons and images
INT32 giMapMilitiaButtonImage[ 5 ]; INT32 giMapMilitiaButtonImage[ 6 ];
INT32 giMapMilitiaButton[ 5 ] = { -1, -1, -1, -1, -1 }; INT32 giMapMilitiaButton[ 6 ] = { -1, -1, -1, -1, -1, -1 };
INT16 gsMilitiaSectorButtonColors[]={ INT16 gsMilitiaSectorButtonColors[]={
@@ -501,7 +502,7 @@ INT8 bSelectedContractChar = -1;
BOOLEAN fTempPathAlreadyDrawn = FALSE; BOOLEAN fTempPathAlreadyDrawn = FALSE;
// the regions for the mapscreen militia box // the regions for the mapscreen militia box
MOUSE_REGION gMapScreenMilitiaBoxRegions[ 9 ]; MOUSE_REGION gMapScreenMilitiaBoxRegions[ 36 ];
MOUSE_REGION gMapScreenMilitiaRegion; MOUSE_REGION gMapScreenMilitiaRegion;
// the mine icon // the mine icon
@@ -558,11 +559,13 @@ void DisplayUnallocatedMilitia( void );
BOOLEAN IsThisMilitiaTownSectorAllowable( INT16 sSectorIndexValue ); BOOLEAN IsThisMilitiaTownSectorAllowable( INT16 sSectorIndexValue );
void DrawTownMilitiaName( void ); void DrawTownMilitiaName( void );
void HandleShutDownOfMilitiaPanelIfPeopleOnTheCursor( INT16 sTownValue ); void HandleShutDownOfMilitiaPanelIfPeopleOnTheCursor( INT16 sTownValue );
void HandleRemovalOfAllTroopsAmongstSectors( void );
void HandleEveningOutOfTroopsAmongstSectors( void ); void HandleEveningOutOfTroopsAmongstSectors( void );
void CreateMilitiaPanelBottomButton( void ); void CreateMilitiaPanelBottomButton( void );
void DeleteMilitiaPanelBottomButton( void ); void DeleteMilitiaPanelBottomButton( void );
void MilitiaDoneButtonCallback(GUI_BUTTON *btn,INT32 reason); void MilitiaDoneButtonCallback(GUI_BUTTON *btn,INT32 reason);
void MilitiaAutoButtonCallback(GUI_BUTTON *btn,INT32 reason); void MilitiaAutoButtonCallback(GUI_BUTTON *btn,INT32 reason);
void MilitiaRemoveButtonCallback(GUI_BUTTON *btn,INT32 reason);
void MilitiaDisbandYesNoBoxCallback( UINT8 bExitValue ); // HEADROCK HAM 3.6: Disband militia callback void MilitiaDisbandYesNoBoxCallback( UINT8 bExitValue ); // HEADROCK HAM 3.6: Disband militia callback
void RenderShadingForUnControlledSectors( void ); void RenderShadingForUnControlledSectors( void );
void DrawTownMilitiaForcesOnMap( void ); void DrawTownMilitiaForcesOnMap( void );
@@ -2048,8 +2051,8 @@ BOOLEAN ShadeMapElemZoomIn(INT16 sMapX, INT16 sMapY, INT32 iColor )
void InitializeMilitiaPopup(void) void InitializeMilitiaPopup(void)
{ {
UINT16 xVal = 400; UINT16 xVal = 330;
UINT16 yVal = 125; UINT16 yVal = 25;
if (iResolution >= _640x480 && iResolution < _800x600) if (iResolution >= _640x480 && iResolution < _800x600)
{ {
@@ -5666,7 +5669,7 @@ void CreateDestroyMilitiaPopUPRegions( void )
if( fShowMilitia && sSelectedMilitiaTown && !gfMilitiaPopupCreated ) if( fShowMilitia && sSelectedMilitiaTown && !gfMilitiaPopupCreated )
{ {
for( iCounter = 0; iCounter < 9; iCounter++ ) for( iCounter = 0; iCounter < 36; iCounter++ )
{ {
MSYS_DefineRegion( &gMapScreenMilitiaBoxRegions[ iCounter ], ( INT16 ) ( MAP_MILITIA_BOX_POS_X + MAP_MILITIA_MAP_X + ( iCounter % MILITIA_BOX_ROWS ) * MILITIA_BOX_BOX_WIDTH ), ( INT16 )( MAP_MILITIA_BOX_POS_Y + MAP_MILITIA_MAP_Y + ( iCounter / MILITIA_BOX_ROWS ) * MILITIA_BOX_BOX_HEIGHT ), ( INT16 )( MAP_MILITIA_BOX_POS_X + MAP_MILITIA_MAP_X + ( ( ( iCounter ) % MILITIA_BOX_ROWS ) + 1 ) * MILITIA_BOX_BOX_WIDTH ), ( INT16 )( MAP_MILITIA_BOX_POS_Y + MAP_MILITIA_MAP_Y + ( ( ( iCounter ) / MILITIA_BOX_ROWS ) + 1 ) * MILITIA_BOX_BOX_HEIGHT ), MSYS_PRIORITY_HIGHEST - 3, MSYS_DefineRegion( &gMapScreenMilitiaBoxRegions[ iCounter ], ( INT16 ) ( MAP_MILITIA_BOX_POS_X + MAP_MILITIA_MAP_X + ( iCounter % MILITIA_BOX_ROWS ) * MILITIA_BOX_BOX_WIDTH ), ( INT16 )( MAP_MILITIA_BOX_POS_Y + MAP_MILITIA_MAP_Y + ( iCounter / MILITIA_BOX_ROWS ) * MILITIA_BOX_BOX_HEIGHT ), ( INT16 )( MAP_MILITIA_BOX_POS_X + MAP_MILITIA_MAP_X + ( ( ( iCounter ) % MILITIA_BOX_ROWS ) + 1 ) * MILITIA_BOX_BOX_WIDTH ), ( INT16 )( MAP_MILITIA_BOX_POS_Y + MAP_MILITIA_MAP_Y + ( ( ( iCounter ) / MILITIA_BOX_ROWS ) + 1 ) * MILITIA_BOX_BOX_HEIGHT ), MSYS_PRIORITY_HIGHEST - 3,
MSYS_NO_CURSOR, MilitiaRegionMoveCallback, MilitiaRegionClickCallback ); MSYS_NO_CURSOR, MilitiaRegionMoveCallback, MilitiaRegionClickCallback );
@@ -5684,7 +5687,7 @@ void CreateDestroyMilitiaPopUPRegions( void )
else if( gfMilitiaPopupCreated && ( !fShowMilitia || !sSelectedMilitiaTown ) ) else if( gfMilitiaPopupCreated && ( !fShowMilitia || !sSelectedMilitiaTown ) )
{ {
for( iCounter = 0; iCounter < 9; iCounter++ ) for( iCounter = 0; iCounter < 36; iCounter++ )
{ {
// remove region // remove region
MSYS_RemoveRegion( &gMapScreenMilitiaBoxRegions[ iCounter ] ); MSYS_RemoveRegion( &gMapScreenMilitiaBoxRegions[ iCounter ] );
@@ -5725,7 +5728,7 @@ void RenderIconsPerSectorForSelectedTown( void )
GetVideoObject( &hVObject, guiMilitia ); GetVideoObject( &hVObject, guiMilitia );
// render icons for map // render icons for map
for( iCounter = 0; iCounter < 9; iCounter++ ) for( iCounter = 0; iCounter < 36; iCounter++ )
{ {
// grab current sector value // grab current sector value
sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) ); sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) );
@@ -6157,10 +6160,14 @@ void DrawTownMilitiaName( void )
mprintf( sX, sY, sString ); mprintf( sX, sY, sString );
// might as well show the unassigned string // might as well show the unassigned string
swprintf( sString, L"%s %s", pTownNames[ sSelectedMilitiaTown ], pMilitiaString[ 1 ] ); swprintf( sString, L"%s", pMilitiaString[ 1 ] );
FindFontCenterCoordinates( MAP_MILITIA_BOX_POS_X, MAP_MILITIA_BOX_POS_Y + MILITIA_BOX_UNASSIGNED_TEXT_OFFSET_Y, MILITIA_BOX_WIDTH, GetFontHeight( FONT10ARIAL ), sString, FONT10ARIAL, &sX, &sY ); FindFontCenterCoordinates( MAP_MILITIA_BOX_POS_X, MAP_MILITIA_BOX_POS_Y + MILITIA_BOX_UNASSIGNED_TEXT_OFFSET_Y, MILITIA_BOX_WIDTH, GetFontHeight( FONT10ARIAL ), sString, FONT10ARIAL, &sX, &sY );
mprintf( sX, sY, sString ); mprintf( sX, sY, sString );
// show the amount of unassigned militia
swprintf( sString, L"(%d/%d/%d/%d)", sGreensOnCursor, sRegularsOnCursor, sElitesOnCursor, sGreensOnCursor + sRegularsOnCursor + sElitesOnCursor );
mprintf( MAP_MILITIA_BOX_POS_X + MAP_MILITIA_MAP_X, MAP_MILITIA_BOX_POS_Y + MILITIA_BOX_UNASSIGNED_TEXT_OFFSET_Y, sString );
return; return;
} }
@@ -6261,6 +6268,67 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen3");
return; return;
} }
void HandleRemovalOfAllTroopsAmongstSectors( void )
{
// even out troops among the town
INT32 iCounter = 0, iNumberUnderControl = 0, iNumberOfGreens = 0, iNumberOfRegulars = 0, iNumberOfElites = 0;
INT32 iNumberLeftOverGreen = 0, iNumberLeftOverRegular = 0, iNumberLeftOverElite = 0;
INT16 sBaseSectorValue = 0, sCurrentSectorValue = 0;
INT16 sSectorX = 0, sSectorY = 0;
// how many sectors in the selected town do we control?
iNumberUnderControl = GetTownSectorsUnderControl( ( INT8 ) sSelectedMilitiaTown );
// if none, there's nothing to be done!
if( !iNumberUnderControl )
{
return;
}
// get the sector value for the upper left corner
sBaseSectorValue = GetBaseSectorForCurrentTown( );
// render icons for map
for( iCounter = 0; iCounter < 36; iCounter++ )
{
// grab current sector value
sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) );
sSectorX = SECTORX( sCurrentSectorValue );
sSectorY = SECTORY( sCurrentSectorValue );
// skip sectors not in the selected town (nearby other towns or wilderness SAM Sites)
if( GetTownIdForSector( sSectorX, sSectorY ) != sSelectedMilitiaTown )
{
continue;
}
if( !StrategicMap[ CALCULATE_STRATEGIC_INDEX( sSectorX, sSectorY ) ].fEnemyControlled )
{
// get number of each
iNumberOfGreens += SectorInfo[ sCurrentSectorValue ].ubNumberOfCivsAtLevel[ GREEN_MILITIA ];
iNumberOfRegulars += SectorInfo[ sCurrentSectorValue ].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ];
iNumberOfElites += SectorInfo[ sCurrentSectorValue ].ubNumberOfCivsAtLevel[ ELITE_MILITIA ];
//zero out all numbers in sectors
SectorInfo[ sCurrentSectorValue ].ubNumberOfCivsAtLevel[ GREEN_MILITIA ] = 0;
SectorInfo[ sCurrentSectorValue ].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ] = 0;
SectorInfo[ sCurrentSectorValue ].ubNumberOfCivsAtLevel[ ELITE_MILITIA ] = 0;
}
}
// now add to those on the cursor
sGreensOnCursor += iNumberOfGreens;
sRegularsOnCursor += iNumberOfRegulars;
sElitesOnCursor += iNumberOfElites;
if( ( sGreensOnCursor > 0 ) || ( sRegularsOnCursor > 0 ) || ( sElitesOnCursor > 0 ) )
SpecifyButtonText( giMapMilitiaButton[ 4 ], pMilitiaButtonString[ 2 ] );
return;
}
void HandleEveningOutOfTroopsAmongstSectors( void ) void HandleEveningOutOfTroopsAmongstSectors( void )
{ {
INT32 iMaxMilitiaPerSector = gGameExternalOptions.iMaxMilitiaPerSector; INT32 iMaxMilitiaPerSector = gGameExternalOptions.iMaxMilitiaPerSector;
@@ -6287,7 +6355,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen4");
sBaseSectorValue = GetBaseSectorForCurrentTown( ); sBaseSectorValue = GetBaseSectorForCurrentTown( );
// render icons for map // render icons for map
for( iCounter = 0; iCounter < 9; iCounter++ ) for( iCounter = 0; iCounter < 36; iCounter++ )
{ {
// grab current sector value // grab current sector value
sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) ); sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) );
@@ -6388,6 +6456,8 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen4");
sRegularsOnCursor = 0; sRegularsOnCursor = 0;
sElitesOnCursor = 0; sElitesOnCursor = 0;
SpecifyButtonText( giMapMilitiaButton[ 4 ], pMilitiaButtonString[ 1 ] );
return; return;
} }
@@ -6398,16 +6468,19 @@ void CreateMilitiaPanelBottomButton( void )
{ {
giMapMilitiaButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\militia.sti" ,-1,1,-1,2,-1 ); giMapMilitiaButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\militia.sti" ,-1,1,-1,2,-1 );
giMapMilitiaButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\militia.sti" ,-1,1,-1,2,-1 ); giMapMilitiaButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\militia.sti" ,-1,1,-1,2,-1 );
giMapMilitiaButtonImage[ 5 ]= LoadButtonImage( "INTERFACE\\militia.sti" ,-1,1,-1,2,-1 );
} }
else if (iResolution < _1024x768) else if (iResolution < _1024x768)
{ {
giMapMilitiaButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\militia_800x600.sti" ,-1,1,-1,2,-1 ); giMapMilitiaButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\militia_800x600.sti" ,-1,1,-1,2,-1 );
giMapMilitiaButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\militia_800x600.sti" ,-1,1,-1,2,-1 ); giMapMilitiaButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\militia_800x600.sti" ,-1,1,-1,2,-1 );
giMapMilitiaButtonImage[ 5 ]= LoadButtonImage( "INTERFACE\\militia_800x600.sti" ,-1,1,-1,2,-1 );
} }
else else
{ {
giMapMilitiaButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\militia_1024x768.sti" ,-1,1,-1,2,-1 ); giMapMilitiaButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\militia_1024x768.sti" ,-1,1,-1,2,-1 );
giMapMilitiaButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\militia_1024x768.sti" ,-1,1,-1,2,-1 ); giMapMilitiaButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\militia_1024x768.sti" ,-1,1,-1,2,-1 );
giMapMilitiaButtonImage[ 5 ]= LoadButtonImage( "INTERFACE\\militia_1024x768.sti" ,-1,1,-1,2,-1 );
} }
giMapMilitiaButton[ 3 ] = QuickCreateButton( giMapMilitiaButtonImage[ 3 ], MAP_MILITIA_BOX_POS_X + MAP_MILITIA_BOX_AUTO_BOX_X, MAP_MILITIA_BOX_POS_Y + MAP_MILITIA_BOX_AUTO_BOX_Y, giMapMilitiaButton[ 3 ] = QuickCreateButton( giMapMilitiaButtonImage[ 3 ], MAP_MILITIA_BOX_POS_X + MAP_MILITIA_BOX_AUTO_BOX_X, MAP_MILITIA_BOX_POS_Y + MAP_MILITIA_BOX_AUTO_BOX_Y,
@@ -6418,6 +6491,10 @@ void CreateMilitiaPanelBottomButton( void )
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1, BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK) MilitiaDoneButtonCallback ); BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK) MilitiaDoneButtonCallback );
giMapMilitiaButton[ 5 ] = QuickCreateButton( giMapMilitiaButtonImage[ 3 ], MAP_MILITIA_BOX_POS_X + MAP_MILITIA_BOX_REMOVE_BOX_X, MAP_MILITIA_BOX_POS_Y + MAP_MILITIA_BOX_AUTO_BOX_Y,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK) MilitiaRemoveButtonCallback );
SpecifyButtonFont( giMapMilitiaButton[ 3 ], FONT10ARIAL ); SpecifyButtonFont( giMapMilitiaButton[ 3 ], FONT10ARIAL );
SpecifyButtonUpTextColors( giMapMilitiaButton[ 3 ], FONT_BLACK, FONT_BLACK ); SpecifyButtonUpTextColors( giMapMilitiaButton[ 3 ], FONT_BLACK, FONT_BLACK );
@@ -6427,8 +6504,13 @@ void CreateMilitiaPanelBottomButton( void )
SpecifyButtonUpTextColors( giMapMilitiaButton[ 4 ], FONT_BLACK, FONT_BLACK ); SpecifyButtonUpTextColors( giMapMilitiaButton[ 4 ], FONT_BLACK, FONT_BLACK );
SpecifyButtonDownTextColors( giMapMilitiaButton[ 4 ], FONT_BLACK, FONT_BLACK ); SpecifyButtonDownTextColors( giMapMilitiaButton[ 4 ], FONT_BLACK, FONT_BLACK );
SpecifyButtonFont( giMapMilitiaButton[ 5 ], FONT10ARIAL );
SpecifyButtonUpTextColors( giMapMilitiaButton[ 5 ], FONT_BLACK, FONT_BLACK );
SpecifyButtonDownTextColors( giMapMilitiaButton[ 5 ], FONT_BLACK, FONT_BLACK );
SpecifyButtonText( giMapMilitiaButton[ 3 ], pMilitiaButtonString[ 0 ] ); SpecifyButtonText( giMapMilitiaButton[ 3 ], pMilitiaButtonString[ 0 ] );
SpecifyButtonText( giMapMilitiaButton[ 4 ], pMilitiaButtonString[ 1 ] ); SpecifyButtonText( giMapMilitiaButton[ 4 ], pMilitiaButtonString[ 1 ] );
SpecifyButtonText( giMapMilitiaButton[ 5 ], pMilitiaButtonString[ 3 ] );
// AUTO button help // AUTO button help
SetButtonFastHelpText( giMapMilitiaButton[ 3 ], pMilitiaButtonsHelpText[ 3 ] ); SetButtonFastHelpText( giMapMilitiaButton[ 3 ], pMilitiaButtonsHelpText[ 3 ] );
@@ -6451,9 +6533,11 @@ void DeleteMilitiaPanelBottomButton( void )
// delete militia panel bottom // delete militia panel bottom
RemoveButton( giMapMilitiaButton[ 3 ] ); RemoveButton( giMapMilitiaButton[ 3 ] );
RemoveButton( giMapMilitiaButton[ 4 ] ); RemoveButton( giMapMilitiaButton[ 4 ] );
RemoveButton( giMapMilitiaButton[ 5 ] );
UnloadButtonImage( giMapMilitiaButtonImage[ 3 ] ); UnloadButtonImage( giMapMilitiaButtonImage[ 3 ] );
UnloadButtonImage( giMapMilitiaButtonImage[ 4 ] ); UnloadButtonImage( giMapMilitiaButtonImage[ 4 ] );
UnloadButtonImage( giMapMilitiaButtonImage[ 5 ] );
if( sSelectedMilitiaTown != 0 ) if( sSelectedMilitiaTown != 0 )
{ {
@@ -6523,6 +6607,26 @@ void MilitiaDoneButtonCallback(GUI_BUTTON *btn,INT32 reason)
return; return;
} }
void MilitiaRemoveButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
{
btn->uiFlags|=(BUTTON_CLICKED_ON);
}
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
{
if( btn->uiFlags & BUTTON_CLICKED_ON )
{
btn->uiFlags &= ~( BUTTON_CLICKED_ON );
// remove all troops to pool
HandleRemovalOfAllTroopsAmongstSectors( );
fMapPanelDirty = TRUE;
}
}
return;
}
void RenderShadingForUnControlledSectors( void ) void RenderShadingForUnControlledSectors( void )
{ {
@@ -6535,7 +6639,7 @@ void RenderShadingForUnControlledSectors( void )
sBaseSectorValue = GetBaseSectorForCurrentTown( ); sBaseSectorValue = GetBaseSectorForCurrentTown( );
// render icons for map // render icons for map
for( iCounter = 0; iCounter < 9; iCounter++ ) for( iCounter = 0; iCounter < 36; iCounter++ )
{ {
// grab current sector value // grab current sector value
sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) ); sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) );
@@ -7390,7 +7494,7 @@ BOOLEAN CanMilitiaAutoDistribute( void )
sBaseSectorValue = GetBaseSectorForCurrentTown( ); sBaseSectorValue = GetBaseSectorForCurrentTown( );
// render icons for map // render icons for map
for( iCounter = 0; iCounter < 9; iCounter++ ) for( iCounter = 0; iCounter < 36; iCounter++ )
{ {
// grab current sector value // grab current sector value
sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) ); sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) );
@@ -7713,7 +7817,7 @@ BOOLEAN CanRedistributeMilitiaInSector( INT16 sClickedSectorX, INT16 sClickedSec
sBaseSectorValue = sBaseSectorList[ bClickedTownId - 1 ]; sBaseSectorValue = sBaseSectorList[ bClickedTownId - 1 ];
// render icons for map // render icons for map
for( iCounter = 0; iCounter < 9; iCounter++ ) for( iCounter = 0; iCounter < 36; iCounter++ )
{ {
// grab current sector value // grab current sector value
sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) ); sCurrentSectorValue = sBaseSectorValue + ( ( iCounter % MILITIA_BOX_ROWS ) + ( iCounter / MILITIA_BOX_ROWS ) * ( 16 ) );
+7 -5
View File
@@ -1677,7 +1677,8 @@ STR16 pMilitiaButtonString[] =
{ {
L"自动", // auto place the militia troops for the player L"自动", // auto place the militia troops for the player
L"完成", // done placing militia troops L"完成", // done placing militia troops
L"解散", // L"Disband", // HEADROCK HAM 3.6: Disband militia L"解散", // HEADROCK HAM 3.6: Disband militia
L"Unassign All", // move all milita troops to unassigned pool // TODO.Translate
}; };
STR16 pConditionStrings[] = STR16 pConditionStrings[] =
@@ -5742,12 +5743,13 @@ STR16 pDoctorWarningString[] =
L"你的医生不能包扎完每个人。", L"你的医生不能包扎完每个人。",
}; };
// TODO.Translate
STR16 pMilitiaButtonsHelpText[] = STR16 pMilitiaButtonsHelpText[] =
{ {
L"调离(右击)/安置(左击)新兵", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nGreen Troops", // button help text informing player they can pick up or drop militia with this button
L"调离(右击)/安置(左击)老兵", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nRegular Troops",
L"调离(右击)/安置(左击)精兵", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nVeteran Troops",
L"在各个分区平均分布民兵", L"Distribute available militia equally among all sectors",
}; };
STR16 pMapScreenJustStartedHelpText[] = STR16 pMapScreenJustStartedHelpText[] =
+6 -4
View File
@@ -1674,6 +1674,7 @@ STR16 pMilitiaButtonString[] =
L"Auto", // auto place the militia troops for the player L"Auto", // auto place the militia troops for the player
L"OK", // done placing militia troops L"OK", // done placing militia troops
L"Disband", // HEADROCK HAM 3.6: Disband militia // TODO.Translate L"Disband", // HEADROCK HAM 3.6: Disband militia // TODO.Translate
L"Unassign All", // move all milita troops to unassigned pool // TODO.Translate
}; };
STR16 pConditionStrings[] = STR16 pConditionStrings[] =
@@ -5752,12 +5753,13 @@ STR16 pDoctorWarningString[] =
L"Je medici waren niet in staat om iedereen te verbinden.", L"Je medici waren niet in staat om iedereen te verbinden.",
}; };
// TODO.Translate
STR16 pMilitiaButtonsHelpText[] = STR16 pMilitiaButtonsHelpText[] =
{ {
L"Raap op(Klik Rechts)/drop(Klik links) Groene Troepen", // button help text informing player they can pick up or drop militia with this button L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nGreen Troops", // button help text informing player they can pick up or drop militia with this button
L"Raap op(Klik Rechts)/drop(Klik links) Normale Troepen", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nRegular Troops",
L"Raap op(Klik Rechts)/drop(Klik links) Veteranentroepen", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nVeteran Troops",
L"Verspreidt beschikbare milities evenredig over alle sectoren", L"Distribute available militia equally among all sectors",
}; };
STR16 pMapScreenJustStartedHelpText[] = STR16 pMapScreenJustStartedHelpText[] =
+4 -3
View File
@@ -1678,6 +1678,7 @@ STR16 pMilitiaButtonString[] =
L"Auto", // auto place the militia troops for the player L"Auto", // auto place the militia troops for the player
L"Done", // done placing militia troops L"Done", // done placing militia troops
L"Disband", // HEADROCK HAM 3.6: Disband militia L"Disband", // HEADROCK HAM 3.6: Disband militia
L"Unassign All", // move all milita troops to unassigned pool
}; };
STR16 pConditionStrings[] = STR16 pConditionStrings[] =
@@ -5744,9 +5745,9 @@ STR16 pDoctorWarningString[] =
STR16 pMilitiaButtonsHelpText[] = STR16 pMilitiaButtonsHelpText[] =
{ {
L"Pick up(Right Click)/drop(Left Click) Green Troops", // button help text informing player they can pick up or drop militia with this button L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nGreen Troops", // button help text informing player they can pick up or drop militia with this button
L"Pick up(Right Click)/drop(Left Click) Regular Troops", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nRegular Troops",
L"Pick up(Right Click)/drop(Left Click) Veteran Troops", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nVeteran Troops",
L"Distribute available militia equally among all sectors", L"Distribute available militia equally among all sectors",
}; };
+6 -4
View File
@@ -1682,6 +1682,7 @@ STR16 pMilitiaButtonString[] =
L"Auto", // auto place the militia troops for the player L"Auto", // auto place the militia troops for the player
L"OK", // done placing militia troops L"OK", // done placing militia troops
L"Démobiliser", // HEADROCK HAM 3.6: Disband militia L"Démobiliser", // HEADROCK HAM 3.6: Disband militia
L"Unassign All", // move all milita troops to unassigned pool // TODO.Translate
}; };
STR16 pConditionStrings[] = STR16 pConditionStrings[] =
@@ -5747,12 +5748,13 @@ STR16 pDoctorWarningString[] =
L"Impossible de soigner tout le monde.", L"Impossible de soigner tout le monde.",
}; };
// TODO.Translate
STR16 pMilitiaButtonsHelpText[] = STR16 pMilitiaButtonsHelpText[] =
{ {
L"Prendre (Clic droit)/poser (Clic gauche) Miliciens", // button help text informing player they can pick up or drop militia with this button L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nGreen Troops", // button help text informing player they can pick up or drop militia with this button
L"Prendre (Clic droit)/poser (Clic gauche) Soldats", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nRegular Troops",
L"Prendre (Clic droit)/poser (Clic gauche) Vétérans", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nVeteran Troops",
L"Répartition automatique", L"Distribute available militia equally among all sectors",
}; };
STR16 pMapScreenJustStartedHelpText[] = STR16 pMapScreenJustStartedHelpText[] =
+5 -4
View File
@@ -1685,6 +1685,7 @@ STR16 pMilitiaButtonString[] =
L"Autom.", // auto place the militia troops for the player L"Autom.", // auto place the militia troops for the player
L"Fertig", // done placing militia troops L"Fertig", // done placing militia troops
L"Auflösen", // HEADROCK HAM 3.6: Disband militia L"Auflösen", // HEADROCK HAM 3.6: Disband militia
L"Zuordnungen aufh.", // move all milita troops to unassigned pool // TODO.Translate
}; };
STR16 pConditionStrings[] = STR16 pConditionStrings[] =
@@ -5586,10 +5587,10 @@ STR16 pDoctorWarningString[] =
STR16 pMilitiaButtonsHelpText[] = STR16 pMilitiaButtonsHelpText[] =
{ {
L"Grüne Miliz aufnehmen(Rechtsklick)/absetzen(Linksklick)", // button help text informing player they can pick up or drop militia with this button L"Zuordnung auflösen (|R|e|c|h|t|s |K|l|i|c|k)\Zuordnen (|L|i|n|k|s |K|l|i|c|k)\nGrüne Miliz", // button help text informing player they can pick up or drop militia with this button
L"Reguläre Milizen aufnehmen(Rechtsklick)/absetzen(Linksklick)", L"Zuordnung auflösen (|R|e|c|h|t|s |K|l|i|c|k)\Zuordnen (|L|i|n|k|s |K|l|i|c|k)\nReguläre Miliz",
L"Elitemilizen aufnehmen(Rechtsklick)/absetzen(Linksklick)", L"Zuordnung auflösen (|R|e|c|h|t|s |K|l|i|c|k)\Zuordnen (|L|i|n|k|s |K|l|i|c|k)\nElite Miliz",
L"Milizen gleichmäßig über alle Sektoren verteilen", L"Verteile Miliz gleichwertig über alle Sektoren",
}; };
STR16 pMapScreenJustStartedHelpText[] = STR16 pMapScreenJustStartedHelpText[] =
+6 -4
View File
@@ -1670,6 +1670,7 @@ STR16 pMilitiaButtonString[] =
L"Auto", // auto place the militia troops for the player L"Auto", // auto place the militia troops for the player
L"Eseguito", // done placing militia troops L"Eseguito", // done placing militia troops
L"Disband", // HEADROCK HAM 3.6: Disband militia // TODO.Translate L"Disband", // HEADROCK HAM 3.6: Disband militia // TODO.Translate
L"Unassign All", // move all milita troops to unassigned pool // TODO.Translate
}; };
STR16 pConditionStrings[] = STR16 pConditionStrings[] =
@@ -5736,12 +5737,13 @@ STR16 pDoctorWarningString[] =
L"I vostri medici non sono riusciti a bendare completamente tutti.", L"I vostri medici non sono riusciti a bendare completamente tutti.",
}; };
// TODO.Translate
STR16 pMilitiaButtonsHelpText[] = STR16 pMilitiaButtonsHelpText[] =
{ {
L"Raccogli (Clicca di destro)/lascia (Clicca di sinistro) le truppe verdi", // button help text informing player they can pick up or drop militia with this button L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nGreen Troops", // button help text informing player they can pick up or drop militia with this button
L"Raccogli (Clicca di destro)/lascia (Clicca di sinistro) le truppe regolari", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nRegular Troops",
L"Raccogli (Clicca di destro)/lascia (Clicca di sinistro) le truppe veterane", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nVeteran Troops",
L"Distribuisci equamente i soldati disponibili tra i vari settori", L"Distribute available militia equally among all sectors",
}; };
STR16 pMapScreenJustStartedHelpText[] = STR16 pMapScreenJustStartedHelpText[] =
+6 -4
View File
@@ -1686,6 +1686,7 @@ STR16 pMilitiaButtonString[] =
L"Automatyczne", // auto place the militia troops for the player L"Automatyczne", // auto place the militia troops for the player
L"OK", // done placing militia troops L"OK", // done placing militia troops
L"Rozwiąż", // HEADROCK HAM 3.6: Disband militia L"Rozwiąż", // HEADROCK HAM 3.6: Disband militia
L"Unassign All", // move all milita troops to unassigned pool // TODO.Translate
}; };
STR16 pConditionStrings[] = STR16 pConditionStrings[] =
@@ -5752,12 +5753,13 @@ STR16 pDoctorWarningString[] =
L"Lekarze nie mogli opatrzyć wszystkich rannych.", L"Lekarze nie mogli opatrzyć wszystkich rannych.",
}; };
// TODO.Translate
STR16 pMilitiaButtonsHelpText[] = STR16 pMilitiaButtonsHelpText[] =
{ {
L"Podnieś(Prawy klawisz myszy)/upuść(Lewy klawisz myszy) Zielonych żołnierzy", // button help text informing player they can pick up or drop militia with this button L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nGreen Troops", // button help text informing player they can pick up or drop militia with this button
L"Podnieś(Prawy klawisz myszy)/upuść(Lewy klawisz myszy) Doświadczonych żołnierzy", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nRegular Troops",
L"Podnieś(Prawy klawisz myszy)/upuść(Lewy klawisz myszy) Weteranów", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nVeteran Troops",
L"Umieszcza jednakową ilość żołnierzy samoobrony w każdym sektorze.", L"Distribute available militia equally among all sectors",
}; };
STR16 pMapScreenJustStartedHelpText[] = STR16 pMapScreenJustStartedHelpText[] =
+6 -4
View File
@@ -1678,6 +1678,7 @@ STR16 pMilitiaButtonString[] =
L"Авто", // auto place the militia troops for the player L"Авто", // auto place the militia troops for the player
L"Готово", // done placing militia troops L"Готово", // done placing militia troops
L"Распустить", // HEADROCK HAM 3.6: Disband militia //Disband L"Распустить", // HEADROCK HAM 3.6: Disband militia //Disband
L"Unassign All", // move all milita troops to unassigned pool // TODO.Translate
}; };
STR16 pConditionStrings[] = STR16 pConditionStrings[] =
@@ -5741,12 +5742,13 @@ STR16 pDoctorWarningString[] =
L"Ваши медики не могут оказать первую помощь всем раненым.", L"Ваши медики не могут оказать первую помощь всем раненым.",
}; };
// TODO.Translate
STR16 pMilitiaButtonsHelpText[] = STR16 pMilitiaButtonsHelpText[] =
{ {
L"Уменьшить (правя кнопка)\nУвеличить (левая кнопка)\nчисло новобранцев", // button help text informing player they can pick up or drop militia with this button L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nGreen Troops", // button help text informing player they can pick up or drop militia with this button
L"Уменьшить (правая кнопка)\nУвеличить (левая кнопка)\nчисло рядовых", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nRegular Troops",
L"Уменьшить (правая кнопка)\nУвеличить (левая кнопка)\nчисло элитных солдат", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nVeteran Troops",
L"Равномерно распределить\nополченцев по всем секторам.", L"Distribute available militia equally among all sectors",
}; };
STR16 pMapScreenJustStartedHelpText[] = STR16 pMapScreenJustStartedHelpText[] =
+6 -4
View File
@@ -1677,7 +1677,8 @@ STR16 pMilitiaButtonString[] =
{ {
L"Auto", // auto place the militia troops for the player L"Auto", // auto place the militia troops for the player
L"Done", // done placing militia troops L"Done", // done placing militia troops
L"Disband", // HEADROCK HAM 3.6: Disband militia // TODO.Translate L"Disband", // HEADROCK HAM 3.6: Disband militia
L"Unassign All", // move all milita troops to unassigned pool
}; };
STR16 pConditionStrings[] = STR16 pConditionStrings[] =
@@ -5755,11 +5756,12 @@ STR16 pDoctorWarningString[] =
L"Your medics were unable to completely bandage everyone.", L"Your medics were unable to completely bandage everyone.",
}; };
// TODO.Translate
STR16 pMilitiaButtonsHelpText[] = STR16 pMilitiaButtonsHelpText[] =
{ {
L"Pick up(Right Click)/drop(Left Click) Green Troops", // button help text informing player they can pick up or drop militia with this button L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nGreen Troops", // button help text informing player they can pick up or drop militia with this button
L"Pick up(Right Click)/drop(Left Click) Regular Troops", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nRegular Troops",
L"Pick up(Right Click)/drop(Left Click) Veteran Troops", L"Unassign (|R|i|g|h|t |C|l|i|c|k)\nAssign (|L|e|f|t |C|l|i|c|k)\nVeteran Troops",
L"Distribute available militia equally among all sectors", L"Distribute available militia equally among all sectors",
}; };