Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_buy_talk_shop_Step_0

(view raw script w/o annotations or w/e)
1
var shop_name = global.shop_name
2
if (action[message_current] != "Override")
3
{
4
    script_execute(gml_Script_scr_controls_text)
5
    if key_revert_pressed
6
    {
7
        characters = message_length
8
        message_draw = string_copy(message[message_current], 0, characters)
9
        if (shop_name == "Hotel Shop")
10
            message_draw_alt = string_copy(message_alt[message_current], 0, characters)
11
    }
12
    if (characters < message_length)
13
    {
14
        if (counter == 0)
15
        {
16
            script_execute(gml_Script_scr_text_increase)
17
            if (shop_name == "Hotel Shop")
18
            {
19
                message_draw_alt = string_copy(message_alt[message_current], 0, characters)
20
                var message_alt_length = string_length(message_alt[message_current])
21
                var message_og_length = string_length(message[message_current])
22
                if (message_alt_length > message_og_length)
23
                    current_char = string_char_at(message_draw_alt, characters)
24
            }
25
            script_execute(talk_script[message_current])
26
        }
27
        else
28
            can_talk = false
29
    }
30
    else
31
    {
32
        can_talk = false
33
        if key_select_pressed
34
        {
35
            if (message_current < message_end)
36
            {
37
                message_current += 1
38
                message_length = string_length(message[message_current])
39
                characters = 0
40
                message_draw = ""
41
                if (shop_name == "Hotel Shop")
42
                {
43
                    message_alt_length = string_length(message_alt[message_current])
44
                    if (message_alt_length > message_length)
45
                        message_length = message_alt_length
46
                    message_draw_alt = ""
47
                }
48
            }
49
        }
50
    }
51
    script_execute(gml_Script_scr_text_counter)
52
}