Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_chujin_tapes_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 = 165
9
else
10
    yy = 5
11
var xx = 20
12
var portrait_xx = 52
13
var line_sep = 18
14
draw_set_font(dialogue_font)
15
draw_set_color(c_white)
16
draw_set_halign(fa_left)
17
message_actual = string_copy(message[message_current], 0, cutoff)
18
draw_text_ext_transformed(xx, (yy + 10), string_hash_to_newline(message_actual), line_sep, -1, 1, 1, 0)
19
if (color == true)
20
{
21
    if (color_set == false)
22
    {
23
        for (var i = 0; i < (array_length_1d(message) - 1); i++)
24
        {
25
            var len = array_length_2d(message_col, i)
26
            if (len == 0)
27
                message_col[i][0] = ""
28
            else if (len > 0)
29
            {
30
                for (var j = 0; j < (array_length_1d(col_modif) - 1); j++)
31
                {
32
                    if (j < array_length_2d(message_col, i) && message_col[i][j] == 0)
33
                        message_col[i][j] = ""
34
                }
35
            }
36
        }
37
        color_set = true
38
    }
39
    for (j = 0; j < array_length_2d(message_col, message_current); j++)
40
    {
41
        message_actual_col[j] = string_copy(message_col[message_current][j], 0, cutoff)
42
        draw_set_color(col_modif[j])
43
        draw_text_ext(xx, (yy + 10), string_hash_to_newline(message_actual_col[j]), line_sep, -1)
44
    }
45
}
46
draw_set_color(c_white)
47
if (dialogue_is_minishop == true)
48
{
49
    var minishop_box_xx = 204
50
    var minishop_box_yy = 92
51
    draw_set_color(c_white)
52
    draw_rectangle(minishop_box_xx, minishop_box_yy, (minishop_box_xx + 100), (minishop_box_yy + 53), false)
53
    draw_set_color(c_black)
54
    draw_rectangle((minishop_box_xx + 3), (minishop_box_yy + 3), (minishop_box_xx + 100 - 3), (minishop_box_yy + 53 - 3), false)
55
    draw_set_font(fnt_battle)
56
    draw_set_color(c_white)
57
    var item_count = 1
58
    while (item_count <= 8)
59
    {
60
        if (global.item_slot[item_count] == "Nothing")
61
            break
62
        else
63
        {
64
            item_count++
65
            continue
66
        }
67
    }
68
    draw_text(217, 100, string_hash_to_newline("$ - " + string(global.player_gold) + "#SPACE - " + (string(item_count - 1)) + "/8"))
69
}
70
if (choice == false)
71
    return;
72
xx = 100
73
var spacing = 0.25
74
if (ch[4] != "")
75
    spacing = 0.5
76
if portrait
77
    spacing = 0.15
78
if (position == 0)
79
{
80
    var ypos1 = 190
81
    if (ch[3] == "")
82
        ypos1 = 210
83
    var ypos2 = 210
84
}
85
else
86
{
87
    ypos1 = 32
88
    if (ch[3] == "")
89
        ypos1 = 56
90
    ypos2 = 56
91
}
92
if (ch[4] != "")
93
    xx -= 30
94
var xpos1 = xx
95
var xpos2 = xx + 122
96
if (portrait == true)
97
    xpos1 += 20
98
var xpos3 = xpos1
99
var xpos4 = xpos2
100
if (ch[2] == "")
101
    xpos1 = xpos1 + 56
102
if (ch[4] == "")
103
    xpos3 = xpos1 + 56
104
if (cutoff >= string_length(message[message_current]))
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
    switch p
121
    {
122
        case 1:
123
            var soul_x = xpos1 - soul_offset - 8
124
            var soul_y = ypos1 + 8
125
            break
126
        case 2:
127
            soul_x = xpos2 - soul_offset - 8
128
            soul_y = ypos1 + 8
129
            break
130
        case 3:
131
            soul_x = xpos3 - soul_offset - 8
132
            soul_y = ypos2 + 8
133
            break
134
        case 4:
135
            soul_x = xpos4 - soul_offset - 8
136
            soul_y = ypos2 + 8
137
            break
138
    }
139
140
    draw_sprite(spr_heart_yellow_overworld, 0, soul_x, soul_y)
141
}
142
draw_set_halign(fa_left)