summaryrefslogtreecommitdiff
path: root/npc/functions/asklanguage.txt
blob: 3782e5316f9bd6e83b23292d75c546153adcc06d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// TMW2 script
// Evol functions.
// Author:
//    Reid, Jesusalva
// Description:
//    Function setting the player language

function	script	asklanguage	{

    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;
}