| 1 |
if (global.dialogue_open == false) |
| 2 |
{ |
| 3 |
if (instance_exists(obj_pl)) |
| 4 |
obj_pl.alarm[0] = 1; |
| 5 |
if (draw_alpha > 0) |
| 6 |
draw_alpha -= 0.2; |
| 7 |
else |
| 8 |
instance_destroy(); |
| 9 |
exit; |
| 10 |
} |
| 11 |
var MSG_ADVANCE = false; |
| 12 |
var message_length = string_length(message[message_current]); |
| 13 |
if (message_reset == true) |
| 14 |
{ |
| 15 |
message_reset = false; |
| 16 |
message = 0; |
| 17 |
event_perform(ev_create, 0); |
| 18 |
exit; |
| 19 |
} |
| 20 |
if (keyboard_multicheck_pressed(1) && skippable == true) |
| 21 |
cutoff = message_length; |
| 22 |
if (cutoff < message_length) |
| 23 |
{ |
| 24 |
if (counter == 0) |
| 25 |
{ |
| 26 |
cutoff += 1; |
| 27 |
message_length = string_length(message[message_current]); |
| 28 |
if (cutoff < message_length && (cutoff % 1) == 0) |
| 29 |
{ |
| 30 |
switch (string_char_at(message[message_current], cutoff)) |
| 31 |
{ |
| 32 |
case " ": |
| 33 |
case ".": |
| 34 |
break; |
| 35 |
default: |
| 36 |
audio_play_sound(sndfnt, 1, false); |
| 37 |
break; |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
} |
| 42 |
else if (keyboard_multicheck_pressed(0) && skippable == true) |
| 43 |
{ |
| 44 |
if (choice == false) |
| 45 |
MSG_ADVANCE = true; |
| 46 |
} |
| 47 |
if (message_timer > -1 && cutoff == message_length) |
| 48 |
{ |
| 49 |
if (mT == -1) |
| 50 |
mT = message_timer; |
| 51 |
if (mT > 0) |
| 52 |
{ |
| 53 |
mT -= 1; |
| 54 |
} |
| 55 |
else if (mT == 0) |
| 56 |
{ |
| 57 |
mT = -1; |
| 58 |
MSG_ADVANCE = true; |
| 59 |
} |
| 60 |
} |
| 61 |
scr_text_counter_customscr_text_counter_customfunction scr_text_counter_custom()
{
var current_char = string_char_at(message[message_current], cutoff);
var counter_max = 1;
var message_length = string_length(message[message_current]);
var pause_duration = 5;
if (cutoff > 0 && cutoff < message_length)
{
switch (current_char)
{
case ".":
case ",":
case "?":
case "!":
counter_max = pause_duration;
break;
default:
counter_max = 1;
}
counter += argument[0];
if (counter >= counter_max)
counter = 0;
}
else
{
counter = 0;
}
} (0.2); |
| 62 |
script_execute(scr_text_choices); |
| 63 |
if (MSG_ADVANCE || force_skip) |
| 64 |
{ |
| 65 |
if ((message_current + 1) < array_length_1d(message)) |
| 66 |
{ |
| 67 |
message_current += 1; |
| 68 |
cutoff = 0; |
| 69 |
} |
| 70 |
else |
| 71 |
{ |
| 72 |
global.dialogue_open = false; |
| 73 |
} |
| 74 |
force_skip = false; |
| 75 |
} |