equal
deleted
inserted
replaced
21 #include "newgrf_text.h" |
21 #include "newgrf_text.h" |
22 #include "table/control_codes.h" |
22 #include "table/control_codes.h" |
23 #include "music.h" |
23 #include "music.h" |
24 #include "date.h" |
24 #include "date.h" |
25 #include "industry.h" |
25 #include "industry.h" |
|
26 #include "fileio.h" |
26 #include "helpers.hpp" |
27 #include "helpers.hpp" |
27 #include "cargotype.h" |
28 #include "cargotype.h" |
28 #include "group.h" |
29 #include "group.h" |
29 #include "debug.h" |
30 #include "debug.h" |
30 |
31 |
1099 return s; |
1100 return s; |
1100 } |
1101 } |
1101 } |
1102 } |
1102 } |
1103 } |
1103 |
1104 |
|
1105 #ifdef ENABLE_NETWORK |
1104 extern void SortNetworkLanguages(); |
1106 extern void SortNetworkLanguages(); |
|
1107 #else /* ENABLE_NETWORK */ |
|
1108 static inline void SortNetworkLanguages() {} |
|
1109 #endif /* ENABLE_NETWORK */ |
1105 extern void SortTownGeneratorNames(); |
1110 extern void SortTownGeneratorNames(); |
1106 |
1111 |
1107 bool ReadLanguagePack(int lang_index) |
1112 bool ReadLanguagePack(int lang_index) |
1108 { |
1113 { |
1109 int tot_count, i; |
1114 int tot_count, i; |
1289 * Make a list of the available language packs. put the data in |
1294 * Make a list of the available language packs. put the data in |
1290 * _dynlang struct. |
1295 * _dynlang struct. |
1291 */ |
1296 */ |
1292 void InitializeLanguagePacks() |
1297 void InitializeLanguagePacks() |
1293 { |
1298 { |
|
1299 Searchpath sp; |
1294 Language files[MAX_LANG]; |
1300 Language files[MAX_LANG]; |
1295 uint language_count = GetLanguageList(files, 0, lengthof(files), _paths.lang_dir); |
1301 uint language_count = 0; |
|
1302 |
|
1303 FOR_ALL_SEARCHPATHS(sp) { |
|
1304 char path[MAX_PATH]; |
|
1305 FioAppendDirectory(path, lengthof(path), sp, LANG_DIR); |
|
1306 language_count += GetLanguageList(files, language_count, lengthof(files), path); |
|
1307 } |
1296 if (language_count == 0) error("No available language packs (invalid versions?)"); |
1308 if (language_count == 0) error("No available language packs (invalid versions?)"); |
1297 |
1309 |
1298 /* Sort the language names alphabetically */ |
1310 /* Sort the language names alphabetically */ |
1299 qsort(files, language_count, sizeof(Language), LanguageCompareFunc); |
1311 qsort(files, language_count, sizeof(Language), LanguageCompareFunc); |
1300 |
1312 |