From ba59e9fa5e6af69f7d2c9ebf7184d3c3cea84ac5 Mon Sep 17 00:00:00 2001 From: Flugente Date: Thu, 1 May 2014 20:16:19 +0000 Subject: [PATCH] skill menu entries can be translated git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7180 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/SkillMenu.cpp | 50 ++++++++++++++++++++++++++++------------ Utils/Text.h | 11 +++++++++ Utils/_ChineseText.cpp | 9 ++++++++ Utils/_DutchText.cpp | 10 ++++++++ Utils/_EnglishText.cpp | 10 ++++++++ Utils/_FrenchText.cpp | 9 ++++++++ Utils/_GermanText.cpp | 10 ++++++++ Utils/_ItalianText.cpp | 10 ++++++++ Utils/_PolishText.cpp | 10 ++++++++ Utils/_RussianText.cpp | 10 ++++++++ Utils/_TaiwaneseText.cpp | 10 ++++++++ 11 files changed, 134 insertions(+), 15 deletions(-) diff --git a/Tactical/SkillMenu.cpp b/Tactical/SkillMenu.cpp index ca1bcd7ee..936bb62f7 100644 --- a/Tactical/SkillMenu.cpp +++ b/Tactical/SkillMenu.cpp @@ -140,7 +140,7 @@ TraitSelection::Setup( UINT32 aVal ) } // cancel option - swprintf( pStr, L"Cancel" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Cancel_TraitSelection, 0 ) ); GetPopup()->addOption( *pOption ); @@ -248,7 +248,7 @@ SkillSelection::Setup( UINT32 aVal ) } // cancel option - swprintf( pStr, L"Cancel" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Cancel_SkillSelection, 0 ) ); GetPopup()->addOption( *pOption ); } @@ -354,7 +354,7 @@ ArtillerySector::Setup( UINT32 aVal ) } // cancel option - swprintf( pStr, L"Cancel" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Cancel_ArtillerySector, 0 ) ); GetPopup()->addOption( *pOption ); @@ -397,7 +397,7 @@ ArtilleryTeam::Setup( UINT32 aVal ) INT16 sSectorY = SECTORY(usSector); // order artillery from militia - swprintf( pStr, L"Militia" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_MILITIA] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_ArtilleryTeam, MILITIA_TEAM ) ); @@ -410,7 +410,7 @@ ArtilleryTeam::Setup( UINT32 aVal ) GetPopup()->addOption( *pOption ); // order artillery from our mercs - swprintf( pStr, L"Other Squads" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_OTHERSQUADS] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_ArtilleryTeam, pSoldier->bTeam ) ); @@ -423,7 +423,7 @@ ArtilleryTeam::Setup( UINT32 aVal ) GetPopup()->addOption( *pOption ); // cancel option - swprintf( pStr, L"Cancel" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Cancel_ArtilleryTeam, 0 ) ); GetPopup()->addOption( *pOption ); @@ -511,7 +511,7 @@ ReinforcementSector::Setup( UINT32 aVal ) } // cancel option - swprintf( pStr, L"Cancel" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Cancel_ReinforcementSector, 0 ) ); GetPopup()->addOption( *pOption ); } @@ -545,9 +545,9 @@ ReinforcementNumber::Setup( UINT32 aVal ) CHAR16 pStr[300]; UINT8 numberofmilitia = CountAllMilitiaInSector( SECTORX(usSector), SECTORY(usSector) ); - + // 5 militia option - swprintf( pStr, L"5 Militia" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 5 ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_ReinforcementNumber, 5 ) ); if ( numberofmilitia < 5 ) @@ -559,7 +559,7 @@ ReinforcementNumber::Setup( UINT32 aVal ) GetPopup()->addOption( *pOption ); // 10 militia option - swprintf( pStr, L"10 Militia" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 10 ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_ReinforcementNumber, 10 ) ); if ( numberofmilitia < 10 ) @@ -571,7 +571,7 @@ ReinforcementNumber::Setup( UINT32 aVal ) GetPopup()->addOption( *pOption ); // 15 militia option - swprintf( pStr, L"15 Militia" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 15 ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_ReinforcementNumber, 15 ) ); if ( numberofmilitia < 15 ) @@ -583,7 +583,7 @@ ReinforcementNumber::Setup( UINT32 aVal ) GetPopup()->addOption( *pOption ); // 20 militia option - swprintf( pStr, L"20 Militia" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 20 ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_ReinforcementNumber, 20 ) ); if ( numberofmilitia < 20 ) @@ -592,16 +592,36 @@ ReinforcementNumber::Setup( UINT32 aVal ) pOption->setAvail(new popupCallbackFunction( &Popup_OptionOff, NULL )); } + // 30 militia option + swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 30 ); + pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_ReinforcementNumber, 30 ) ); + + if ( numberofmilitia < 30 ) + { + // Set this option off. + pOption->setAvail( new popupCallbackFunction( &Popup_OptionOff, NULL ) ); + } + + // 40 militia option + swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 40 ); + pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_ReinforcementNumber, 40 ) ); + + if ( numberofmilitia < 40 ) + { + // Set this option off. + pOption->setAvail( new popupCallbackFunction( &Popup_OptionOff, NULL ) ); + } + GetPopup()->addOption( *pOption ); // all militia option - swprintf( pStr, L"All Militia" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_ALL_MILITIA] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_ReinforcementNumber, numberofmilitia ) ); GetPopup()->addOption( *pOption ); // cancel option - swprintf( pStr, L"Cancel" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Cancel_ReinforcementNumber, 0 ) ); GetPopup()->addOption( *pOption ); } @@ -680,7 +700,7 @@ SoldierSelection::Setup( UINT32 aVal ) } // cancel option - swprintf( pStr, L"Cancel" ); + swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] ); pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Cancel_SoldierSelection, 0 ) ); GetPopup()->addOption( *pOption ); } diff --git a/Utils/Text.h b/Utils/Text.h index a41ab43e4..a3a41c9d8 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -157,6 +157,17 @@ extern STR16 pMilitiaControlMenuStrings[]; //lal extern STR16 pTraitSkillsMenuStrings[]; //Flugente extern STR16 pTraitSkillsMenuDescStrings[]; //Flugente extern STR16 pTraitSkillsDenialStrings[]; //Flugente + +enum +{ + SKILLMENU_MILITIA, + SKILLMENU_OTHERSQUADS, + SKILLMENU_CANCEL, + SKILLMENU_X_MILITIA, + SKILLMENU_ALL_MILITIA, +}; + +extern STR16 pSkillMenuStrings[]; //Flugente //extern STR16 pTalkToAllMenuStrings[]; extern STR16 pSnitchMenuStrings[]; extern STR16 pSnitchMenuDescStrings[]; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 65f8dfabf..5f72158d7 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -2203,6 +2203,15 @@ STR16 pTraitSkillsDenialStrings[] = L" - 恶魔的财产", //L" - posession by a demon" }; +STR16 pSkillMenuStrings[] = // TODO.Translate +{ + L"Militia", + L"Other Squads", + L"Cancel", + L"%d Militia", + + L"All Militia", +}; STR16 pSnitchMenuStrings[] = { diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index c8c8e3033..a0cb2299e 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -2200,6 +2200,16 @@ STR16 pTraitSkillsDenialStrings[] = L" - possession by a demon", }; +STR16 pSkillMenuStrings[] = // TODO.Translate +{ + L"Militia", + L"Other Squads", + L"Cancel", + L"%d Militia", + + L"All Militia", +}; + // TODO.Translate STR16 pSnitchMenuStrings[] = { diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 3012a19d9..20879bce4 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -2204,6 +2204,16 @@ STR16 pTraitSkillsDenialStrings[] = L" - possession by a demon", }; +STR16 pSkillMenuStrings[] = +{ + L"Militia", + L"Other Squads", + L"Cancel", + L"%d Militia", + + L"All Militia", +}; + STR16 pSnitchMenuStrings[] = { // snitch diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 55be0e7a9..683eaae36 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -2207,6 +2207,15 @@ STR16 pTraitSkillsDenialStrings[] = L" - possession par un démon", }; +STR16 pSkillMenuStrings[] = // TODO.Translate +{ + L"Militia", + L"Other Squads", + L"Cancel", + L"%d Militia", + + L"All Militia", +}; STR16 pSnitchMenuStrings[] = { diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index c28321403..c5fb8656f 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -2205,6 +2205,16 @@ STR16 pTraitSkillsDenialStrings[] = L" - besessen von einem Dämon", }; +STR16 pSkillMenuStrings[] = // TODO.Translate +{ + L"Militia", + L"Other Squads", + L"Cancel", + L"%d Militia", + + L"All Militia", +}; + // TODO.Translate STR16 pSnitchMenuStrings[] = { diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 8b904bcbc..8b95cba4d 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -2196,6 +2196,16 @@ STR16 pTraitSkillsDenialStrings[] = L" - possession by a demon", }; +STR16 pSkillMenuStrings[] = // TODO.Translate +{ + L"Militia", + L"Other Squads", + L"Cancel", + L"%d Militia", + + L"All Militia", +}; + // TODO.Translate STR16 pSnitchMenuStrings[] = { diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 0e50f4bb6..66040ab43 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -2212,6 +2212,16 @@ STR16 pTraitSkillsDenialStrings[] = L" - possession by a demon", }; +STR16 pSkillMenuStrings[] = // TODO.Translate +{ + L"Militia", + L"Other Squads", + L"Cancel", + L"%d Militia", + + L"All Militia", +}; + STR16 pSnitchMenuStrings[] = { // snitch diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index af5b67d4b..0e29111ff 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -2204,6 +2204,16 @@ STR16 pTraitSkillsDenialStrings[] = L" - possession by a demon", }; +STR16 pSkillMenuStrings[] = // TODO.Translate +{ + L"Militia", + L"Other Squads", + L"Cancel", + L"%d Militia", + + L"All Militia", +}; + // TODO.Translate STR16 pSnitchMenuStrings[] = { diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index 5dafaf8c8..932823e9c 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -2204,6 +2204,16 @@ STR16 pTraitSkillsDenialStrings[] = L" - possession by a demon", }; +STR16 pSkillMenuStrings[] = // TODO.Translate +{ + L"Militia", + L"Other Squads", + L"Cancel", + L"%d Militia", + + L"All Militia", +}; + // TODO.Translate STR16 pSnitchMenuStrings[] = {