summaryrefslogtreecommitdiffstats
path: root/src/core/re3.cpp
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-02-07 18:35:43 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-02-07 18:38:53 +0100
commitd224f8b7eea6142223362c13551acad623ddb4c7 (patch)
tree1ca13f2df652867700bfa402dcdfdbfdadca37c4 /src/core/re3.cpp
parentDetect joystick menu for XInput (diff)
downloadre3-d224f8b7eea6142223362c13551acad623ddb4c7.tar
re3-d224f8b7eea6142223362c13551acad623ddb4c7.tar.gz
re3-d224f8b7eea6142223362c13551acad623ddb4c7.tar.bz2
re3-d224f8b7eea6142223362c13551acad623ddb4c7.tar.lz
re3-d224f8b7eea6142223362c13551acad623ddb4c7.tar.xz
re3-d224f8b7eea6142223362c13551acad623ddb4c7.tar.zst
re3-d224f8b7eea6142223362c13551acad623ddb4c7.zip
Diffstat (limited to 'src/core/re3.cpp')
-rw-r--r--src/core/re3.cpp57
1 files changed, 56 insertions, 1 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index e631f615..720aeb46 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -85,16 +85,49 @@ mysrand(unsigned int seed)
#ifdef CUSTOM_FRONTEND_OPTIONS
#include "frontendoption.h"
+#ifdef MORE_LANGUAGES
+void LangPolSelect(int8 action)
+{
+ if (action == FEOPTION_ACTION_SELECT) {
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_POLISH;
+ FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
+ FrontEndMenuManager.InitialiseChangedLanguageSettings();
+ FrontEndMenuManager.SaveSettings();
+ }
+}
+
+void LangRusSelect(int8 action)
+{
+ if (action == FEOPTION_ACTION_SELECT) {
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_RUSSIAN;
+ FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
+ FrontEndMenuManager.InitialiseChangedLanguageSettings();
+ FrontEndMenuManager.SaveSettings();
+ }
+}
+
+void LangJapSelect(int8 action)
+{
+ if (action == FEOPTION_ACTION_SELECT) {
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_JAPANESE;
+ FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
+ FrontEndMenuManager.InitialiseChangedLanguageSettings();
+ FrontEndMenuManager.SaveSettings();
+ }
+}
+#endif
+
void
CustomFrontendOptionsPopulate(void)
{
// Moved to an array in MenuScreensCustom.cpp, but APIs are still available. see frontendoption.h
// These work only if we have neo folder, so they're dynamically added
+ int fd;
#ifdef EXTENDED_PIPELINES
const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" };
const char *off_on[] = { "FEM_OFF", "FEM_ON" };
- int fd = CFileMgr::OpenFile("neo/neo.txd","r");
+ fd = CFileMgr::OpenFile("neo/neo.txd","r");
if (fd) {
#ifdef GRAPHICS_MENU_OPTIONS
FrontendOptionSetCursor(MENUPAGE_GRAPHICS_SETTINGS, -3, false);
@@ -113,6 +146,28 @@ CustomFrontendOptionsPopulate(void)
}
#endif
+ // Add outsourced language translations, if files are found
+#ifdef MORE_LANGUAGES
+ FrontendOptionSetCursor(MENUPAGE_LANGUAGE_SETTINGS, 5, false);
+ fd = CFileMgr::OpenFile("text/polish.gxt","r");
+ if (fd) {
+ FrontendOptionAddDynamic("FEL_POL", nil, nil, LangPolSelect, nil, nil);
+ CFileMgr::CloseFile(fd);
+ }
+
+ fd = CFileMgr::OpenFile("text/russian.gxt","r");
+ if (fd) {
+ FrontendOptionAddDynamic("FEL_RUS", nil, nil, LangRusSelect, nil, nil);
+ CFileMgr::CloseFile(fd);
+ }
+
+ fd = CFileMgr::OpenFile("text/japanese.gxt","r");
+ if (fd) {
+ FrontendOptionAddDynamic("FEL_JAP", nil, nil, LangJapSelect, nil, nil);
+ CFileMgr::CloseFile(fd);
+ }
+#endif
+
}
#endif