From 3b219565d34c2a93e51184810bfc1d9055264450 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Tue, 24 Oct 2017 22:36:59 +0200 Subject: [PATCH] Enabled import for translations by default (#2535) Added possibility to override MAP_MAX_MSG with defines_pre.h Added possibility to override LANG_ENABLE with defines_pre.h Thanks to @Daegaladh for the idea with LANG_ENABLE. --- conf/msg_conf/map_msg.conf | 2 +- conf/msg_conf/map_msg_chn.conf | 2 +- conf/msg_conf/map_msg_frn.conf | 2 +- conf/msg_conf/map_msg_idn.conf | 2 +- conf/msg_conf/map_msg_por.conf | 2 +- conf/msg_conf/map_msg_rus.conf | 2 +- conf/msg_conf/map_msg_spn.conf | 2 +- conf/msg_conf/map_msg_tha.conf | 2 +- src/common/msg_conf.h | 13 +++++++++---- src/map/map.cpp | 4 +++- 10 files changed, 20 insertions(+), 13 deletions(-) diff --git a/conf/msg_conf/map_msg.conf b/conf/msg_conf/map_msg.conf index 2aaad96344..f95c7905a6 100644 --- a/conf/msg_conf/map_msg.conf +++ b/conf/msg_conf/map_msg.conf @@ -1668,4 +1668,4 @@ 1504: You've entered a PK Zone (safe until level %d). //Custom translations -//import: conf/msg_conf/import/map_msg_eng_conf.txt +import: conf/msg_conf/import/map_msg_eng_conf.txt diff --git a/conf/msg_conf/map_msg_chn.conf b/conf/msg_conf/map_msg_chn.conf index 76c5420bb0..3c41d9ebaa 100644 --- a/conf/msg_conf/map_msg_chn.conf +++ b/conf/msg_conf/map_msg_chn.conf @@ -1498,4 +1498,4 @@ 1498: You cannot create a guild because you are in a clan. //Custom translations -//import: conf/msg_conf/import/map_msg_chn_conf.txt +import: conf/msg_conf/import/map_msg_chn_conf.txt diff --git a/conf/msg_conf/map_msg_frn.conf b/conf/msg_conf/map_msg_frn.conf index fe94892bc0..b840ada28b 100644 --- a/conf/msg_conf/map_msg_frn.conf +++ b/conf/msg_conf/map_msg_frn.conf @@ -1490,4 +1490,4 @@ 1498: You cannot create a guild because you are in a clan. //Custom translations -//import: conf/msg_conf/import/map_msg_frn_conf.txt +import: conf/msg_conf/import/map_msg_frn_conf.txt diff --git a/conf/msg_conf/map_msg_idn.conf b/conf/msg_conf/map_msg_idn.conf index feee972a27..56f4be3de8 100644 --- a/conf/msg_conf/map_msg_idn.conf +++ b/conf/msg_conf/map_msg_idn.conf @@ -1606,4 +1606,4 @@ 1498: You cannot create a guild because you are in a clan. //Bila ada terjemahan lain -//import: conf/msg_conf/import/map_msg_idn_conf.txt +import: conf/msg_conf/import/map_msg_idn_conf.txt diff --git a/conf/msg_conf/map_msg_por.conf b/conf/msg_conf/map_msg_por.conf index bb533069fa..4c50bc8952 100644 --- a/conf/msg_conf/map_msg_por.conf +++ b/conf/msg_conf/map_msg_por.conf @@ -1467,4 +1467,4 @@ 1498: You cannot create a guild because you are in a clan. //Custom translations -//import: conf/msg_conf/import/map_msg_por_conf.txt +import: conf/msg_conf/import/map_msg_por_conf.txt diff --git a/conf/msg_conf/map_msg_rus.conf b/conf/msg_conf/map_msg_rus.conf index ad1e3a06f8..7db5bf6ee0 100644 --- a/conf/msg_conf/map_msg_rus.conf +++ b/conf/msg_conf/map_msg_rus.conf @@ -1490,4 +1490,4 @@ 1498: You cannot create a guild because you are in a clan. // Пользовательский перевод -//import: conf/msg_conf/import/map_msg_rus_conf.txt +import: conf/msg_conf/import/map_msg_rus_conf.txt diff --git a/conf/msg_conf/map_msg_spn.conf b/conf/msg_conf/map_msg_spn.conf index b33d445de5..ae1ad0402c 100644 --- a/conf/msg_conf/map_msg_spn.conf +++ b/conf/msg_conf/map_msg_spn.conf @@ -1470,4 +1470,4 @@ 1498: You cannot create a guild because you are in a clan. //Traducciones personalizadas -//import: conf/msg_conf/import/map_msg_spn_conf.txt +import: conf/msg_conf/import/map_msg_spn_conf.txt diff --git a/conf/msg_conf/map_msg_tha.conf b/conf/msg_conf/map_msg_tha.conf index c34d07c0a4..023d73fe0c 100644 --- a/conf/msg_conf/map_msg_tha.conf +++ b/conf/msg_conf/map_msg_tha.conf @@ -1509,4 +1509,4 @@ 1498: You cannot create a guild because you are in a clan. //Custom translations -//import: conf/msg_conf/import/map_msg_tha_conf.txt +import: conf/msg_conf/import/map_msg_tha_conf.txt diff --git a/src/common/msg_conf.h b/src/common/msg_conf.h index e10e63df1b..d1feeb1d4c 100644 --- a/src/common/msg_conf.h +++ b/src/common/msg_conf.h @@ -4,6 +4,8 @@ #ifndef MSG_CONF_H #define MSG_CONF_H +#include "../config/core.h" + #ifdef __cplusplus extern "C" { #endif @@ -20,10 +22,13 @@ enum lang_types { LANG_THA = 0x100, LANG_MAX }; -// Multilanguage System. -// Define which languages to enable (bitmask). -// 0xFFF will enable all, while 0x000 will enable English only. -#define LANG_ENABLE 0x000 + +#ifndef LANG_ENABLE + // Multilanguage System. + // Define which languages to enable (bitmask). + // 0xFFF will enable all, while 0x000 will enable English only. + #define LANG_ENABLE 0x000 +#endif //read msg in table const char* _msg_txt(int msg_number,int size, char ** msg_table); diff --git a/src/map/map.cpp b/src/map/map.cpp index 702140d56b..a3852ea51f 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -115,7 +115,9 @@ static int block_free_count = 0, block_free_lock = 0; static struct block_list *bl_list[BL_LIST_MAX]; static int bl_list_count = 0; -#define MAP_MAX_MSG 1550 +#ifndef MAP_MAX_MSG + #define MAP_MAX_MSG 1550 +#endif struct map_data map[MAX_MAP_PER_SERVER]; int map_num = 0;