diff options
-rw-r--r-- | conf-tmpl/Changelog.txt | 3 | ||||
-rw-r--r-- | conf-tmpl/char_athena.conf | 9 | ||||
-rw-r--r-- | conf-tmpl/login_athena.conf | 9 | ||||
-rw-r--r-- | conf-tmpl/map_athena.conf | 9 | ||||
-rw-r--r-- | npc/sample/localized_npc.txt | 31 | ||||
-rw-r--r-- | src/common/showmsg.c | 7 |
6 files changed, 35 insertions, 33 deletions
diff --git a/conf-tmpl/Changelog.txt b/conf-tmpl/Changelog.txt index 6a70897e9..a713763b3 100644 --- a/conf-tmpl/Changelog.txt +++ b/conf-tmpl/Changelog.txt @@ -1,5 +1,8 @@ Date Added +2006/12/20 + * Fixed the meaning of stdout_with_ansisequence and changed the default + value to no. [FlavioJS] 2006/12/18 * Added hom_setting to specify which homunculus 'quirks' are in effect. The default activates all of them, if you set them to 0 then homuncs will not diff --git a/conf-tmpl/char_athena.conf b/conf-tmpl/char_athena.conf index 32e407c3d..d59e8d5ff 100644 --- a/conf-tmpl/char_athena.conf +++ b/conf-tmpl/char_athena.conf @@ -47,13 +47,8 @@ char_port: 6121 //For full format information, consult the strftime() manual. //timestamp_format: [%d/%b %H:%M] -//Defines if the ansi sequences should be parsed or skipped. -//If set to yes the console output is in color. If the stream is redirected to -//a file, the ansi sequences are printed out. -//If set to no the console is colorless and, if redirected, will skip the ansi -//sequences. -//NOTE: this setting applyes for both stdout and stderr -stdout_with_ansisequence: yes +//If redirected output contains escape sequences (color codes) +stdout_with_ansisequence: no //Makes server output more silent by ommitting certain types of messages: //1: Hide Information messages diff --git a/conf-tmpl/login_athena.conf b/conf-tmpl/login_athena.conf index 7a30fd9bf..fa79f4958 100644 --- a/conf-tmpl/login_athena.conf +++ b/conf-tmpl/login_athena.conf @@ -22,13 +22,8 @@ login_port: 6900 //For full format information, consult the strftime() manual. //timestamp_format: [%d/%b %H:%M] -//Defines if the ansi sequences should be parsed or skipped. -//If set to yes the console output is in color. If the stream is redirected to -//a file, the ansi sequences are printed out. -//If set to no the console is colorless and, if redirected, will skip the ansi -//sequences. -//NOTE: this setting applies for both stdout and stderr -stdout_with_ansisequence: yes +//If redirected output contains escape sequences (color codes) +stdout_with_ansisequence: no //Makes server output more silent by ommitting certain types of messages: //1: Hide Information messages diff --git a/conf-tmpl/map_athena.conf b/conf-tmpl/map_athena.conf index 59fcc1210..78ce98337 100644 --- a/conf-tmpl/map_athena.conf +++ b/conf-tmpl/map_athena.conf @@ -57,13 +57,8 @@ map_port: 5121 //For full format information, consult the strftime() manual. //timestamp_format: [%d/%b %H:%M] -//Defines if the ansi sequences should be parsed or skipped. -//If set to yes the console output is in color. If the stream is redirected to -//a file, the ansi sequences are printed out. -//If set to no the console is colorless and, if redirected, will skip the ansi -//sequences. -//NOTE: this setting applyes for both stdout and stderr -stdout_with_ansisequence: yes +//If redirected output contains escape sequences (color codes) +stdout_with_ansisequence: no //Makes server output more silent by ommitting certain types of messages: //1: Hide Information messages diff --git a/npc/sample/localized_npc.txt b/npc/sample/localized_npc.txt index 3602c2840..ab6964a07 100644 --- a/npc/sample/localized_npc.txt +++ b/npc/sample/localized_npc.txt @@ -20,14 +20,19 @@ //= Each message is identified by a string that must only
//= contain valid variable name characters.
//=
-//= void setlang(langid) - sets the player's langid
-//= int getlang() - returns the player's langid
-//= void setmes2(name,langid,text) - sets the localized text for name
-//= string getmes2(name,langid) - returns the localized text of name
-//= void mes2(name) - displays the localized text of name
+//= void setlang(int langid)
+//= - sets the player's language
+//= int getlang(void)
+//= - returns the player's language
+//= void setmes2(string name,int langid,string text)
+//= - sets the localized text for name
+//= string getmes2(string name,int langid)
+//= - returns the localized text of name
+//= void mes2(string name)
+//= - displays the localized text of name
//=
//===== Additional Comments: =================================
-//= To use this just copy the functions to Global_Functions.txt
+//= To use this globally, just put the functions in Global_Functions.txt
//============================================================
//////////////////////////////////////////////////////////////
@@ -109,18 +114,22 @@ function script mes2 { //////////////////////////////////////////////////////////////
/// Sample localized NPC
prontera.gat,155,183,4 script LocalizedNPC 705,{
+ // Get text for specific languages
set .@menu1$, callfunc("getmes2","LNPC_lang",0);
set .@menu2$, callfunc("getmes2","LNPC_lang",1);
do {
+ // get text that fallbacks to language 0
callfunc "mes2", "LNPC_name";
+ // localized mes
callfunc "mes2", "LNPC_lang";
- callfunc "mes2", "LNPC_langname";
+ callfunc "mes2", "LNPC_text";
next;
switch(select(.@menu1$,.@menu2$,"Cancel"))
{
case 1:
case 2:
+ // Set player language
callfunc "setlang",@menu-1;
break;
}
@@ -129,10 +138,14 @@ prontera.gat,155,183,4 script LocalizedNPC 705,{ end;
OnInterIfInitOnce:
+ // Load the localized text.
+ // This can be anywhere, as long as it's executed before the coresponding getmes2/mes2 calls
+ // 0 - English (default)
+ // 1 - Portuguese
callfunc "setmes2", "LNPC_name", 0, "[LocalizedNPC]";
callfunc "setmes2", "LNPC_lang", 0, "EN";
callfunc "setmes2", "LNPC_lang", 1, "PT";
- callfunc "setmes2", "LNPC_langname", 0, "English";
- callfunc "setmes2", "LNPC_langname", 1, "Português";
+ callfunc "setmes2", "LNPC_text", 0, "Something in english";
+ callfunc "setmes2", "LNPC_text", 1, "Algo em português";
end;
}
diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 4d4fcafd6..9d7395730 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -44,9 +44,10 @@ /////////////////////////////////////////////////////////////////////////////// /// behavioral parameter. -/// when true, prints ansi sequences also when redirecting outputs to file -/// otherwise remove them -int stdout_with_ansisequence = 1; +/// when redirecting output: +/// if true prints escape sequences +/// if false removes the escape sequences +int stdout_with_ansisequence = 0; int msg_silent; //Specifies how silent the console is. |