Deltarune (Chapter Select) script viewer

← back to main script listing

gml_Object_obj_screen_select_Create_0

(view raw script w/o annotations or w/e)
1
_parent = -4;
2
_list = instance_create(0, 0, obj_screen_select_list);
3
_footer = instance_create(0, 410, obj_screen_select_footer);
4
5
init = function(arg0)
6
{
7
    _parent = arg0;
8
    _list.init(id);
9
    _footer.init(id);
10
    _list.reset();
11
    var latest_chapter = get_highest_revealed_chapter();
12
    _list.highlight_chapter(latest_chapter);
13
    _list.enable_input();
14
    _init = true;
15
};
16
17
fade_in = function()
18
{
19
    _list.fade_in();
20
    _footer.fade_in();
21
};
22
23
trigger_event = function(arg0, arg1 = 0)
24
{
25
    switch (arg0)
26
    {
27
        case "scroll_list_down":
28
            _list.disable_input();
29
            _footer.reset();
30
            _footer.highlight();
31
            _footer.enable_input();
32
            break;
33
        case "scroll_list_up":
34
            _list.disable_input();
35
            _footer.reset();
36
            _footer.highlight();
37
            _footer.enable_input();
38
            break;
39
        case "scroll_footer_down":
40
            _footer.reset();
41
            _footer.disable_input();
42
            _list.reset();
43
            _list.highlight();
44
            _list.enable_input();
45
            break;
46
        case "scroll_footer_up":
47
            _footer.reset();
48
            _footer.disable_input();
49
            _list.highlight_bottom();
50
            _list.enable_input();
51
            break;
52
        case "launch_game":
53
            _list.disable_input();
54
            _parent.trigger_event("launch_game", arg1);
55
            break;
56
        default:
57
            _parent.trigger_event(arg0, arg1);
58
            break;
59
    }
60
};