Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_joystick_check_button

(view raw script w/o annotations or w/e)
1
function joystick_check_button(argument0, argument1) //gml_Script_joystick_check_button
2
{
3
    var jid = __joystick_2_gamepad(argument0)
4
    var button = 0
5
    switch argument1
6
    {
7
        case 0:
8
            button = gp_face1
9
            break
10
        case 1:
11
            button = gp_face2
12
            break
13
        case 2:
14
            button = gp_face3
15
            break
16
        case 3:
17
            button = gp_face4
18
            break
19
        case 4:
20
            button = gp_shoulderl
21
            break
22
        case 5:
23
            button = gp_shoulderlb
24
            break
25
        case 6:
26
            button = gp_shoulderr
27
            break
28
        case 7:
29
            button = gp_shoulderrb
30
            break
31
        case 8:
32
            button = gp_select
33
            break
34
        case 9:
35
            button = gp_start
36
            break
37
        case 10:
38
            button = gp_stickl
39
            break
40
        case 11:
41
            button = gp_stickr
42
            break
43
        default:
44
            button = argument1
45
            break
46
    }
47
48
    return gamepad_button_value(jid, button) != 0;
49
}