From 2080e787dd410b1d019ca7f5018979a1f2d845b5 Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 5 Mar 2018 18:23:24 +0000 Subject: [PATCH] - added translations - militia menu is always present so that the player has an easier time figuring out why he cannot do something git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8538 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 40 +++++++++++++++++++-------------------- Strategic/Assignments.h | 1 - Utils/Text.h | 3 +++ 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 +++ 11 files changed, 46 insertions(+), 22 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 31cd69dc2..351e21ff7 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -1663,20 +1663,6 @@ BOOLEAN BasicCanCharacterDrillMilitia( SOLDIERTYPE *pSoldier ) return ( TRUE ); } -BOOLEAN CanCharacterMilitiaAssignment( SOLDIERTYPE *pSoldier ) -{ - if ( CanCharacterTrainMilitia( pSoldier ) ) - return TRUE; - - if ( CanCharacterDrillMilitia( pSoldier ) ) - return TRUE; - - if ( CanCharacterDoctorMilitia( pSoldier ) ) - return TRUE; - - return FALSE; -} - BOOLEAN CanCharacterDrillMilitia( SOLDIERTYPE *pSoldier, BOOLEAN aErrorReport ) { if ( !gGameExternalOptions.fIndividualMilitia ) @@ -1684,6 +1670,9 @@ BOOLEAN CanCharacterDrillMilitia( SOLDIERTYPE *pSoldier, BOOLEAN aErrorReport ) AssertNotNIL( pSoldier ); + // Temp string. + CHAR16 sString[128]; + if ( LaptopSaveInfo.iCurrentBalance <= 0 ) { if ( aErrorReport ) @@ -1694,7 +1683,7 @@ BOOLEAN CanCharacterDrillMilitia( SOLDIERTYPE *pSoldier, BOOLEAN aErrorReport ) if ( !BasicCanCharacterDrillMilitia( pSoldier ) ) { if ( aErrorReport ) - DoScreenIndependantMessageBox( L"Assignment not possible at the moment", MSG_BOX_FLAG_OK, NULL ); + DoScreenIndependantMessageBox( Message[STR_ASSIGNMENT_NOTPOSSIBLE], MSG_BOX_FLAG_OK, NULL ); return( FALSE ); } @@ -1702,7 +1691,7 @@ BOOLEAN CanCharacterDrillMilitia( SOLDIERTYPE *pSoldier, BOOLEAN aErrorReport ) if ( NumNonPlayerTeamMembersInSector( pSoldier->sSectorX, pSoldier->sSectorY, ENEMY_TEAM ) > 0 ) { if ( aErrorReport ) - DoScreenIndependantMessageBox( L"Assignment not possible while enemies are still around.", MSG_BOX_FLAG_OK, NULL ); + DoScreenIndependantMessageBox( Message[STR_SECTOR_NOT_CLEARED], MSG_BOX_FLAG_OK, NULL ); return( FALSE ); } @@ -1710,7 +1699,11 @@ BOOLEAN CanCharacterDrillMilitia( SOLDIERTYPE *pSoldier, BOOLEAN aErrorReport ) if ( pSoldier->stats.bLeadership <= 0 ) { if ( aErrorReport ) - DoScreenIndependantMessageBox( L"Not enough leadership.", MSG_BOX_FLAG_OK, NULL ); + { + swprintf( sString, New113HAMMessage[6], pSoldier->GetName() ); + DoScreenIndependantMessageBox( sString, MSG_BOX_FLAG_OK, NULL ); + } + return ( FALSE ); } @@ -1750,7 +1743,11 @@ BOOLEAN CanCharacterDrillMilitia( SOLDIERTYPE *pSoldier, BOOLEAN aErrorReport ) if ( usEffectiveLeadership < gGameExternalOptions.ubMinimumLeadershipToTrainMilitia ) { if ( aErrorReport ) - DoScreenIndependantMessageBox( L"Not enough leadership.", MSG_BOX_FLAG_OK, NULL ); + { + swprintf( sString, New113HAMMessage[6], pSoldier->GetName() ); + DoScreenIndependantMessageBox( sString, MSG_BOX_FLAG_OK, NULL ); + } + return ( FALSE ); } } @@ -1766,7 +1763,7 @@ BOOLEAN CanCharacterDrillMilitia( SOLDIERTYPE *pSoldier, BOOLEAN aErrorReport ) } if ( aErrorReport ) - DoScreenIndependantMessageBox( L"No militia that can be trained present.", MSG_BOX_FLAG_OK, NULL ); + DoScreenIndependantMessageBox( Message[STR_ASSIGNMENT_NOMILITIAPRESENT], MSG_BOX_FLAG_OK, NULL ); return FALSE; } @@ -10036,7 +10033,7 @@ void HandleShadingOfLinesForAssignmentMenus( void ) } // militia - if ( CanCharacterMilitiaAssignment( pSoldier ) ) + if ( CanCharacterOnDuty( pSoldier ) ) { UnShadeStringInBox( ghAssignmentBox, ASSIGN_MENU_MILITIA ); } @@ -13500,7 +13497,8 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) break; case ASSIGN_MENU_MILITIA: - if ( CanCharacterMilitiaAssignment( pSoldier ) ) + // just a very basic check + if ( CanCharacterOnDuty( pSoldier ) ) { gAssignMenuState = ASMENU_NONE; diff --git a/Strategic/Assignments.h b/Strategic/Assignments.h index d7e22d022..98ad65141 100644 --- a/Strategic/Assignments.h +++ b/Strategic/Assignments.h @@ -194,7 +194,6 @@ BOOLEAN CanCharacterRepair( SOLDIERTYPE *pCharacter ); BOOLEAN CanCharacterPatient( SOLDIERTYPE *pCharacter ); // can character train militia? -BOOLEAN CanCharacterMilitiaAssignment( SOLDIERTYPE *pSoldier ); BOOLEAN CanCharacterDrillMilitia( SOLDIERTYPE *pSoldier, BOOLEAN aErrorReport = FALSE ); BOOLEAN CanCharacterTrainMilitia( SOLDIERTYPE *pCharacter ); BOOLEAN CanCharacterTrainMobileMilitia( SOLDIERTYPE *pSoldier ); diff --git a/Utils/Text.h b/Utils/Text.h index 97be48042..4ff5e71a4 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -607,6 +607,9 @@ enum STR_CLEANED, STR_CLEANED_FOR_OWNER, + STR_ASSIGNMENT_NOTPOSSIBLE, + STR_ASSIGNMENT_NOMILITIAPRESENT, + TEXT_NUM_STR_MESSAGE, }; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 1fcad2ed4..7e637ffcc 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -2361,6 +2361,9 @@ CHAR16 Message[][STRING_LENGTH] = L"%s清理了%s。", //L"%s has cleaned the %s.", L"%s清理了%s的%s。", //L"%s has cleaned %s's %s.", + + L"Assignment not possible at the moment", // TODO.Translate + L"No militia that can be drilled present.", }; // the country and its noun in the game diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 37ff955ac..672d13c32 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -2360,6 +2360,9 @@ CHAR16 Message[][STRING_LENGTH] = L"%s has cleaned the %s.", // TODO.Translate L"%s has cleaned %s's %s.", + + L"Assignment not possible at the moment", // TODO.Translate + L"No militia that can be drilled present.", }; // the country and its noun in the game diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index baefa2952..823cbadd8 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -2361,6 +2361,9 @@ CHAR16 Message[][STRING_LENGTH] = L"%s has cleaned the %s.", L"%s has cleaned %s's %s.", + + L"Assignment not possible at the moment", + L"No militia that can be drilled present.", }; // the country and its noun in the game diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 79a0dad6a..83e843b8a 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -2369,6 +2369,9 @@ CHAR16 Message[][STRING_LENGTH] = L"%s has cleaned the %s.", // TODO.Translate L"%s has cleaned %s's %s.", + + L"Assignment not possible at the moment", // TODO.Translate + L"No militia that can be drilled present.", }; // the country and its noun in the game // TODO.Translate diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index ff5f0cf0e..2bc1b131a 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -2377,6 +2377,9 @@ CHAR16 Message[][STRING_LENGTH] = L"%s hat %s gereinigt.", L"%s hat %s's %s gereinigt.", + + L"Assignment not possible at the moment", // TODO.Translate + L"No militia that can be drilled present.", }; // the country and its noun in the game diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index d4f7ea0b1..1dad9dadd 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -2355,6 +2355,9 @@ CHAR16 Message[][STRING_LENGTH] = L"%s has cleaned the %s.", // TODO.Translate L"%s has cleaned %s's %s.", + + L"Assignment not possible at the moment", // TODO.Translate + L"No militia that can be drilled present.", }; // the country and its noun in the game diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 731bb3911..976e86f78 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -2367,6 +2367,9 @@ CHAR16 Message[][STRING_LENGTH] = L"%s has cleaned the %s.", // TODO.Translate L"%s has cleaned %s's %s.", + + L"Assignment not possible at the moment", // TODO.Translate + L"No militia that can be drilled present.", }; // the country and its noun in the game diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 3b25386d9..ef8692f98 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -2361,6 +2361,9 @@ CHAR16 Message[][STRING_LENGTH] = L"%s почистил(а) %s.", // TODO.Translate L"%s почистил(а) у %s %s.", + + L"Assignment not possible at the moment", // TODO.Translate + L"No militia that can be drilled present.", }; // the country and its noun in the game