1 |
var MSG_ADVANCE = false; |
2 |
var message_length = string_length(message[message_current]); |
3 |
if (fade_out == true) |
4 |
{ |
5 |
if (draw_alpha > 0) |
6 |
draw_alpha -= 0.1; |
7 |
else |
8 |
instance_destroy(); |
9 |
exit; |
10 |
} |
11 |
else if (draw_alpha < 1) |
12 |
{ |
13 |
draw_alpha += 0.1; |
14 |
} |
15 |
if (message_reset == true) |
16 |
{ |
17 |
message_reset = false; |
18 |
message = 0; |
19 |
event_perform(ev_create, 0); |
20 |
exit; |
21 |
} |
22 |
if (keyboard_multicheck_pressed(1) && skippable == true) |
23 |
cutoff = message_length; |
24 |
if (cutoff < message_length) |
25 |
{ |
26 |
if (counter == 0) |
27 |
{ |
28 |
cutoff += 1; |
29 |
script_execute(scr_text_talk); |
30 |
} |
31 |
} |
32 |
else if (keyboard_multicheck_pressed(0) && skippable == true) |
33 |
{ |
34 |
if (choice == false) |
35 |
MSG_ADVANCE = true; |
36 |
} |
37 |
script_execute(scr_text_counter_overworld); |
38 |
if (outcome == p && choice == false) |
39 |
{ |
40 |
if ((message_current + 1) < array_length_1d(message)) |
41 |
{ |
42 |
message_current += 1; |
43 |
cutoff = 0; |
44 |
} |
45 |
else |
46 |
{ |
47 |
global.dialogue_open = false; |
48 |
} |
49 |
outcome = 0; |
50 |
} |
51 |
if (message_current == ch_msg) |
52 |
choice = true; |
53 |
if (choice == true && cutoff >= string_length(message[message_current])) |
54 |
{ |
55 |
if (global.down_keyp) |
56 |
{ |
57 |
if (p < 5 && ch[p + 1] != "") |
58 |
p += 1; |
59 |
else |
60 |
p = 1; |
61 |
audio_play_sound(snd_mainmenu_select, 1, 0); |
62 |
} |
63 |
if (global.up_keyp) |
64 |
{ |
65 |
if (p > 1 && ch[p - 1] != "") |
66 |
p -= 1; |
67 |
else |
68 |
p = 5; |
69 |
audio_play_sound(snd_mainmenu_select, 1, 0); |
70 |
} |
71 |
if (keyboard_multicheck_pressed(0)) |
72 |
{ |
73 |
outcome = p; |
74 |
choice = false; |
75 |
audio_play_sound(snd_confirm, 1, 0); |
76 |
} |
77 |
} |
78 |
if (MSG_ADVANCE) |
79 |
{ |
80 |
if ((message_current + 1) < array_length_1d(message)) |
81 |
{ |
82 |
message_current += 1; |
83 |
cutoff = 0; |
84 |
} |
85 |
else |
86 |
{ |
87 |
global.dialogue_open = false; |
88 |
} |
89 |
} |