1 |
if live_call() |
2 |
return global.live_result; |
3 |
if (global.dialogue_open == false) |
4 |
{ |
5 |
if instance_exists(obj_pl) |
6 |
obj_pl.alarm[0] = 1 |
7 |
instance_destroy() |
8 |
} |
9 |
if (letter_array == -1) |
10 |
{ |
11 |
for (var i = 1; i <= string_length(message[message_current]); i++) |
12 |
{ |
13 |
letter_array[i] = string_char_at(message[message_current], i) |
14 |
if (i > 1) |
15 |
text_x[i] = (text_x[clamp((i - 1), 1, 9999)]) + str_width |
16 |
text_y[i] = text_y[clamp((i - 1), 1, 9999)] |
17 |
if (letter_array[i] == "#") |
18 |
{ |
19 |
text_y[i] += 20 |
20 |
text_x[i] = text_x[1] - str_width |
21 |
} |
22 |
} |
23 |
} |
24 |
if (letter_current < (array_length(letter_array) - 1)) |
25 |
{ |
26 |
if (letter_waiter == 0) |
27 |
{ |
28 |
letter_current += letter_speed |
29 |
if (floor(letter_current) == letter_current) |
30 |
{ |
31 |
switch letter_array[letter_current] |
32 |
{ |
33 |
case " ": |
34 |
case ".": |
35 |
case "#": |
36 |
break |
37 |
default: |
38 |
audio_stop_sound(sndfnt) |
39 |
audio_play_sound(sndfnt, 1, false) |
40 |
break |
41 |
} |
42 |
|
43 |
} |
44 |
} |
45 |
} |
46 |
else if ((!alarm[0]) && (!message_advance)) |
47 |
alarm[0] = 65 |
48 |
if (letter_waiter > 0) |
49 |
letter_waiter-- |
50 |
if (message_advance == true) |
51 |
{ |
52 |
message_advance = false |
53 |
if ((message_current + 1) < array_length_1d(message)) |
54 |
{ |
55 |
letter_array = -1 |
56 |
message_current += 1 |
57 |
letter_current = 0 |
58 |
} |
59 |
else |
60 |
global.dialogue_open = false |
61 |
} |