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