Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_choicer_neo_Draw_0

(view raw script w/o annotations or w/e)
1
if (canchoose == 1)
2
{
3
    var drawstyle = 0;
4
    if (global.chapter == 3)
5
    {
6
        if (i_ex(obj_board_writer))
7
            drawstyle = 1;
8
    }
9
    if (drawstyle == 0)
10
        
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));
}
((dar == 1) ? "main" : "mainbig");
11
    if (drawstyle == 1)
12
        draw_set_font(fnt_8bit);
13
    textx = xx;
14
    texty = yy;
15
    if (drawstyle == 0)
16
    {
17
        for (i = 0; i < (choicetotal + 1); i += 1)
18
        {
19
            draw_set_color((mychoice == i) ? c_yellow : c_white);
20
            textx = textposx[i];
21
            texty = textposy[i];
22
            draw_text(textx, texty, string_hash_to_newline(global.choicemsg[i]));
23
        }
24
        draw_sprite_ext(heartSprite, 0, hx, hy, image_xscale, image_yscale, 0, c_white, 1);
25
    }
26
    if (drawstyle == 1)
27
    {
28
        var midy = (yy + 60) - 1;
29
        var bhx = xx + 182;
30
        var bhy = midy - 8;
31
        draw_set_valign(fa_middle);
32
        draw_set_halign(fa_right);
33
        draw_text_ext(xx + 154, midy, string_hash_to_newline(global.choicemsg[0]), 18, 320);
34
        draw_set_halign(fa_left);
35
        draw_text_ext(xx + 230, midy, string_hash_to_newline(global.choicemsg[1]), 18, 320);
36
        if (choicetotal >= 2)
37
        {
38
            draw_set_halign(fa_center);
39
            draw_text_ext(xx + 192, (midy - 29) + 1, string_hash_to_newline(global.choicemsg[2]), 18, 320);
40
        }
41
        if (choicetotal >= 3)
42
        {
43
            draw_set_halign(fa_center);
44
            draw_text_ext(xx + 192, ((midy + 27) - 1) + 6, string_hash_to_newline(global.choicemsg[3]), 18, 320);
45
        }
46
        draw_set_halign(fa_left);
47
        draw_set_valign(fa_top);
48
        if (mychoice == 0)
49
            bhx = (xx + 154) - string_width(string_hash_to_newline(global.choicemsg[0])) - 20;
50
        if (mychoice == 1)
51
            bhx = (xx + 230) - 20;
52
        if (mychoice == 2)
53
        {
54
            bhx = (xx + 192) - round(string_width(string_hash_to_newline(global.choicemsg[2])) / 2) - 20;
55
            bhy = (midy - 38) + 1;
56
        }
57
        if (mychoice == 3)
58
        {
59
            bhx = (xx + 192) - round(string_width(string_hash_to_newline(global.choicemsg[3])) / 2) - 20;
60
            bhy = ((midy + 18) - 1) + 6;
61
        }
62
        draw_sprite_ext(heartSprite, 0, bhx, bhy, image_xscale, image_yscale, 0, c_white, 1);
63
    }
64
}