Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_savemenu_Step_0

related scripts: Create_0Draw_0Step_0

(view raw script w/o annotations or w/e)
1
buffer -= 1;
2
if (menuno == 0)
3
{
4
    if (xcoord == 2 && buffer < 0)
5
    {
6
        if (button1_p())
7
        {
8
            xcoord = 99;
9
            endme = 1;
10
        }
11
    }
12
    if (xcoord < 2)
13
    {
14
        if (left_p() || right_p())
15
            xcoord = !xcoord;
16
    }
17
    if (type == 1)
18
    {
19
        if (up_p() || down_p())
20
        {
21
            if (ycoord == 1)
22
                ycoord = 0;
23
            else
24
                ycoord = 1;
25
        }
26
    }
27
    if (global.darkzone == 0)
28
    {
29
        if (ycoord == 1)
30
            xcoord = 0;
31
    }
32
    if (xcoord == 0 && ycoord == 0 && buffer < 0)
33
    {
34
        if (button1_p())
35
        {
36
            menuno = 1;
37
            buffer = 3;
38
            snd_play(snd_select);
39
        }
40
    }
41
    if (button1_p() && xcoord == 1 && ycoord == 0 && buffer < 0)
42
        endme = 1;
43
    if (global.darkzone == 1)
44
    {
45
        if (button1_p() && xcoord == 0 && ycoord == 1 && buffer < 0)
46
        {
47
            global.interact = 1;
48
            menu = instance_create(0, 0, obj_fusionmenu);
49
            menu.type = 4;
50
            endme = 2;
51
        }
52
        if (button1_p() && xcoord == 1 && ycoord == 1 && buffer < 0 && haverecruited)
53
        {
54
            global.interact = 1;
55
            menu = instance_create(0, 0, obj_fusionmenu);
56
            menu.type = 3;
57
            menu.subtype = recruitsubtype;
58
            endme = 2;
59
        }
60
    }
61
    else if (button1_p() && ycoord == 1 && buffer < 0)
62
    {
63
        snd_play(snd_select);
64
        menuno = 10;
65
        buffer = 3;
66
    }
67
    if (button2_p() && buffer < 0 && endme == 0)
68
        endme = 1;
69
    if (endme == 1)
70
    {
71
        global.interact = 0;
72
        with (obj_mainchara)
73
            onebuffer = 3;
74
        instance_destroy();
75
    }
76
    if (endme == 2)
77
    {
78
        with (obj_mainchara)
79
            onebuffer = 3;
80
        instance_destroy();
81
    }
82
}
83
if (menuno == 10)
84
{
85
    if (left_p() || right_p())
86
        quitxcoord = !quitxcoord;
87
    if (button1_p() && buffer < 0)
88
    {
89
        if (quitxcoord == 0)
90
        {
91
            snd_play(snd_select);
92
            menuno = 11;
93
            quittimer = 0;
94
        }
95
        else if (quitxcoord == 1)
96
        {
97
            menuno = 0;
98
            buffer = 3;
99
            quitxcoord = 0;
100
        }
101
    }
102
    if (button2_p() && buffer < 0)
103
    {
104
        menuno = 0;
105
        buffer = 3;
106
        quitxcoord = 0;
107
    }
108
}
109
if (menuno == 11)
110
{
111
    quittimer++;
112
    if (quittimer == 1)
113
    {
114
        snd_free_all();
115
        var lastfade = instance_create(camerax(), cameray(), obj_fadeout);
116
        lastfade.fadespeed = 0.05;
117
        lastfade.x = camerax() - 20;
118
        lastfade.y = cameray() - 20;
119
        lastfade.image_xscale *= 3;
120
        lastfade.image_yscale *= 2;
121
        lastfade.depth = -900000;
122
        with (obj_border_controller)
123
            hide_border(0.05);
124
    }
125
    if (quittimer >= 50)
126
        game_restart_true();
127
}