Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_chef_controls_ui_Draw_0

(view raw script w/o annotations or w/e)
1
if (i_ex(obj_chefs_game) && obj_chefs_game.gameover)
2
    con = 2;
3
if (i_ex(obj_chefs_game) && obj_chefs_game.timer < 3)
4
    con = 2;
5
if (con == 1 && image_alpha < 1)
6
    image_alpha += 0.1;
7
if (con == 2)
8
{
9
    image_alpha -= 0.1;
10
    if (image_alpha <= 0)
11
        instance_destroy();
12
}
13
if (!i_ex(obj_gameover_minigame))
14
{
15
    var _x = camerax() + 634;
16
    var _y = cameray() + 416;
17
    var _y2 = cameray() + 446;
18
    var _string = "";
19
    var _string2 = "";
20
    var _string3 = stringsetsubloc("Throw ~1    Jump ~2", 
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; }
(4),
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; }
(5), "obj_chef_controls_ui_slash_Draw_0_gml_19_0");
21
    var _string4 = stringsetloc(
Throw : Jump
"Throw : Jump", "obj_chef_controls_ui_slash_Draw_0_gml_20_0"
);
22
    draw_set_halign(fa_right);
23
    draw_set_color(c_white);
24
    
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");
25
    draw_set_alpha(image_alpha);
26
    if (global.is_console || obj_gamecontroller.gamepad_active)
27
    {
28
        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[5], false);
29
        var butxpos = _x - string_width(" : " + _string2) - sprite_get_width(xSpr) - 12;
30
        var _xx = 0;
31
        if (global.lang == "ja")
32
            _xx = 55;
33
        draw_sprite_ext(xSpr, 0, butxpos - 60 - _xx, _y + 4 + 30, 2, 2, 0, c_white, image_alpha);
34
        draw_set_colour(c_black);
35
        draw_text_transformed(_x - 1, _y2 - 1, " : " + _string4, 1, 1, 0);
36
        draw_text_transformed(_x + 1, _y2 - 1, " : " + _string4, 1, 1, 0);
37
        draw_text_transformed(_x - 1, _y2 + 1, " : " + _string4, 1, 1, 0);
38
        draw_text_transformed(_x + 1, _y2 + 1, " : " + _string4, 1, 1, 0);
39
        draw_set_colour(c_white);
40
        draw_text_transformed(_x, _y2, " : " + _string4, 1, 1, 0);
41
        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[4], false);
42
        butxpos = _x - string_width(" : " + _string4) - sprite_get_width(xSpr) - 12;
43
        draw_sprite_ext(xSpr, 0, butxpos, _y2 + 4, 2, 2, 0, c_white, image_alpha);
44
    }
45
    else
46
    {
47
        draw_set_colour(c_black);
48
        draw_text_transformed(_x - 1, _y2 - 1, _string3, 1, 1, 0);
49
        draw_text_transformed(_x + 1, _y2 - 1, _string3, 1, 1, 0);
50
        draw_text_transformed(_x - 1, _y2 + 1, _string3, 1, 1, 0);
51
        draw_text_transformed(_x + 1, _y2 + 1, _string3, 1, 1, 0);
52
        draw_set_colour(c_white);
53
        draw_text_transformed(_x, _y2, _string3, 1, 1, 0);
54
    }
55
    draw_set_halign(fa_left);
56
    draw_set_alpha(1);
57
}