Deltarune (Chapter 2) script viewer

← back to main script listing

gml_GlobalScript_switch_asyncPause

(view raw script w/o annotations or w/e)
1
function switch_asyncPause()
2
{
3
    if (scr_is_switch_os())
4
    {
5
        var struct = dsmapToStruct(async_load);
6
        show_debug_message_concat(struct);
7
        if (struct.event_type == "gamepad lost" || struct.event_type == "gamepad discovered")
8
            audio_pause_all();
9
        if (struct.event_type == "focus state changed")
10
        {
11
            if (struct.focus_state == "out_focus")
12
                audio_pause_all();
13
        }
14
    }
15
}
16
17
function switch_asyncResume()
18
{
19
    if (scr_is_switch_os())
20
        audio_resume_all();
21
}