Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_minigame_quit_ui_Draw_0

(view raw script w/o annotations or w/e)
1
if (i_ex(obj_gameover_minigame) || i_ex(obj_round_evaluation))
2
    exit;
3
if (button3_h())
4
    canceltimer++;
5
else
6
    canceltimer = 0;
7
if (appear)
8
{
9
    if (instructionLerp < 1)
10
        instructionLerp += 0.1;
11
}
12
if (!appear)
13
    instructionLerp -= 0.1;
14
var _easedLerp = 
scr_ease_out
scr_ease_out

function
scr_ease_out(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; switch (arg1) { case -3: return ease_out_bounce(arg0, 0, 1, 1); case -2: return ease_out_elastic(arg0, 0, 1, 1); case -1: return ease_out_back(arg0, 0, 1, 1); case 0: return arg0; case 1: return sin(arg0 * 1.5707963267948966); case 2: return -arg0 * (arg0 - 2); case 6: return -power(2, -10 * arg0) + 1; case 7: arg0--; return sqrt(1 - (arg0 * arg0)); default: arg0--; if (arg1 == 4) { return -1 * (power(arg0, arg1) - 1); break; } return power(arg0, arg1) + 1; } }
(instructionLerp, 3);
15
var _ja = global.lang == "ja";
16
var _space = _ja ? "" : "    ";
17
quistring = stringsetsubloc("Hold ~1 : Quit", 
scr_get_input_name
scr_get_input_name

function
scr_get_input_name(arg0)
{ var _control = "[?]"; if (global.is_console || obj_gamecontroller.gamepad_active) { _control = global.input_g[arg0]; if (_control == gp_padr) return "\\*D "; if (_control == gp_padl) return "\\*A "; if (_control == gp_padu) return "\\*W "; if (_control == gp_padd) return "\\*S "; if (_control == global.button0) return "\\*Z "; if (_control == global.button1) return "\\*X "; if (_control == global.button2) return "\\*C "; } var left_bracket = (global.lang == "en") ? "[" : "["; var right_bracket = (global.lang == "en") ? "]" : "]"; _control = left_bracket + global.asc_def[global.input_k[arg0]] + right_bracket; if (!is_string(_control)) _control = "[?]"; else return _control; }
(6), "obj_minigame_quit_ui_slash_Draw_0_gml_18_0");
18
quistring2 = stringsetsubloc("Hold ~1 : Quit", _space, "obj_minigame_quit_ui_slash_Draw_0_gml_18_0");
19
if (room == room_dw_susiezilla)
20
    quistring = stringsetsubloc("~1 : Quit", 
scr_get_input_name
scr_get_input_name

function
scr_get_input_name(arg0)
{ var _control = "[?]"; if (global.is_console || obj_gamecontroller.gamepad_active) { _control = global.input_g[arg0]; if (_control == gp_padr) return "\\*D "; if (_control == gp_padl) return "\\*A "; if (_control == gp_padu) return "\\*W "; if (_control == gp_padd) return "\\*S "; if (_control == global.button0) return "\\*Z "; if (_control == global.button1) return "\\*X "; if (_control == global.button2) return "\\*C "; } var left_bracket = (global.lang == "en") ? "[" : "["; var right_bracket = (global.lang == "en") ? "]" : "]"; _control = left_bracket + global.asc_def[global.input_k[arg0]] + right_bracket; if (!is_string(_control)) _control = "[?]"; else return _control; }
(6), "obj_minigame_quit_ui_slash_Draw_0_gml_20_0");
21
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("mainbig");
22
draw_set_color(c_white);
23
draw_set_halign(fa_right);
24
var space = 28;
25
var yloc = 380;
26
var butoffset = 4;
27
var reddening = canceltimer / (canceltime * 1.2);
28
reddening = clamp(reddening, 0, 1);
29
var redcol = merge_color(c_white, c_red, reddening);
30
var a = 2;
31
var xx = 0;
32
var yy = 0;
33
var scale = 1;
34
if (room == room_dw_chef)
35
{
36
    xx += 10;
37
    yy -= 22;
38
}
39
if (room == room_dw_rhythm)
40
    xx = -210;
41
if (room == room_dw_susiezilla)
42
{
43
    var iscontroller = global.is_console || obj_gamecontroller.gamepad_active;
44
    xx = -22;
45
    yy = -60;
46
    if (iscontroller)
47
    {
48
        xx += 14;
49
        yy -= 34;
50
    }
51
    else
52
    {
53
        xx -= 13;
54
        yy -= 0;
55
    }
56
    if (global.lang == "ja")
57
    {
58
        xx = -6;
59
        yy = -96;
60
        if (iscontroller)
61
        {
62
            xx += 21;
63
            yy -= 4;
64
        }
65
    }
66
}
67
var _alpha = 1;
68
if (global.is_console || obj_gamecontroller.gamepad_active)
69
{
70
    draw_set_alpha(1);
71
    draw_set_colour(redcol);
72
    draw_text_transformed_outline((camerax() + xx + 720) - (_easedLerp * 100), cameray() + yloc + yy + (space * a), quistring2, scale, 1, 0);
73
    var xSpr = 
scr_getbuttonsprite
scr_getbuttonsprite

function
scr_getbuttonsprite(arg0, arg1)
{ var control = arg0; var isString = arg1; var button = noone; var is_dualshock = os_type == os_ps4 || global.gamepad_type == "Sony DualShock 4"; var is_dualsense = os_type == os_ps5 || global.gamepad_type == "DualSense Wireless Controller"; var button_sprite = button_questionmark; var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71); if (isString) { if (control == "A") { button_sprite = button_xbox_left; if (scr_is_switch_os()) { button_sprite = button_switch_left_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_left_dark : button_ps5_dpad_left; } return button_sprite; } if (control == "D") { button_sprite = button_xbox_right; if (scr_is_switch_os()) { button_sprite = button_switch_right_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_right_dark : button_ps5_dpad_right; } return button_sprite; } if (control == "W") { button_sprite = button_xbox_up; if (scr_is_switch_os()) { button_sprite = button_switch_up_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_up_dark : button_ps5_dpad_up; } return button_sprite; } if (control == "S") { button_sprite = button_xbox_down; if (scr_is_switch_os()) { button_sprite = button_switch_down_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_down_dark : button_ps5_dpad_down; } return button_sprite; } if (control == "l") { button_sprite = button_xbox_left_bumper; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l1; if (is_dualsense) button_sprite = button_ps5_l1; } if (scr_is_switch_os()) button_sprite = button_switch_l_0; return button_sprite; } if (control == "L") { button_sprite = button_xbox_left_trigger; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l2; if (is_dualsense) button_sprite = button_ps5_l2; } if (scr_is_switch_os()) button_sprite = button_switch_zl_0; return button_sprite; } if (control == "r") { button_sprite = button_xbox_right_bumper; if (is_dualshock || is_dualsense) ...
(global.input_g[6], false);
74
    var butxpos = (camerax() + 720) - (_easedLerp * 100) - string_width(" " + quistring2);
75
    if (_ja)
76
        butxpos -= ((sprite_get_width(xSpr) * 2) - 10);
77
    var butxoff = butxpos;
78
    if (!_ja)
79
    {
80
        butxoff += string_width(" Hold ");
81
        butxpos += 4;
82
    }
83
    draw_sprite_ext(xSpr, 0, butxoff + xx, cameray() + yloc + (space * a) + butoffset + yy, 2, 2, 0, redcol, _alpha);
84
    if (canceltimer == canceltime)
85
        draw_sprite_ext(spr_quiz_hud_timer, 0, (butxpos - 32) + xx, cameray() + yloc + (space * a) + 4 + yy, 2, 2, 0, redcol, canceltimer / 8);
86
    else
87
        draw_sprite_ext(spr_quiz_hud_timer, 28 - ((canceltimer / canceltime) * 29), (butxpos - 32) + xx, cameray() + yloc + (space * a) + 4 + yy, 2, 2, 0, redcol, canceltimer / 8);
88
    draw_set_color(c_white);
89
}
90
else
91
{
92
    draw_set_alpha(1);
93
    draw_set_colour(redcol);
94
    draw_text_transformed_outline((camerax() + xx + 720) - (_easedLerp * 100), cameray() + yloc + yy + (space * a), quistring, scale, 1, 0);
95
    if (room == room_dw_susiezilla)
96
        xx += 6;
97
    if (canceltimer == canceltime)
98
        draw_sprite_ext(spr_quiz_hud_timer, 0, (camerax() + xx + 720) - (_easedLerp * 100) - round(string_width(quistring)) - 28 - 8, cameray() + yloc + (space * a) + 3 + yy, 2, 2, 0, redcol, canceltimer / 8);
99
    else
100
        draw_sprite_ext(spr_quiz_hud_timer, 28 - ((canceltimer / canceltime) * 29), (camerax() + xx + 720) - (_easedLerp * 100) - round(string_width(quistring)) - 28 - 8, cameray() + yloc + (space * a) + 3 + yy, 2, 2, 0, redcol, canceltimer / 8);
101
    draw_set_color(c_white);
102
}
103
draw_set_halign(fa_left);
104
draw_set_alpha(1);