Deltarune (Chapter 3) 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 (global.msc == 1409 && global.lang == "ja")
10
        drawstyle = 2;
11
    if (drawstyle == 0)
12
        
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");
13
    if (drawstyle == 1)
14
        draw_set_font(
scr_84_get_font
scr_84_get_font

function
scr_84_get_font(arg0)
{ if (!variable_global_exists("chemg_last_get_font")) global.chemg_last_get_font = ""; if (arg0 != global.chemg_last_get_font) global.chemg_last_get_font = arg0; return ds_map_find_value(global.font_map, arg0); }
("8bit"));
15
    if (drawstyle == 2)
16
        
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");
17
    textx = xx;
18
    texty = yy;
19
    if (drawstyle == 0)
20
    {
21
        for (var i = 0; i < (choicetotal + 1); i += 1)
22
        {
23
            draw_set_color((mychoice == i) ? c_yellow : c_white);
24
            textx = textposx[i];
25
            texty = textposy[i];
26
            draw_text(textx, texty, string_hash_to_newline(global.choicemsg[i]));
27
        }
28
        draw_sprite_ext(heartSprite, 0, hx, hy, image_xscale, image_yscale, 0, c_white, 1);
29
    }
30
    if (drawstyle == 1)
31
    {
32
        var midy = (yy + 60) - 1;
33
        var bhx = xx + 182;
34
        var bhy = midy - 8;
35
        if (global.lang == "ja")
36
            bhy += 4;
37
        draw_set_valign(fa_middle);
38
        draw_set_halign(fa_right);
39
        draw_text_ext(xx + 154, midy, string_hash_to_newline(global.choicemsg[0]), 18, 320);
40
        draw_set_halign(fa_left);
41
        draw_text_ext(xx + 230, midy, string_hash_to_newline(global.choicemsg[1]), 18, 320);
42
        if (choicetotal >= 2)
43
        {
44
            draw_set_halign(fa_center);
45
            draw_text_ext(xx + 192, (midy - 29) + 1, string_hash_to_newline(global.choicemsg[2]), 18, 320);
46
        }
47
        if (choicetotal >= 3)
48
        {
49
            draw_set_halign(fa_center);
50
            draw_text_ext(xx + 192, ((midy + 27) - 1) + 6, string_hash_to_newline(global.choicemsg[3]), 18, 320);
51
        }
52
        draw_set_halign(fa_left);
53
        draw_set_valign(fa_top);
54
        if (mychoice == 0)
55
            bhx = (xx + 154) - string_width(string_hash_to_newline(global.choicemsg[0])) - 20;
56
        if (mychoice == 1)
57
            bhx = (xx + 230) - 20;
58
        if (mychoice == 2)
59
        {
60
            bhx = (xx + 192) - round(string_width(string_hash_to_newline(global.choicemsg[2])) / 2) - 20;
61
            bhy = (midy - 38) + 1;
62
        }
63
        if (mychoice == 3)
64
        {
65
            bhx = (xx + 192) - round(string_width(string_hash_to_newline(global.choicemsg[3])) / 2) - 20;
66
            bhy = ((midy + 18) - 1) + 6;
67
        }
68
        if (choicerstyle == 1)
69
            bhy -= 2;
70
        draw_sprite_ext(heartSprite, 0, bhx, bhy, image_xscale, image_yscale, 0, c_white, 1);
71
    }
72
    if (drawstyle == 2)
73
    {
74
        text_pos = [];
75
        text_pos[0][0] = 0;
76
        text_pos[0][1] = 20;
77
        text_pos[1][0] = 0;
78
        text_pos[1][1] = 0;
79
        text_pos[2][0] = 30;
80
        text_pos[2][1] = 0;
81
        text_pos[3][0] = 0;
82
        text_pos[3][1] = 0;
83
        for (var i = 0; i < (choicetotal + 1); i += 1)
84
        {
85
            var choice_color = (mychoice == i) ? 65535 : 16777215;
86
            draw_set_color(choice_color);
87
            var x_offset = text_pos[i][0];
88
            var y_offset = text_pos[i][1];
89
            textx = textposx[i] + x_offset;
90
            texty = textposy[i] + y_offset;
91
            draw_text(textx, texty, string_hash_to_newline(global.choicemsg[i]));
92
            draw_set_color(c_white);
93
        }
94
        var heart_x_offset = 0;
95
        if (mychoice == 2)
96
            heart_x_offset = 30;
97
        draw_sprite_ext(heartSprite, 0, hx + heart_x_offset, hy, image_xscale, image_yscale, 0, c_white, 1);
98
    }
99
}