Deltarune (Chapter 5) 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 (is_platmode)
2
{
3
    var ymod = 0;
4
    if (d == 1)
5
        ymod = 155;
6
    var xxx = camerax() + 0;
7
    var yyy = cameray() + 0;
8
    var boxwidth_real = 592;
9
    var sidemod = d * 380;
10
    if (d == 1 && obj_darkcontroller.charcon == 1)
11
    {
12
        sidemod = sidemod - 44;
13
        d_add = 155;
14
    }
15
    else
16
    {
17
        d_add = 177;
18
    }
19
    draw_set_color(c_black);
20
    draw_set_alpha(0.7);
21
    d_rectangle(xxx, yyy + sidemod, xxx + 640, yyy + sidemod + 100, false);
22
    draw_set_alpha(1);
23
    draw_set_color(c_white);
24
}
25
if (canchoose == 1)
26
{
27
    var drawstyle = 0;
28
    if (global.chapter == 3)
29
    {
30
        if (i_ex(obj_board_writer))
31
            drawstyle = 1;
32
    }
33
    if (drawstyle == 0)
34
        
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");
35
    if (drawstyle == 1)
36
        draw_set_font(fnt_8bit);
37
    var textx = xx;
38
    var texty = yy;
39
    if (drawstyle == 0)
40
    {
41
        var memalign = 
42
        {
43
            h: draw_get_halign(),
44
            v: draw_get_valign()
45
        };
46
        if (neostyle == 1)
47
        {
48
            draw_set_halign(fa_center);
49
            draw_set_valign(fa_middle);
50
        }
51
        for (var i = 0; i < (choicetotal + 1); i += 1)
52
        {
53
            draw_set_color((mychoice == i) ? highlightCol : c_white);
54
            textx = textposx[i];
55
            texty = textposy[i];
56
            draw_text(textx, texty, string_hash_to_newline(global.choicemsg[i]));
57
        }
58
        draw_set_halign(memalign.h);
59
        draw_set_valign(memalign.v);
60
        draw_sprite_ext(heartSprite, 0, hx, hy, image_xscale, image_yscale, 0, heartCol, 1);
61
    }
62
    if (drawstyle == 1)
63
    {
64
        var midy = (yy + 60) - 1;
65
        var bhx = xx + 182;
66
        var bhy = midy - 8;
67
        draw_set_valign(fa_middle);
68
        draw_set_halign(fa_right);
69
        draw_text_ext(xx + 154, midy, string_hash_to_newline(global.choicemsg[0]), 18, 320);
70
        draw_set_halign(fa_left);
71
        draw_text_ext(xx + 230, midy, string_hash_to_newline(global.choicemsg[1]), 18, 320);
72
        if (choicetotal >= 2)
73
        {
74
            draw_set_halign(fa_center);
75
            draw_text_ext(xx + 192, (midy - 29) + 1, string_hash_to_newline(global.choicemsg[2]), 18, 320);
76
        }
77
        if (choicetotal >= 3)
78
        {
79
            draw_set_halign(fa_center);
80
            draw_text_ext(xx + 192, ((midy + 27) - 1) + 6, string_hash_to_newline(global.choicemsg[3]), 18, 320);
81
        }
82
        draw_set_halign(fa_left);
83
        draw_set_valign(fa_top);
84
        if (mychoice == 0)
85
            bhx = (xx + 154) - string_width(string_hash_to_newline(global.choicemsg[0])) - 20;
86
        if (mychoice == 1)
87
            bhx = (xx + 230) - 20;
88
        if (mychoice == 2)
89
        {
90
            bhx = (xx + 192) - round(string_width(string_hash_to_newline(global.choicemsg[2])) / 2) - 20;
91
            bhy = (midy - 38) + 1;
92
        }
93
        if (mychoice == 3)
94
        {
95
            bhx = (xx + 192) - round(string_width(string_hash_to_newline(global.choicemsg[3])) / 2) - 20;
96
            bhy = ((midy + 18) - 1) + 6;
97
        }
98
        draw_sprite_ext(heartSprite, 0, bhx, bhy, image_xscale, image_yscale, 0, heartCol, 1);
99
    }
100
}