Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_mail_sort

(view raw script w/o annotations or w/e)
1
function scr_mail_sort
scr_mail_sort

function scr_mail_sort() { var old_pinned = ""; if (global.mail_pinned == true) { old_pinned = ds_list_find_value(global.mail_list, 0); ds_list_delete(global.mail_list, 0); } ds_list_sort(global.mail_list, false); if (old_pinned != "") ds_list_insert(global.mail_list, 0, old_pinned); }
()
2
{
3
    var old_pinned = "";
4
    if (global.mail_pinned == true)
5
    {
6
        old_pinned = ds_list_find_value(global.mail_list, 0);
7
        ds_list_delete(global.mail_list, 0);
8
    }
9
    ds_list_sort(global.mail_list, false);
10
    if (old_pinned != "")
11
        ds_list_insert(global.mail_list, 0, old_pinned);
12
}