diff options
author | truebrain <truebrain@openttd.org> | 2011-12-19 21:05:46 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-19 21:05:46 +0000 |
commit | 2ae87e72131a8e88327dbb0b5b286accddafe05d (patch) | |
tree | ec755c0d0c31cbcb470d0df2625db8614efca6b2 /src/strings.cpp | |
parent | 9b6b2cabc187f3cb72a53d396418ab1b9ebd2933 (diff) | |
download | openttd-2ae87e72131a8e88327dbb0b5b286accddafe05d.tar.xz |
(svn r23634) -Add: support language files for GameScript (Rubidium)
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index 907c1e4d4..5e7809c25 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -38,6 +38,7 @@ #include "smallmap_gui.h" #include "window_func.h" #include "debug.h" +#include "game/game_text.hpp" #include <stack> #include "table/strings.h" @@ -140,6 +141,7 @@ static bool _keep_gender_data = false; ///< Should we retain the gender data in const char *GetStringPtr(StringID string) { switch (GB(string, TAB_COUNT_OFFSET, TAB_COUNT_BITS)) { + case GAME_TEXT_TAB: return GetGameStringPtr(GB(string, TAB_SIZE_OFFSET, TAB_SIZE_BITS)); /* GetGRFStringPtr doesn't handle 0xD4xx ids, we need to convert those to 0xD0xx. */ case 26: return GetStringPtr(GetGRFStringID(0, 0xD000 + GB(string, TAB_SIZE_OFFSET, 10))); case 28: return GetGRFStringPtr(GB(string, TAB_SIZE_OFFSET, TAB_SIZE_BITS)); @@ -182,6 +184,9 @@ char *GetStringWithArgs(char *buffr, StringID string, StringParameters *args, co /* Old table for custom names. This is no longer used */ error("Incorrect conversion of custom name string."); + case GAME_TEXT_TAB: + return FormatString(buffr, GetGameStringPtr(index), args, last, case_index); + case 26: /* Include string within newgrf text (format code 81) */ if (HasBit(index, 10)) { @@ -1611,6 +1616,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang) #endif /* WITH_ICU */ /* Some lists need to be sorted again after a language change. */ + ReconsiderGameScriptLanguage(); InitializeSortedCargoSpecs(); SortIndustryTypes(); BuildIndustriesLegend(); |