Deltarune (Chapter Select) script viewer

← back to main script listing

gml_Object_obj_screen_select_list_Step_0

(view raw script w/o annotations or w/e)
1
if (!_input_enabled)
2
    exit;
3
_input_time--;
4
if (_input_time > 0)
5
    exit;
6
if (up_p())
7
{
8
    _input_time = _input_buffer;
9
    audio_play_sound(snd_menumove, 50, 0);
10
    var target_index = _chapter_index - 1;
11
    if (target_index < 0)
12
    {
13
        _parent.trigger_event("scroll_list_up");
14
        reset();
15
    }
16
    else
17
    {
18
        _chapter_index = target_index;
19
        highlight();
20
    }
21
}
22
else if (down_p())
23
{
24
    _input_time = _input_buffer;
25
    audio_play_sound(snd_menumove, 50, 0);
26
    var target_index = _chapter_index + 1;
27
    if (target_index >= array_length(_chapters))
28
    {
29
        _parent.trigger_event("scroll_list_down");
30
        reset();
31
    }
32
    else
33
    {
34
        _chapter_index = target_index;
35
        highlight();
36
    }
37
}