2021-06-03 21:01:32 -07:00
|
|
|
if (dialogue_mode) {
|
2021-06-05 01:58:44 -07:00
|
|
|
if (text_advance_ready == TEXT_LOADING && !ds_queue_empty(name_test) && !ds_queue_empty(name_test) && !ds_queue_empty(active_test) && !ds_queue_empty(emote_test)) {
|
|
|
|
text_advance_ready = TEXT_TYPING;
|
2021-06-03 21:01:32 -07:00
|
|
|
actor_left = ds_queue_dequeue(name_test);
|
2021-06-04 01:09:05 -07:00
|
|
|
actor_left_emote = ds_queue_dequeue(emote_test);
|
2021-06-13 02:20:47 -07:00
|
|
|
switch ( actor_left_emote ) {
|
|
|
|
case 0:
|
|
|
|
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_0_neutral" );
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_1_happy" );
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_2_sad" );
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_3_confused" );
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_4_angry" );
|
|
|
|
break;
|
|
|
|
case 5:
|
2021-06-15 00:06:56 -07:00
|
|
|
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_5_ouch" );
|
2021-06-13 02:20:47 -07:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
actor_left_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2021-06-03 21:01:32 -07:00
|
|
|
actor_right = "";
|
2021-06-04 01:09:05 -07:00
|
|
|
if (!ds_queue_empty(name_test) && !ds_queue_empty(emote_test)) {
|
2021-06-03 21:01:32 -07:00
|
|
|
actor_right = ds_queue_dequeue(name_test);
|
2021-06-04 01:09:05 -07:00
|
|
|
actor_right_emote = ds_queue_dequeue(emote_test);
|
2021-06-13 02:20:47 -07:00
|
|
|
switch ( actor_right_emote ) {
|
|
|
|
case 0:
|
|
|
|
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_0_neutral" );
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_1_happy" );
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_2_sad" );
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_3_confused" );
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_4_angry" );
|
|
|
|
break;
|
|
|
|
case 5:
|
2021-06-15 00:06:56 -07:00
|
|
|
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_5_ouch" );
|
2021-06-13 02:20:47 -07:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
actor_right_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
2021-06-03 21:01:32 -07:00
|
|
|
}
|
2021-06-13 02:20:47 -07:00
|
|
|
textload = ds_queue_dequeue(text_test);
|
|
|
|
texttarget = string_replace_all(textload, "#", "\n" );
|
2021-06-03 21:01:32 -07:00
|
|
|
textspew = "";
|
|
|
|
spewlength = 1;
|
|
|
|
last_active = ds_queue_dequeue(active_test);
|
|
|
|
}
|
|
|
|
|
2021-06-05 01:58:44 -07:00
|
|
|
if (text_advance_ready == TEXT_TYPING ) {
|
2021-06-03 21:01:32 -07:00
|
|
|
textspew += string_char_at(texttarget, spewlength);
|
2021-06-14 03:06:50 -07:00
|
|
|
audio_play_sound( snd_typewriter, 0, false );
|
2021-06-03 21:01:32 -07:00
|
|
|
spewlength++;
|
|
|
|
if (keyboard_check_pressed( ord("Z") ) ) {
|
|
|
|
textspew = texttarget;
|
|
|
|
keyboard_clear(ord("Z"));
|
|
|
|
}
|
|
|
|
if (textspew == texttarget) {
|
2021-06-05 01:58:44 -07:00
|
|
|
text_advance_ready = TEXT_READY;
|
2021-06-03 21:01:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-05 01:58:44 -07:00
|
|
|
if (text_advance_ready == TEXT_READY) {
|
2021-06-03 21:01:32 -07:00
|
|
|
if (keyboard_check_pressed( ord("Z") ) ) {
|
2021-06-05 01:58:44 -07:00
|
|
|
text_advance_ready = TEXT_LOADING;
|
2021-06-04 01:09:05 -07:00
|
|
|
if (ds_queue_empty(name_test) || ds_queue_empty(text_test) || ds_queue_empty(active_test) || ds_queue_empty(emote_test)) {
|
2021-06-03 21:01:32 -07:00
|
|
|
dialogue_mode = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|