1 |
if live_call() |
2 |
return global.live_result; |
3 |
if (local_dialogue_open == false) |
4 |
{ |
5 |
if (!alarm[1]) |
6 |
instance_destroy() |
7 |
return; |
8 |
} |
9 |
if (letter_array == -1) |
10 |
{ |
11 |
for (var i = 1; i <= string_length(message[message_current]); i++) |
12 |
{ |
13 |
text_alpha[i] = 0 |
14 |
letter_array[i] = string_char_at(message[message_current], i) |
15 |
if (i > 1) |
16 |
text_x[i] = (text_x[clamp((i - 1), 1, 9999)]) + str_width |
17 |
text_y[i] = text_y[clamp((i - 1), 1, 9999)] |
18 |
if (letter_array[i] == "#") |
19 |
{ |
20 |
text_y[i] += 20 |
21 |
text_x[i] = text_x[1] - str_width |
22 |
} |
23 |
} |
24 |
} |
25 |
if (letter_current < (array_length(letter_array) - 1)) |
26 |
{ |
27 |
if (letter_waiter == 0) |
28 |
{ |
29 |
letter_current += letter_speed |
30 |
show_debug_message("letter_current: " + string(letter_current) + "#string_length = " + string(string_length(message[message_current]))) |
31 |
if (floor(letter_current) == letter_current) |
32 |
{ |
33 |
switch letter_array[letter_current] |
34 |
{ |
35 |
case " ": |
36 |
case ".": |
37 |
case "#": |
38 |
break |
39 |
default: |
40 |
audio_stop_sound(sndfnt) |
41 |
audio_play_sound_on(emitter1, sndfnt, 0, false) |
42 |
break |
43 |
} |
44 |
|
45 |
} |
46 |
} |
47 |
} |
48 |
else if ((!alarm[0]) && (!message_advance)) |
49 |
alarm[0] = fade_timer |
50 |
if (letter_waiter > 0) |
51 |
letter_waiter-- |
52 |
if (message_advance == 1) |
53 |
{ |
54 |
draw_alpha -= 0.05 |
55 |
if (draw_alpha <= 0) |
56 |
{ |
57 |
for (i = 0; i <= letter_current; i++) |
58 |
text_alpha[i] = 0 |
59 |
draw_alpha = 0 |
60 |
message_advance += 1 |
61 |
return; |
62 |
} |
63 |
else |
64 |
return; |
65 |
} |
66 |
else if (message_advance == 2) |
67 |
{ |
68 |
message_advance = 0 |
69 |
if ((message_current + 1) < array_length_1d(message)) |
70 |
{ |
71 |
letter_array = -1 |
72 |
message_current += 1 |
73 |
letter_current = 0 |
74 |
} |
75 |
else |
76 |
local_dialogue_open = false |
77 |
} |
78 |
if (message_advance != 1) |
79 |
{ |
80 |
if (draw_alpha < 1) |
81 |
draw_alpha += 0.1 |
82 |
} |
83 |
for (i = 0; i <= letter_current; i++) |
84 |
{ |
85 |
if (text_alpha[i] < 1) |
86 |
text_alpha[i] += 0.1 |
87 |
} |