summaryrefslogtreecommitdiff
path: root/npc/functions/asklanguage.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/asklanguage.txt')
-rw-r--r--npc/functions/asklanguage.txt72
1 files changed, 72 insertions, 0 deletions
diff --git a/npc/functions/asklanguage.txt b/npc/functions/asklanguage.txt
new file mode 100644
index 00000000..32e0f7bc
--- /dev/null
+++ b/npc/functions/asklanguage.txt
@@ -0,0 +1,72 @@
+// TMW2 script
+// Evol functions.
+// Author:
+// Reid, Jesusalva
+// Description:
+// Function setting the player language
+
+function script languagecode {
+ switch (Lang) {
+ case LANG_PTBR:
+ return "pt_BR";
+ case LANG_FR:
+ return "fr";
+ case LANG_DE:
+ return "de";
+ case LANG_ES:
+ return "es";
+ default:
+ return "en";
+ }
+}
+
+function script asklanguage {
+
+ dispbottom col("We need help with translations. [@@help://translate|Learn more@@]", 1);
+ switch (getarg(0, LANG_IN_SHIP))
+ {
+ case LANG_ON_SEA:
+ setarray .@messages$[0], "I hear you... (English)", // English
+ "Eu te ouço... (Português)", // Portuguese
+ "Je vous entends... (Français)", // French
+ "Ich höre euch... (Deutsch)", // German
+ "Te oigo... (Español)"; // Spanish
+ break;
+ case LANG_IN_SHIP:
+ setarray .@messages$[0], "I speak English.", // English
+ "Eu falo Português.", // Portuguese
+ "Je parle français.", // French
+ "Ich spreche Deutsch.", // German
+ "Hablo Español."; // Spanish
+ break;
+ default:
+ return;
+ }
+
+ setarray .@flags$[0], "flags/en",
+ "flags/pt_BR",
+ "flags/fr",
+ "flags/de",
+ "flags/es";
+
+ .@menustr$ = "";
+ .@separator$ = ":";
+
+ for (.@i = 0; .@i <= MAX_LANG; .@i++)
+ {
+ if (.@i == MAX_LANG) {
+ .@separator$ = "";
+ }
+ .@menustr$ = .@menustr$ + .@flags$[.@i] + "|" + .@messages$[.@i] + .@separator$;
+ }
+
+ select(.@menustr$);
+
+ .@lang = @menu - 1;
+
+ if (.@lang >= 0 || .@lang <= MAX_LANG) {
+ Lang = .@lang;
+ }
+
+ return;
+}