Add russian lang support

This commit is contained in:
Sergeanur 2020-03-29 09:35:13 +03:00
parent db92864fe2
commit bb8868eba7
13 changed files with 697 additions and 515 deletions

BIN
gamefiles/JAPANESE.gxt Normal file

Binary file not shown.

BIN
gamefiles/fonts_j.txd Normal file

Binary file not shown.

BIN
gamefiles/fonts_r.txd Normal file

Binary file not shown.

BIN
gamefiles/russian.gxt Normal file

Binary file not shown.

View File

@ -1707,6 +1707,17 @@ void CMenuManager::InitialiseChangedLanguageSettings()
CTimer::Update(); CTimer::Update();
CGame::frenchGame = false; CGame::frenchGame = false;
CGame::germanGame = false; CGame::germanGame = false;
#ifdef MORE_LANGUAGES
switch (CMenuManager::m_PrefsLanguage) {
case LANGUAGE_RUSSIAN:
CFont::ReloadFonts(FONT_LANGSET_RUSSIAN);
break;
default:
CFont::ReloadFonts(FONT_LANGSET_EFIGS);
break;
}
#endif
switch (CMenuManager::m_PrefsLanguage) { switch (CMenuManager::m_PrefsLanguage) {
case LANGUAGE_FRENCH: case LANGUAGE_FRENCH:
CGame::frenchGame = true; CGame::frenchGame = true;
@ -1714,6 +1725,11 @@ void CMenuManager::InitialiseChangedLanguageSettings()
case LANGUAGE_GERMAN: case LANGUAGE_GERMAN:
CGame::germanGame = true; CGame::germanGame = true;
break; break;
#ifdef MORE_LANGUAGES
case LANGUAGE_RUSSIAN:
CGame::russianGame = true;
break;
#endif
default: default:
break; break;
} }
@ -2916,6 +2932,14 @@ CMenuManager::ProcessButtonPresses(void)
CMenuManager::InitialiseChangedLanguageSettings(); CMenuManager::InitialiseChangedLanguageSettings();
SaveSettings(); SaveSettings();
break; break;
#ifdef MORE_LANGUAGES
case MENUACTION_LANG_RUS:
m_PrefsLanguage = LANGUAGE_RUSSIAN;
m_bFrontEnd_ReloadObrTxtGxt = true;
CMenuManager::InitialiseChangedLanguageSettings();
SaveSettings();
break;
#endif
case MENUACTION_POPULATESLOTS_CHANGEMENU: case MENUACTION_POPULATESLOTS_CHANGEMENU:
PcSaveHelper.PopulateSlotInfo(); PcSaveHelper.PopulateSlotInfo();

View File

@ -51,6 +51,9 @@ enum eLanguages
LANGUAGE_GERMAN, LANGUAGE_GERMAN,
LANGUAGE_ITALIAN, LANGUAGE_ITALIAN,
LANGUAGE_SPANISH, LANGUAGE_SPANISH,
#ifdef MORE_LANGUAGES
LANGUAGE_RUSSIAN,
#endif
}; };
enum eFrontendSprites enum eFrontendSprites
@ -301,6 +304,9 @@ enum eMenuAction
MENUACTION_UNK108, MENUACTION_UNK108,
MENUACTION_UNK109, MENUACTION_UNK109,
MENUACTION_UNK110, MENUACTION_UNK110,
#ifdef MORE_LANGUAGES
MENUACTION_LANG_RUS,
#endif
}; };
enum eCheckHover enum eCheckHover

View File

@ -78,6 +78,9 @@ bool &CGame::germanGame = *(bool*)0x95CD1E;
bool &CGame::noProstitutes = *(bool*)0x95CDCF; bool &CGame::noProstitutes = *(bool*)0x95CDCF;
bool &CGame::playingIntro = *(bool*)0x95CDC2; bool &CGame::playingIntro = *(bool*)0x95CDC2;
char *CGame::aDatFile = (char*)0x773A48; char *CGame::aDatFile = (char*)0x773A48;
#ifdef MORE_LANGUAGES
bool CGame::russianGame = false;
#endif
bool bool

View File

@ -16,6 +16,9 @@ public:
static bool &nastyGame; static bool &nastyGame;
static bool &frenchGame; static bool &frenchGame;
static bool &germanGame; static bool &germanGame;
#ifdef MORE_LANGUAGES
static bool russianGame;
#endif
static bool &noProstitutes; static bool &noProstitutes;
static bool &playingIntro; static bool &playingIntro;
static char *aDatFile; //[32]; static char *aDatFile; //[32];

View File

@ -65,6 +65,9 @@ const CMenuScreen aScreens[] = {
MENUACTION_LANG_GER, "FEL_GER", SAVESLOT_NONE, MENUPAGE_NONE, MENUACTION_LANG_GER, "FEL_GER", SAVESLOT_NONE, MENUPAGE_NONE,
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
MENUACTION_LANG_RUS, "FEL_RUS", SAVESLOT_NONE, MENUPAGE_NONE,
#endif
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
}, },

View File

@ -172,6 +172,7 @@ enum Config {
#define FIX_BUGS // fixes bugs that we've came across during reversing, TODO: use this more #define FIX_BUGS // fixes bugs that we've came across during reversing, TODO: use this more
#define TOGGLEABLE_BETA_FEATURES // toggleable from debug menu. not too many things #define TOGGLEABLE_BETA_FEATURES // toggleable from debug menu. not too many things
#define MORE_LANGUAGES // Add more translations to the game
// Pad // Pad
#define XINPUT #define XINPUT

File diff suppressed because it is too large Load Diff

View File

@ -39,9 +39,23 @@ enum {
ALIGN_RIGHT, ALIGN_RIGHT,
}; };
#ifdef MORE_LANGUAGES
enum
{
FONT_LANGSET_EFIGS,
FONT_LANGSET_RUSSIAN
};
#endif
class CFont class CFont
{ {
#ifdef MORE_LANGUAGES
static int16 Size[2][3][193];
static uint8 LanguageSet;
static int32 Slot;
#else
static int16 Size[3][193]; static int16 Size[3][193];
#endif
static int16 
 static int16 

static CSprite2d *Sprite; //[3] static CSprite2d *Sprite; //[3]
public: public:
@ -136,4 +150,6 @@ public:
if(Details.alphaFade < 255.0f) if(Details.alphaFade < 255.0f)
Details.dropColor.a *= Details.alphaFade/255.0f; Details.dropColor.a *= Details.alphaFade/255.0f;
} }
static void ReloadFonts(uint8 set);
}; };

View File

@ -43,6 +43,11 @@ CText::Load(void)
case LANGUAGE_SPANISH: case LANGUAGE_SPANISH:
sprintf(filename, "SPANISH.GXT"); sprintf(filename, "SPANISH.GXT");
break; break;
#ifdef MORE_LANGUAGES
case LANGUAGE_RUSSIAN:
sprintf(filename, "RUSSIAN.GXT");
break;
#endif
} }
length = CFileMgr::LoadFile(filename, filedata, 0x40000, "rb"); length = CFileMgr::LoadFile(filename, filedata, 0x40000, "rb");