Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_lw_town_sideb_choicer_Draw_0

(view raw script w/o annotations or w/e)
1
if (canchoose == 1)
2
{
3
    var drawstyle = 0;
4
    
scr_dbox
scr_dbox

function
scr_dbox()
{ xxx = camerax(); yyy = cameray(); if (global.darkzone == 0) { var off = side * 155; draw_sprite_ext(spr_pxwhite, 0, xxx + 16, yyy + 5 + off, 289, 76, 0, c_white, 1); draw_sprite_ext(spr_pxwhite, 0, xxx + 19, yyy + 8 + off, 283, 70, 0, c_black, 1); } if (global.darkzone == 1) { if (side == 0) { draw_set_color(c_black); ossafe_fill_rectangle(xxx + 38, yyy + 16, xxx + 602, yyy + 154, false);
scr_darkbox((xxx + 32) - 8, (yyy + 10) - 8, xxx + 608 + 8, yyy + 160 + 8);
} else { draw_set_color(c_black); ossafe_fill_rectangle(xxx + 38, yyy + 326, xxx + 602, yyy + 464, false);
scr_darkbox((xxx + 32) - 8, (yyy + 320) - 8, xxx + 608 + 8, yyy + 470 + 8);
} } }
();
5
    if (drawstyle == 0)
6
        
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");
7
    if (drawstyle == 1)
8
        draw_set_font(fnt_8bit);
9
    textx = xx;
10
    texty = yy;
11
    if (drawstyle == 0)
12
    {
13
        for (i = 0; i < (choicetotal + 1); i += 1)
14
        {
15
            draw_set_color((mychoice == i) ? c_yellow : c_white);
16
            textx = textposx[i];
17
            texty = textposy[i];
18
            draw_text(textx, texty, string_hash_to_newline(global.choicemsg[i]));
19
        }
20
        draw_sprite_ext(heartSprite, 0, hx, hy, image_xscale, image_yscale, 0, c_white, 1);
21
    }
22
    if (drawstyle == 1)
23
    {
24
        var midy = (yy + 60) - 1;
25
        var bhx = xx + 182;
26
        var bhy = midy - 8;
27
        draw_set_valign(fa_middle);
28
        draw_set_halign(fa_right);
29
        draw_text_ext(xx + 154, midy, string_hash_to_newline(global.choicemsg[0]), 18, 320);
30
        draw_set_halign(fa_left);
31
        draw_text_ext(xx + 230, midy, string_hash_to_newline(global.choicemsg[1]), 18, 320);
32
        if (choicetotal >= 2)
33
        {
34
            draw_set_halign(fa_center);
35
            draw_text_ext(xx + 192, (midy - 29) + 1, string_hash_to_newline(global.choicemsg[2]), 18, 320);
36
        }
37
        if (choicetotal >= 3)
38
        {
39
            draw_set_halign(fa_center);
40
            draw_text_ext(xx + 192, ((midy + 27) - 1) + 6, string_hash_to_newline(global.choicemsg[3]), 18, 320);
41
        }
42
        draw_set_halign(fa_left);
43
        draw_set_valign(fa_top);
44
        if (mychoice == 0)
45
            bhx = (xx + 154) - string_width(string_hash_to_newline(global.choicemsg[0])) - 20;
46
        if (mychoice == 1)
47
            bhx = (xx + 230) - 20;
48
        if (mychoice == 2)
49
        {
50
            bhx = (xx + 192) - round(string_width(string_hash_to_newline(global.choicemsg[2])) / 2) - 20;
51
            bhy = (midy - 38) + 1;
52
        }
53
        if (mychoice == 3)
54
        {
55
            bhx = (xx + 192) - round(string_width(string_hash_to_newline(global.choicemsg[3])) / 2) - 20;
56
            bhy = ((midy + 18) - 1) + 6;
57
        }
58
        draw_sprite_ext(heartSprite, 0, bhx, bhy, image_xscale, image_yscale, 0, c_white, 1);
59
    }
60
}