Add polish lang support

This commit is contained in:
Fire-Head 2020-04-19 22:32:59 +03:00
parent 0f07a323c9
commit 2308321805
10 changed files with 82 additions and 3 deletions

BIN
gamefiles/fonts_p.txd Normal file

Binary file not shown.

BIN
gamefiles/polish.gxt Normal file

Binary file not shown.

View File

@ -2893,6 +2893,9 @@ CMenuManager::InitialiseChangedLanguageSettings()
CGame::germanGame = false; CGame::germanGame = false;
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
switch (m_PrefsLanguage) { switch (m_PrefsLanguage) {
case LANGUAGE_POLISH:
CFont::ReloadFonts(FONT_LANGSET_POLISH);
break;
case LANGUAGE_RUSSIAN: case LANGUAGE_RUSSIAN:
CFont::ReloadFonts(FONT_LANGSET_RUSSIAN); CFont::ReloadFonts(FONT_LANGSET_RUSSIAN);
break; break;
@ -2910,6 +2913,9 @@ CMenuManager::InitialiseChangedLanguageSettings()
CGame::germanGame = true; CGame::germanGame = true;
break; break;
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
case LANGUAGE_POLISH:
CGame::polishGame = true;
break;
case LANGUAGE_RUSSIAN: case LANGUAGE_RUSSIAN:
CGame::russianGame = true; CGame::russianGame = true;
break; break;
@ -4254,6 +4260,12 @@ CMenuManager::ProcessButtonPresses(void)
SaveSettings(); SaveSettings();
break; break;
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
case MENUACTION_LANG_PL:
m_PrefsLanguage = LANGUAGE_POLISH;
m_bFrontEnd_ReloadObrTxtGxt = true;
InitialiseChangedLanguageSettings();
SaveSettings();
break;
case MENUACTION_LANG_RUS: case MENUACTION_LANG_RUS:
m_PrefsLanguage = LANGUAGE_RUSSIAN; m_PrefsLanguage = LANGUAGE_RUSSIAN;
m_bFrontEnd_ReloadObrTxtGxt = true; m_bFrontEnd_ReloadObrTxtGxt = true;
@ -5550,6 +5562,7 @@ CMenuManager::ConstructStatLine(int rowIdx)
case LANGUAGE_ITALIAN: case LANGUAGE_ITALIAN:
case LANGUAGE_SPANISH: case LANGUAGE_SPANISH:
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
case LANGUAGE_POLISH:
case LANGUAGE_RUSSIAN: case LANGUAGE_RUSSIAN:
#endif #endif
STAT_LINE("FESTDFM", &CStats::DistanceTravelledOnFoot, true, nil); STAT_LINE("FESTDFM", &CStats::DistanceTravelledOnFoot, true, nil);

View File

@ -89,6 +89,7 @@ enum eLanguages
LANGUAGE_ITALIAN, LANGUAGE_ITALIAN,
LANGUAGE_SPANISH, LANGUAGE_SPANISH,
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
LANGUAGE_POLISH,
LANGUAGE_RUSSIAN, LANGUAGE_RUSSIAN,
#endif #endif
}; };
@ -365,6 +366,7 @@ enum eMenuAction
MENUACTION_UNK109, MENUACTION_UNK109,
MENUACTION_UNK110, MENUACTION_UNK110,
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
MENUACTION_LANG_PL,
MENUACTION_LANG_RUS, MENUACTION_LANG_RUS,
#endif #endif
}; };

View File

@ -98,6 +98,7 @@ bool CGame::noProstitutes;
bool CGame::playingIntro; bool CGame::playingIntro;
char CGame::aDatFile[32]; char CGame::aDatFile[32];
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
bool CGame::polishGame = false;
bool CGame::russianGame = false; bool CGame::russianGame = false;
#endif #endif

View File

@ -18,6 +18,7 @@ public:
static bool frenchGame; static bool frenchGame;
static bool germanGame; static bool germanGame;
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
static bool polishGame;
static bool russianGame; static bool russianGame;
#endif #endif
static bool noProstitutes; static bool noProstitutes;

View File

@ -74,6 +74,7 @@ const CMenuScreen aScreens[] = {
MENUACTION_LANG_ITA, "FEL_ITA", SAVESLOT_NONE, MENUPAGE_NONE, MENUACTION_LANG_ITA, "FEL_ITA", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_LANG_SPA, "FEL_SPA", SAVESLOT_NONE, MENUPAGE_NONE, MENUACTION_LANG_SPA, "FEL_SPA", SAVESLOT_NONE, MENUPAGE_NONE,
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
MENUACTION_LANG_PL, "FEL_POL", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_LANG_RUS, "FEL_RUS", SAVESLOT_NONE, MENUPAGE_NONE, MENUACTION_LANG_RUS, "FEL_RUS", SAVESLOT_NONE, MENUPAGE_NONE,
#endif #endif
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,

View File

@ -12,7 +12,7 @@ CSprite2d CFont::Sprite[MAX_FONTS];
uint8 CFont::LanguageSet = FONT_LANGSET_EFIGS; uint8 CFont::LanguageSet = FONT_LANGSET_EFIGS;
int32 CFont::Slot = -1; int32 CFont::Slot = -1;
int16 CFont::Size[2][MAX_FONTS][193] = { int16 CFont::Size[LANGSET_MAX][MAX_FONTS][193] = {
{ {
#else #else
int16 CFont::Size[MAX_FONTS][193] = { int16 CFont::Size[MAX_FONTS][193] = {
@ -112,6 +112,56 @@ int16 CFont::Size[MAX_FONTS][193] = {
21, 32, 21, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 21, 32, 21, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 11, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 11, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19 }, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 },
},
{
{
13, 12, 31, 35, 23, 35, 31, 9, 14, 15, 25, 30, 11, 17, 13, 31,
23, 16, 22, 21, 24, 23, 23, 20, 23, 22, 10, 35, 26, 26, 26, 26,
30, 26, 24, 23, 24, 22, 21, 24, 26, 10, 20, 26, 22, 29, 26, 25,
23, 25, 24, 24, 22, 25, 24, 29, 29, 23, 25, 37, 22, 37, 35, 37,
35, 21, 22, 21, 21, 22, 13, 22, 21, 10, 16, 22, 11, 32, 21, 21,
23, 22, 16, 20, 14, 21, 20, 30, 25, 21, 21, 33, 33, 33, 33, 35,
27, 27, 27, 27, 32, 24, 23, 23, 23, 23, 11, 11, 11, 11, 26, 26,
26, 26, 26, 26, 26, 25, 26, 21, 21, 21, 21, 32, 23, 22, 22, 22,
22, 11, 11, 11, 11, 22, 22, 22, 22, 22, 22, 22, 22, 26, 21, 24,
12, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 18, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
20
},
{
13, 9, 21, 35, 23, 35, 35, 11, 35, 35, 25, 35, 11, 17, 13, 33,
28, 14, 22, 21, 24, 23, 23, 21, 23, 22, 10, 35, 13, 35, 13, 33,
5, 25, 22, 23, 24, 21, 21, 24, 24, 9, 20, 24, 21, 27, 25, 25,
22, 25, 23, 20, 23, 23, 23, 31, 23, 23, 23, 37, 33, 37, 35, 37,
35, 21, 19, 19, 21, 19, 17, 21, 21, 8, 17, 18, 14, 24, 21, 21,
20, 22, 19, 20, 20, 19, 20, 26, 21, 20, 21, 33, 33, 33, 33, 35,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
16
},
{
15, 14, 16, 25, 19, 26, 22, 11, 18, 18, 27, 26, 13, 19, 9, 27,
19, 18, 19, 19, 22, 19, 20, 18, 19, 20, 12, 32, 15, 32, 15, 35,
15, 19, 19, 19, 19, 19, 16, 19, 20, 9, 19, 20, 14, 29, 19, 20,
19, 19, 19, 19, 21, 19, 20, 32, 20, 19, 19, 33, 31, 39, 37, 39,
37, 21, 21, 21, 23, 21, 19, 23, 23, 10, 19, 20, 16, 26, 23, 23,
20, 20, 20, 22, 21, 22, 22, 26, 22, 22, 23, 35, 35, 35, 35, 37,
19, 19, 19, 19, 29, 19, 19, 19, 19, 19, 9, 9, 9, 9, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 30, 19, 19, 19, 19,
19, 10, 10, 10, 10, 19, 19, 19, 19, 19, 19, 19, 19, 19, 23, 35,
12, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 11, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19
}
} }
#endif #endif
}; };
@ -141,6 +191,9 @@ CFont::Initialise(void)
default: default:
CTxdStore::LoadTxd(slot, "MODELS/FONTS.TXD"); CTxdStore::LoadTxd(slot, "MODELS/FONTS.TXD");
break; break;
case FONT_LANGSET_POLISH:
CTxdStore::LoadTxd(slot, "MODELS/FONTS_P.TXD");
break;
case FONT_LANGSET_RUSSIAN: case FONT_LANGSET_RUSSIAN:
CTxdStore::LoadTxd(slot, "MODELS/FONTS_R.TXD"); CTxdStore::LoadTxd(slot, "MODELS/FONTS_R.TXD");
break; break;
@ -189,6 +242,9 @@ CFont::ReloadFonts(uint8 set)
default: default:
CTxdStore::LoadTxd(Slot, "MODELS/FONTS.TXD"); CTxdStore::LoadTxd(Slot, "MODELS/FONTS.TXD");
break; break;
case FONT_LANGSET_POLISH:
CTxdStore::LoadTxd(Slot, "MODELS/FONTS_P.TXD");
break;
case FONT_LANGSET_RUSSIAN: case FONT_LANGSET_RUSSIAN:
CTxdStore::LoadTxd(Slot, "MODELS/FONTS_R.TXD"); CTxdStore::LoadTxd(Slot, "MODELS/FONTS_R.TXD");
break; break;

View File

@ -44,14 +44,16 @@ enum {
enum enum
{ {
FONT_LANGSET_EFIGS, FONT_LANGSET_EFIGS,
FONT_LANGSET_RUSSIAN FONT_LANGSET_RUSSIAN,
FONT_LANGSET_POLISH,
LANGSET_MAX
}; };
#endif #endif
class CFont class CFont
{ {
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
static int16 Size[2][MAX_FONTS][193]; static int16 Size[LANGSET_MAX][MAX_FONTS][193];
static uint8 LanguageSet; static uint8 LanguageSet;
static int32 Slot; static int32 Slot;
#else #else

View File

@ -44,6 +44,9 @@ CText::Load(void)
sprintf(filename, "SPANISH.GXT"); sprintf(filename, "SPANISH.GXT");
break; break;
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
case LANGUAGE_POLISH:
sprintf(filename, "POLISH.GXT");
break;
case LANGUAGE_RUSSIAN: case LANGUAGE_RUSSIAN:
sprintf(filename, "RUSSIAN.GXT"); sprintf(filename, "RUSSIAN.GXT");
break; break;