Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_DEVICE_MENU_Create_0

related scripts: Alarm_0Alarm_1Create_0 Draw_0Other_15Step_0

(view raw script w/o annotations or w/e)
1
TYPE = 1;
2
SUBTYPE = 0;
3
CH = string(global.chapter);
4
if (scr_completed_chapter_any_slot(global.chapter))
5
    SUBTYPE = 1;
6
COMPLETEFILE_PREV[0] = ossafe_file_exists("filech" + string(global.chapter - 1) + "_3");
7
COMPLETEFILE_PREV[1] = ossafe_file_exists("filech" + string(global.chapter - 1) + "_4");
8
COMPLETEFILE_PREV[2] = ossafe_file_exists("filech" + string(global.chapter - 1) + "_5");
9
INCOMPLETEFILE_PREV[0] = ossafe_file_exists("filech" + string(global.chapter - 1) + "_0");
10
INCOMPLETEFILE_PREV[1] = ossafe_file_exists("filech" + string(global.chapter - 1) + "_1");
11
INCOMPLETEFILE_PREV[2] = ossafe_file_exists("filech" + string(global.chapter - 1) + "_2");
12
INCOMPLETE_LOAD = 0;
13
if (TYPE == 0)
14
{
15
    
scr_windowcaption
scr_windowcaption

function
scr_windowcaption(arg0)
{ if (global.tempflag[10] != 1 && global.chapter == 1) window_set_caption(arg0); else window_set_caption("DELTARUNE Chapter " + string(global.chapter)); }
(stringsetloc(
CONTACT
"CONTACT", "DEVICE_MENU_slash_Create_0_gml_8_0"
));
16
    global.currentsong[0] = snd_init("AUDIO_DRONE.ogg");
17
    global.currentsong[1] = mus_loop(global.currentsong[0]);
18
}
19
if (TYPE == 1)
20
{
21
    instance_create(0, 0, obj_fadein);
22
    global.tempflag[10] = 1;
23
    
scr_windowcaption
scr_windowcaption

function
scr_windowcaption(arg0)
{ if (global.tempflag[10] != 1 && global.chapter == 1) window_set_caption(arg0); else window_set_caption("DELTARUNE Chapter " + string(global.chapter)); }
(stringsetloc(
DELTARUNE
"DELTARUNE", "DEVICE_MENU_slash_Create_0_gml_17_0"
));
24
    if (SUBTYPE == 0)
25
        global.currentsong[0] = snd_init("menu.ogg");
26
    if (SUBTYPE == 1)
27
        global.currentsong[0] = snd_init("quiet_church.ogg");
28
    if (SUBTYPE >= 1)
29
        scr_enable_chapter_skip(global.chapter);
30
    global.currentsong[1] = mus_loop_ext(global.currentsong[0], 1, 0.95);
31
}
32
BGMADE = 0;
33
BG_ALPHA = 0;
34
BG_SINER = 0;
35
OBMADE = 0;
36
OB_DEPTH = 0;
37
obacktimer = 0;
38
OBM = 0.5;
39
COL_A = c_green;
40
COL_B = c_lime;
41
COL_PLUS = merge_color(c_lime, c_white, 0.5);
42
jamod = 0;
43
if (TYPE == 1)
44
{
45
    BGSINER = 0;
46
    BGMAGNITUDE = 6;
47
    COL_A = merge_color(c_ltgray, c_navy, 0.2);
48
    COL_B = c_white;
49
    COL_PLUS = merge_color(c_yellow, c_white, 0.5);
50
    BGMADE = 1;
51
    BG_ALPHA = 0;
52
    ANIM_SINER = 0;
53
    ANIM_SINER_B = 0;
54
    TRUE_ANIM_SINER = 0;
55
    if (SUBTYPE == 0)
56
    {
57
        COL_A = merge_color(c_ltgray, c_maroon, 0.2);
58
        COL_B = c_white;
59
        COL_PLUS = merge_color(c_yellow, c_white, 0.4);
60
        BGMADE = 0;
61
    }
62
}
63
MENU_NO = 0;
64
for (i = 0; i < 12; i += 1)
65
    MENUCOORD[i] = 0;
66
XL = 210;
67
YL = 40;
68
YS = 5;
69
HEARTX = 75;
70
HEARTY = 110;
71
HEARTXCUR = 75;
72
HEARTYCUR = 75;
73
MOVENOISE = 0;
74
SELNOISE = 0;
75
BACKNOISE = 0;
76
DEATHNOISE = 0;
77
STARTGAME = 0;
78
REMMENU = 0;
79
CANQUIT = 1;
80
if (global.is_console == 1)
81
    CANQUIT = 0;
82
ONEBUFFER = 2;
83
TWOBUFFER = 0;
84
THREAT = 0;
85
TEMPMESSAGE = " ";
86
MESSAGETIMER = 0;
87
version_text = "1.00";
88
if (scr_is_switch_os())
89
    version_text = "1.03";
90
else if (os_type == os_ps4 || os_type == os_ps5)
91
    version_text = "1.00";
92
for (i = 0; i < 3; i += 1)
93
    FILE[i] = 0;
94
for (i = 0; i < 3; i += 1)
95
{
96
    FILE[i] = 0;
97
    NAME[i] = stringsetloc(
[EMPTY]
"[EMPTY]", "DEVICE_MENU_slash_Create_0_gml_97_0"
);
98
    TIME[i] = 0;
99
    PLACE[i] = "------------";
100
    LEVEL[i] = 0;
101
    TIME_STRING[i] = "--:--";
102
    INITLANG[i] = 0;
103
}
104
if (ossafe_file_exists("filech" + CH + "_0"))
105
{
106
    FILE[0] = 1;
107
    NAME[0] = "FILE0";
108
}
109
if (ossafe_file_exists("filech" + CH + "_1"))
110
{
111
    FILE[1] = 1;
112
    NAME[1] = "FILE1";
113
}
114
if (ossafe_file_exists("filech" + CH + "_2"))
115
{
116
    FILE[2] = 1;
117
    NAME[2] = "FILE2";
118
}
119
if (ossafe_file_exists("dr.ini"))
120
{
121
    ossafe_ini_open("dr.ini");
122
    for (i = 0; i < 3; i += 1)
123
    {
124
        if (FILE[i] == 1)
125
        {
126
            var room_id = ini_read_real(
scr_ini_chapter
scr_ini_chapter

function
scr_ini_chapter(arg0, arg1)
{ if (arg0 >= 2) return "G_" + string(arg0) + "_" + string(arg1); else return "G" + string(arg1); }
(global.chapter, i), "Room", scr_get_id_by_room_index(room));
127
            var room_index = 
scr_get_room_by_id
scr_get_room_by_id

function scr_get_room_ids() { if (!variable_global_exists("room_id_list")) global.room_id_list = scr_get_room_list(); return global.room_id_list; } function
scr_get_room_by_id(arg0)
{ var room_id = arg0; var rooms = scr_get_room_ids(); if (room_id < 10000) room_id += (global.chapter * 10000); var room_index = 0; for (var i = 0; i < array_length(rooms); i++) { if (rooms[i].room_id == room_id) { room_index = rooms[i].room_index; break; } } if (room_index == 0) show_debug_message("*** ERROR: could not find room with id " + string(room_id)); return room_index; } function scr_get_id_by_room_index(arg0) { var room_index = arg0; var rooms = scr_get_room_ids(); var room_id = room_gms_debug_failsafe; for (var i = 0; i < array_length(rooms); i++) { if (rooms[i].room_index == room_index) { room_id = rooms[i].room_id; break; } } if (room_id == room_gms_debug_failsafe) show_debug_message("*** ERROR: could not find room with index " + string(room_index)); return room_id; } function scr_room(arg0, arg1) constructor { room_index = arg0; room_id = arg1; if (room_index == 141) show_debug_message(string(141) + " " + string(room_id)); } function scr_get_room_list() { var idsarr = [new scr_room(room_krisroom, 50013), new scr_room(room_town_south, 50024), new scr_room(room_dw_castle_town, 50054), new scr_room(PLACE_MENU, 50075), new scr_room(room_dw_castle_tv, 50114), new scr_room(room_dw_garden_intro, 50122), new scr_room(room_dw_garden_floradinnencounter, 50124), new scr_room(room_dw_garden_hospital, 50125), new scr_room(room_dw_garden_enemyrush, 50131), new scr_room(room_dw_garden_diner, 50135), new scr_room(room_dw_garden_aqua, 50138), new scr_room(room_dw_garden_aquahole, 50143), new scr_room(room_dw_garden_aquaplatforming, 50145), new scr_room(room_dw_garden_cliffexit, 50146), new scr_room(room_dw_garden_aquadash, 50152), new scr_room(room_dw_cliff_dash_runner, 50161), new scr_room(room_dw_cliff_seth_miniboss, 50162), new scr_room(room_dw_cliff_shop, 50163), new scr_room(room_dw_cliff_sethaqua_battle, 50169), new scr_room(room_dw_cliff_verticalwind_post, 50170), new scr_room(room_dw_fcastle_cafe, 50181), new scr_room(room_dw_fcastle_foyer, 50182), new scr_room(room_dw_fcastle_post_party_jail, 50183), new scr_room(room_dw_fcastle_left_twodoors, 50187), new scr_room(room_dw_fcastle_dangerous_platforming, 50190), new scr_room(room_dw_fcastle_blueroom, 50191), new scr_room(room_dw_fcastle_onsen, 50193), new scr_room(room_dw_fcastle_second_diner, 50207), new scr_room(room_dw_fcastle_obscured_bullets, 50208), new scr_room(room_dw_fcastle_right_penultimate, 50210), new scr_room(room_dw_fcastle_right_endingscene, 50212), new scr_room(room_dw_fcastle_orange_gauntlet, 50217), new scr_room(room_dw_fcastle_top_staircase_1, 50225), new scr_room(room_dw_fcastle_top_entrance, 50228), new scr_room(room_dw_fcastle_green_checkpoint, 50230), new scr_room(room_dw_fcastle_final_save, 50231), new scr_room(room_dw_fcastle_flowery, 50232), new scr_room(room_dw_fcastle_pinkroom, 50236), new scr_room(room_dw_fcastle_top_ascent, 50248)]; return idsarr; }
(room_id);
128
            PLACE[i] = 
scr_roomname
scr_roomname

function
scr_roomname(arg0)
{ roomname = stringsetloc(
Dark World?
"Dark World?", "scr_roomname_slash_scr_roomname_gml_1_0"
);
if (arg0 == 0) roomname = stringsetloc(
---
"---", "scr_roomname_slash_scr_roomname_gml_2_0"
);
if (arg0 == 13) roomname = stringsetloc(
Kris's Room
"Kris's Room", "scr_roomname_slash_scr_roomname_gml_4_0_b"
);
if (arg0 == 54) roomname = stringsetloc(
My Castle Town
"My Castle Town", "scr_roomname_slash_scr_roomname_gml_6_0"
);
if (arg0 == 112) roomname = stringsetloc(
Castle Town - TV Building
"Castle Town - TV Building", "scr_roomname_slash_scr_roomname_gml_30_0"
);
if (arg0 == 24) roomname = stringsetloc(
Hometown
"Hometown", "scr_roomname_slash_scr_roomname_gml_7_0"
);
if (arg0 == 120) roomname = stringsetloc(
Dark World
"Dark World", "scr_roomname_slash_scr_roomname_gml_8_0"
);
if (arg0 == 122) roomname = stringsetloc(
Garden - Beginning
"Garden - Beginning", "scr_roomname_slash_scr_roomname_gml_9_0"
);
if (arg0 == 129) roomname = stringsetloc(
Garden - Flowery Helped
"Garden - Flowery Helped", "scr_roomname_slash_scr_roomname_gml_10_0_b"
);
if (arg0 == 133) roomname = stringsetloc(
Garden - Ideal Diner
"Garden - Ideal Diner", "scr_roomname_slash_scr_roomname_gml_11_0"
);
if (arg0 == 150) roomname = stringsetloc(
Garden - Way Home
"Garden - Way Home", "scr_roomname_slash_scr_roomname_gml_12_0_b"
);
if (arg0 == 141) roomname = stringsetloc(
Garden - Shrine
"Garden - Shrine", "scr_roomname_slash_scr_roomname_gml_13_0_b"
);
if (arg0 == 144) roomname = stringsetloc(
Cliffs - Beginning
"Cliffs - Beginning", "scr_roomname_slash_scr_roomname_gml_14_0"
);
if (arg0 == 161) roomname = stringsetloc(
Cliffs - Shop
"Cliffs - Shop", "scr_roomname_slash_scr_roomname_gml_15_0_b"
);
if (arg0 == 167) roomname = stringsetloc(
Cliffs - Below Castle
"Cliffs - Below Castle", "scr_roomname_slash_scr_roomname_gml_16_0_b"
);
if (arg0 == 179) roomname = stringsetloc(
Flower Castle - Jail
"Flower Castle - Jail", "scr_roomname_slash_scr_roomname_gml_17_0_b"
);
if (arg0 == 177) roomname = stringsetloc(
Flower Castle - Cafe
"Flower Castle - Cafe", "scr_roomname_slash_scr_roomname_gml_18_0_b"
);
if (arg0 == 202) roomname = stringsetloc(
Flower Castle - Right Diner
"Flower Castle - Right Diner", "scr_roomname_slash_scr_roomname_gml_19_0_b"
);
if (arg0 == 207) roomname = stringsetloc(
Flower Castle - Right End
"Flower Castle - Right End", "scr_roomname_slash_scr_roomname_gml_20_0"
);
if (arg0 == 183) roomname = stringsetloc(
Flower Castle - Left Doors
"Flower Castle - Left Doors", "scr_roomname_slash_scr_roomname_gml_21_0_b"
);
if (arg0 == 187) roomname = stringsetloc(
Flower Castle - Left Stage
"Flower Castle - Left Stage", "scr_roomname_slash_scr_roomname_gml_22_0"
);
if (arg0 == 189) roomname = stringsetloc(
Flower Castle - Left End
"Flower Castle - Left End", "scr_roomname_slash_scr_roomname_gml_23_0_b"
);
if (arg0 == 222) roomname = stringsetloc(
Top of Castle - Beginning
"Top of Castle - Beginning", "scr_roomname_slash_scr_roomname_gml_24_0_b"
);
if (arg0 == 224) roomname = stringsetloc(
Top of Castle - Green's Shop
"Top of Castle - Green's Shop", "scr_roomname_slash_scr_roomname_gml_25_0"
);
if (arg0 == 225) roomname = stringsetloc(
Top of Castle - Castle Top
"Top of Castle - Castle Top", "scr_roomname_slash_scr_roomname_gml_26_0"
);
if (arg0 == 205) roomname = stringsetloc(
Flower Castle - Right View
"Flower Castle - Right View", "scr_roomname_slash_scr_roomname_gml_27_0"
);
if (arg0 == 230) roomname = stringsetloc(
Top of Castle - Boss?
"Top of Castle - Boss?", "scr_roomname_slash_scr_roomname_gml_28_0"
);
return roomname; }
(room_index);
129
            TIME[i] = ini_read_real(
scr_ini_chapter
scr_ini_chapter

function
scr_ini_chapter(arg0, arg1)
{ if (arg0 >= 2) return "G_" + string(arg0) + "_" + string(arg1); else return "G" + string(arg1); }
(global.chapter, i), "Time", 0);
130
            NAME[i] = ini_read_string(
scr_ini_chapter
scr_ini_chapter

function
scr_ini_chapter(arg0, arg1)
{ if (arg0 >= 2) return "G_" + string(arg0) + "_" + string(arg1); else return "G" + string(arg1); }
(global.chapter, i), "Name", "------");
131
            LEVEL[i] = 1;
132
            INITLANG[i] = ini_read_real(
scr_ini_chapter
scr_ini_chapter

function
scr_ini_chapter(arg0, arg1)
{ if (arg0 >= 2) return "G_" + string(arg0) + "_" + string(arg1); else return "G" + string(arg1); }
(global.chapter, i), "InitLang", 0);
133
            TIME_SECONDS_TOTAL[i] = floor(TIME[i] / 30);
134
            TIME_MINUTES[i] = floor(TIME_SECONDS_TOTAL[i] / 60);
135
            TIME_SECONDS[i] = TIME_SECONDS_TOTAL[i] - (TIME_MINUTES[i] * 60);
136
            TIME_SECONDS_STRING[i] = string(TIME_SECONDS[i]);
137
            if (TIME_SECONDS[i] == 0)
138
                TIME_SECONDS_STRING[i] = "00";
139
            if (TIME_SECONDS[i] < 10 && TIME_SECONDS[i] >= 1)
140
                TIME_SECONDS_STRING[i] = "0" + string(TIME_SECONDS[i]);
141
            TIME_STRING[i] = 
scr_timedisp
scr_timedisp

function
scr_timedisp(arg0)
{ var minutes = floor(arg0 / 1800); var remmins = minutes % 60; var hours = (minutes - remmins) / 60; var seconds = floor((arg0 / 30) - (minutes * 60)); var hourstring = string(hours) + ":"; var minstring = string(remmins) + ":"; if (remmins < 10) minstring = "0" + minstring; var secstring = string(floor(seconds)); if (seconds < 10) secstring = "0" + secstring; var timedisp = hourstring + minstring + secstring; return timedisp; }
(TIME[i]);
142
        }
143
    }
144
    var cadd = 3;
145
    if (INCOMPLETE_LOAD)
146
        cadd = 0;
147
    for (i = 0; i < 3; i++)
148
    {
149
        COMPLETEFILE_PREV_NAME[i] = stringsetloc(
NO DATA
"NO DATA", "DEVICE_MENU_slash_Create_0_gml_182_0"
);
150
        COMPLETEFILE_PREV_TIME[i] = 0;
151
        COMPLETEFILE_PREV_PLACE[i] = stringsetloc(
CHAPTER 1
"CHAPTER 1", "DEVICE_MENU_slash_Create_0_gml_221_0"
);
152
        INCOMPLETEFILE_PREV_NAME[i] = stringsetloc(
NO DATA
"NO DATA", "DEVICE_MENU_slash_Create_0_gml_185_0"
);
153
        INCOMPLETEFILE_PREV_TIME[i] = 0;
154
        var loadcompletion = 0;
155
        if (COMPLETEFILE_PREV[i] == 1 && INCOMPLETE_LOAD == 0)
156
            loadcompletion = 1;
157
        if (INCOMPLETEFILE_PREV[i] == 1 && INCOMPLETE_LOAD == 1)
158
            loadcompletion = 1;
159
        if (loadcompletion)
160
        {
161
            COMPLETEFILE_PREV_NAME[i] = stringsetloc(
UNKNOWN FILE
"UNKNOWN FILE", "DEVICE_MENU_slash_Create_0_gml_190_0"
);
162
            COMPLETEFILE_PREV_NAME[i] = ini_read_string(
scr_ini_chapter
scr_ini_chapter

function
scr_ini_chapter(arg0, arg1)
{ if (arg0 >= 2) return "G_" + string(arg0) + "_" + string(arg1); else return "G" + string(arg1); }
(global.chapter - 1, i + cadd), "Name", "------");
163
            COMPLETEFILE_PREV_TIME[i] = ini_read_real(
scr_ini_chapter
scr_ini_chapter

function
scr_ini_chapter(arg0, arg1)
{ if (arg0 >= 2) return "G_" + string(arg0) + "_" + string(arg1); else return "G" + string(arg1); }
(global.chapter - 1, i + cadd), "Time", 0);
164
            COMPLETEFILE_PREV_PLACE[i] = stringsetloc(
CHAPTER 1
"CHAPTER 1", "DEVICE_MENU_slash_Create_0_gml_237_0"
);
165
            COMPLETETIME_SECONDS_TOTAL[i] = floor(COMPLETEFILE_PREV_TIME[i] / 30);
166
            COMPLETETIME_MINUTES[i] = floor(COMPLETETIME_SECONDS_TOTAL[i] / 60);
167
            COMPLETETIME_SECONDS[i] = COMPLETETIME_SECONDS_TOTAL[i] - (COMPLETETIME_MINUTES[i] * 60);
168
            COMPLETETIME_SECONDS_STRING[i] = string(COMPLETETIME_SECONDS[i]);
169
            if (COMPLETETIME_SECONDS[i] == 0)
170
                COMPLETETIME_SECONDS_STRING[i] = "00";
171
            if (COMPLETETIME_SECONDS[i] < 10 && COMPLETETIME_SECONDS[i] >= 1)
172
                COMPLETETIME_SECONDS_STRING[i] = "0" + string(COMPLETETIME_SECONDS[i]);
173
            COMPLETETIME_STRING[i] = string(COMPLETETIME_MINUTES[i]) + ":" + COMPLETETIME_SECONDS_STRING[i];
174
            COMPLETETIME_STRING[i] = 
scr_timedisp
scr_timedisp

function
scr_timedisp(arg0)
{ var minutes = floor(arg0 / 1800); var remmins = minutes % 60; var hours = (minutes - remmins) / 60; var seconds = floor((arg0 / 30) - (minutes * 60)); var hourstring = string(hours) + ":"; var minstring = string(remmins) + ":"; if (remmins < 10) minstring = "0" + minstring; var secstring = string(floor(seconds)); if (seconds < 10) secstring = "0" + secstring; var timedisp = hourstring + minstring + secstring; return timedisp; }
(COMPLETEFILE_PREV_TIME[i]);
175
        }
176
        if (INCOMPLETEFILE_PREV[i])
177
        {
178
            INCOMPLETEFILE_PREV_NAME[i] = stringsetloc(
UNKNOWN FILE
"UNKNOWN FILE", "DEVICE_MENU_slash_Create_0_gml_205_0"
);
179
            INCOMPLETEFILE_PREV_NAME[i] = ini_read_string(
scr_ini_chapter
scr_ini_chapter

function
scr_ini_chapter(arg0, arg1)
{ if (arg0 >= 2) return "G_" + string(arg0) + "_" + string(arg1); else return "G" + string(arg1); }
(global.chapter - 1, i), "Name", "------");
180
            INCOMPLETEFILE_PREV_TIME[i] = ini_read_real(
scr_ini_chapter
scr_ini_chapter

function
scr_ini_chapter(arg0, arg1)
{ if (arg0 >= 2) return "G_" + string(arg0) + "_" + string(arg1); else return "G" + string(arg1); }
(global.chapter - 1, i), "Time", 0);
181
        }
182
    }
183
    ossafe_ini_close();
184
    ossafe_savedata_save();
185
}
186
var INITMENU = 0;
187
if (ossafe_file_exists("dr.ini"))
188
{
189
    if (FILE[0] == 0 && FILE[1] == 0 && FILE[2] == 0)
190
    {
191
        if (COMPLETEFILE_PREV[0] == 1 || COMPLETEFILE_PREV[1] == 1 || COMPLETEFILE_PREV[2] == 1)
192
            INITMENU = 10;
193
        if (INCOMPLETE_LOAD == 1)
194
            INITMENU = 10;
195
    }
196
}
197
MENU_NO = INITMENU;
198
depth = 5;
199
jamod = 0;
200
input_enabled = true;