Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_axis_hindered_Draw_64

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
if (message_current > (array_length_1d(prt) - 1) || prt[message_current] == 0)
4
    portrait = false;
5
else
6
    portrait = true;
7
if (position == 0)
8
    yy = 160;
9
else
10
    yy = 5;
11
var xx = 90;
12
var portrait_xx = 52;
13
var line_sep = 18;
14
scr_draw_dialogue_box_anywhere
scr_draw_dialogue_box_anywhere

function scr_draw_dialogue_box_anywhere(arg0, arg1, arg2, arg3) { var xs1 = arg0; var ys1 = arg1; bsize = arg2; var xs2 = xs1 + bsize; var ys2 = ys1 + bsize; var xx = arg3; var yy; if (position == 0) yy = 198; else yy = 45; draw_sprite_ext(spr_dialoguebox, 1, xx, yy, xs2, ys2, image_angle, c_white, image_alpha); draw_sprite_ext(spr_dialoguebox, 0, xx, yy, xs1, ys1, image_angle, image_blend, image_alpha); }
(2.4, 1.09375, 0.1, 160);
15
draw_set_font(dialogue_font);
16
draw_set_color(c_white);
17
draw_set_halign(fa_left);
18
message_actual = string_copy(message[message_current], 0, cutoff);
19
draw_text_ext(xx, yy + 10, string_hash_to_newline(message_actual), line_sep, -1);
20
if (color == true)
21
{
22
    if (color_set == false)
23
    {
24
        for (var i = 0; i < (array_length_1d(message) - 1); i++)
25
        {
26
            var len = array_length_2d(message_col, i);
27
            if (len == 0)
28
            {
29
                message_col[i][0] = "";
30
            }
31
            else if (len > 0)
32
            {
33
                for (var j = 0; j < (array_length_1d(col_modif) - 1); j++)
34
                {
35
                    if (j < array_length_2d(message_col, i) && message_col[i][j] == 0)
36
                        message_col[i][j] = "";
37
                }
38
            }
39
        }
40
        color_set = true;
41
    }
42
    for (var j = 0; j < array_length_2d(message_col, message_current); j++)
43
    {
44
        message_actual_col[j] = string_copy(message_col[message_current][j], 0, cutoff);
45
        draw_set_color(col_modif[j]);
46
        draw_text_ext(xx, yy + 10, string_hash_to_newline(message_actual_col[j]), line_sep, -1);
47
    }
48
}
49
draw_set_color(c_white);
50
if (dialogue_is_minishop == true)
51
{
52
    var minishop_box_xx = 204;
53
    var minishop_box_yy = 92;
54
    draw_set_color(c_white);
55
    draw_rectangle(minishop_box_xx, minishop_box_yy, minishop_box_xx + 100, minishop_box_yy + 53, false);
56
    draw_set_color(c_black);
57
    draw_rectangle(minishop_box_xx + 3, minishop_box_yy + 3, (minishop_box_xx + 100) - 3, (minishop_box_yy + 53) - 3, false);
58
    draw_set_font(fnt_battle);
59
    draw_set_color(c_white);
60
    var item_count;
61
    for (item_count = 1; item_count <= 8; item_count++)
62
    {
63
        if (global.item_slot[item_count] == "Nothing")
64
            break;
65
    }
66
    draw_text(217, 100, string_hash_to_newline("$ - " + string(global.player_gold) + "#SPACE - " + string(item_count - 1) + "/8"));
67
}
68
if (choice == false && alpha_fade == false)
69
    exit;
70
xx = 100;
71
var spacing = 0.25;
72
if (ch[4] != "")
73
    spacing = 0.5;
74
if (portrait)
75
    spacing = 0.15;
76
var ypos1, ypos2;
77
if (position == 0)
78
{
79
    ypos1 = 190;
80
    if (ch[3] == "")
81
        ypos1 = 210;
82
    ypos2 = 210;
83
}
84
else
85
{
86
    ypos1 = 32;
87
    if (ch[3] == "")
88
        ypos1 = 56;
89
    ypos2 = 56;
90
}
91
if (ch[4] != "")
92
    xx -= 30;
93
var xpos1 = xx;
94
var xpos2 = xx + 122;
95
if (portrait == true)
96
    xpos1 += 20;
97
var xpos3 = xpos1;
98
var xpos4 = xpos2;
99
if (ch[2] == "")
100
    xpos1 = xpos1 + 56;
101
if (ch[4] == "")
102
    xpos3 = xpos1 + 56;
103
draw_set_alpha(ch_alpha);
104
if (cutoff >= string_length(message[message_current]) && global.dialogue_open == true)
105
{
106
    draw_set_halign(fa_center);
107
    if (ch[4] != "")
108
        draw_set_halign(fa_left);
109
    draw_text(xpos1, ypos1, string_hash_to_newline(ch[1]));
110
    if (ch[2] != "")
111
        draw_text(xpos2, ypos1, string_hash_to_newline(ch[2]));
112
    if (ch[3] != "")
113
        draw_text(xpos3, ypos2, string_hash_to_newline(ch[3]));
114
    if (ch[4] != "")
115
        draw_text(xpos4, ypos2, string_hash_to_newline(ch[4]));
116
    draw_set_halign(fa_center);
117
    var soul_offset = string_width(string_hash_to_newline(ch[p])) * 0.5;
118
    if (ch[4] != "")
119
        soul_offset = 0;
120
    var soul_x, soul_y;
121
    switch (p)
122
    {
123
        case 1:
124
            soul_x = xpos1 - soul_offset - 8;
125
            soul_y = ypos1 + 8;
126
            break;
127
        case 2:
128
            soul_x = xpos2 - soul_offset - 8;
129
            soul_y = ypos1 + 8;
130
            break;
131
        case 3:
132
            soul_x = xpos3 - soul_offset - 8;
133
            soul_y = ypos2 + 8;
134
            break;
135
        case 4:
136
            soul_x = xpos4 - soul_offset - 8;
137
            soul_y = ypos2 + 8;
138
            break;
139
    }
140
    draw_sprite(spr_heart_yellow_overworld, 0, soul_x, soul_y);
141
}
142
draw_set_alpha(1);
143
draw_set_halign(fa_left);