Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_texture_page_handler

(view raw script w/o annotations or w/e)
1
function scr_texture_page_handler
scr_texture_page_handler

function scr_texture_page_handler() //gml_Script_scr_texture_page_handler { texture_prefetch("GeneralUse") texture_prefetch("MainMenu") texture_prefetch("BattleBase") var _assets_load_new_home = false var _assets_load_ruins = false var _assets_load_snowdin = false var _assets_load_dunes = false var _assets_load_wild_east = false var _assets_load_steamworks = false var _assets_load_waterfall = false var _assets_load_minigames = false var _assets_load_shop = false var _assets_load_hotland = false var _assets_load_mansion = false var _room_tag = asset_get_tags(room, 3) for (var i = 0; i < array_length(_room_tag); i++) { switch _room_tag[i] { case "Ruins": _assets_load_ruins = true break case "Snowdin": _assets_load_snowdin = true break case "Dunes": _assets_load_dunes = true break case "Wild East": _assets_load_wild_east = true break case "Steamworks": _assets_load_steamworks = true break case "Minigame": _assets_load_minigames = true break case "Waterfall": _assets_load_waterfall = true break case "Hotland": _assets_load_hotland = true break case "New Home": _assets_load_new_home = true break case "Mansion": _assets_load_new_home = true break case "Shop": _assets_load_shop = true break } } if (room == rm_battle) return; if (_assets_load_ruins == true) { if (!texture_is_ready("Ruins")) show_debug_message("Ruins Textures Loaded") if (!texture_is_ready("Ruins")) texture_prefetch("Ruins") if (!texture_is_ready("BattleRuins")) texture_prefetch("BattleRuins") } else { if texture_is_ready("Ruins") show_debug_message("Ruins Textures Flushed") if texture_is_ready("Ruins") texture_flush("Ruins") if texture_is_ready("BattleRuins") texture_flush("BattleRuins") } if (_assets_load_snowdin == true) { if (!texture_is_ready("Snowdin")) show_debug_message("Snowdin Textures Loaded") if (!texture_is_ready("Snowdin")) texture_prefetch("Snowdin") if (!texture_is_ready("BattleSnowdin")) texture_prefetch("BattleSnowdin") } else { if texture_is_ready("Snowdin") show_debug_message("Snowdin Textures Flushed") if texture_is_ready("Snowdin") texture_flush("Snowdin") if texture_is_ready("BattleSnowdin") texture_flush("BattleSnowdin") } if (_assets_load_waterfall == true) { if (!texture_is_ready("Waterfall")) show_debug_message("Waterfall Textures Loaded") if (!texture_is_ready("Waterfall")) texture_prefetch("Waterfall") ...
() //gml_Script_scr_texture_page_handler
2
{
3
    texture_prefetch("GeneralUse")
4
    texture_prefetch("MainMenu")
5
    texture_prefetch("BattleBase")
6
    var _assets_load_new_home = false
7
    var _assets_load_ruins = false
8
    var _assets_load_snowdin = false
9
    var _assets_load_dunes = false
10
    var _assets_load_wild_east = false
11
    var _assets_load_steamworks = false
12
    var _assets_load_waterfall = false
13
    var _assets_load_minigames = false
14
    var _assets_load_shop = false
15
    var _assets_load_hotland = false
16
    var _assets_load_mansion = false
17
    var _room_tag = asset_get_tags(room, 3)
18
    for (var i = 0; i < array_length(_room_tag); i++)
19
    {
20
        switch _room_tag[i]
21
        {
22
            case "Ruins":
23
                _assets_load_ruins = true
24
                break
25
            case "Snowdin":
26
                _assets_load_snowdin = true
27
                break
28
            case "Dunes":
29
                _assets_load_dunes = true
30
                break
31
            case "Wild East":
32
                _assets_load_wild_east = true
33
                break
34
            case "Steamworks":
35
                _assets_load_steamworks = true
36
                break
37
            case "Minigame":
38
                _assets_load_minigames = true
39
                break
40
            case "Waterfall":
41
                _assets_load_waterfall = true
42
                break
43
            case "Hotland":
44
                _assets_load_hotland = true
45
                break
46
            case "New Home":
47
                _assets_load_new_home = true
48
                break
49
            case "Mansion":
50
                _assets_load_new_home = true
51
                break
52
            case "Shop":
53
                _assets_load_shop = true
54
                break
55
        }
56
57
    }
58
    if (room == rm_battle)
59
        return;
60
    if (_assets_load_ruins == true)
61
    {
62
        if (!texture_is_ready("Ruins"))
63
            show_debug_message("Ruins Textures Loaded")
64
        if (!texture_is_ready("Ruins"))
65
            texture_prefetch("Ruins")
66
        if (!texture_is_ready("BattleRuins"))
67
            texture_prefetch("BattleRuins")
68
    }
69
    else
70
    {
71
        if texture_is_ready("Ruins")
72
            show_debug_message("Ruins Textures Flushed")
73
        if texture_is_ready("Ruins")
74
            texture_flush("Ruins")
75
        if texture_is_ready("BattleRuins")
76
            texture_flush("BattleRuins")
77
    }
78
    if (_assets_load_snowdin == true)
79
    {
80
        if (!texture_is_ready("Snowdin"))
81
            show_debug_message("Snowdin Textures Loaded")
82
        if (!texture_is_ready("Snowdin"))
83
            texture_prefetch("Snowdin")
84
        if (!texture_is_ready("BattleSnowdin"))
85
            texture_prefetch("BattleSnowdin")
86
    }
87
    else
88
    {
89
        if texture_is_ready("Snowdin")
90
            show_debug_message("Snowdin Textures Flushed")
91
        if texture_is_ready("Snowdin")
92
            texture_flush("Snowdin")
93
        if texture_is_ready("BattleSnowdin")
94
            texture_flush("BattleSnowdin")
95
    }
96
    if (_assets_load_waterfall == true)
97
    {
98
        if (!texture_is_ready("Waterfall"))
99
            show_debug_message("Waterfall Textures Loaded")
100
        if (!texture_is_ready("Waterfall"))
101
            texture_prefetch("Waterfall")
102
    }
103
    else
104
    {
105
        if texture_is_ready("Waterfall")
106
            show_debug_message("Waterfall Textures Flushed")
107
        if texture_is_ready("Waterfall")
108
            texture_flush("Waterfall")
109
    }
110
    if (_assets_load_dunes == true)
111
    {
112
        if (!texture_is_ready("Dunes"))
113
            show_debug_message("Dunes Textures Loaded")
114
        if (!texture_is_ready("Dunes"))
115
            texture_prefetch("Dunes")
116
        if (!texture_is_ready("BattleDunes"))
117
            texture_prefetch("BattleDunes")
118
    }
119
    else
120
    {
121
        if texture_is_ready("Dunes")
122
            show_debug_message("Dunes Textures Flushed")
123
        if texture_is_ready("Dunes")
124
            texture_flush("Dunes")
125
        if texture_is_ready("BattleDunes")
126
            texture_flush("BattleDunes")
127
    }
128
    if (_assets_load_wild_east == true)
129
    {
130
        if (!texture_is_ready("WildEast"))
131
            texture_prefetch("WildEast")
132
        if (!texture_is_ready("BattleWildEast"))
133
            texture_prefetch("BattleWildEast")
134
    }
135
    else
136
    {
137
        if texture_is_ready("WildEast")
138
            texture_flush("WildEast")
139
        if texture_is_ready("BattleWildEast")
140
            texture_flush("BattleWildEast")
141
    }
142
    if (_assets_load_steamworks == true)
143
    {
144
        if (!texture_is_ready("Steamworks"))
145
            texture_prefetch("Steamworks")
146
        if (!texture_is_ready("BattleSteamworks"))
147
            texture_prefetch("BattleSteamworks")
148
    }
149
    else
150
    {
151
        if texture_is_ready("Steamworks")
152
            texture_flush("Steamworks")
153
        if texture_is_ready("BattleSteamworks")
154
            texture_flush("BattleSteamworks")
155
    }
156
    if (_assets_load_hotland == true)
157
    {
158
        if (!texture_is_ready("Hotland"))
159
            texture_prefetch("Hotland")
160
    }
161
    else if texture_is_ready("Hotland")
162
        texture_flush("Hotland")
163
    if (_assets_load_new_home == true)
164
    {
165
        if (!texture_is_ready("newhome"))
166
            texture_prefetch("newhome")
167
        if (!texture_is_ready("Battlenewhome"))
168
            texture_prefetch("Battlenewhome")
169
    }
170
    else
171
    {
172
        if texture_is_ready("newhome")
173
            texture_flush("newhome")
174
        if (!texture_is_ready("Battlenewhome"))
175
            texture_flush("Battlenewhome")
176
    }
177
    if (_assets_load_mansion == true)
178
    {
179
        if (!texture_is_ready("Mansion"))
180
            texture_prefetch("Mansion")
181
    }
182
    else if texture_is_ready("Mansion")
183
        texture_flush("Mansion")
184
    if (_assets_load_minigames == true)
185
    {
186
        if (!texture_is_ready("Minigames"))
187
            texture_prefetch("Minigames")
188
    }
189
    else if texture_is_ready("Minigames")
190
        texture_flush("Minigames")
191
    if (_assets_load_shop == true)
192
    {
193
        if (!texture_is_ready("Shops"))
194
            texture_prefetch("Shops")
195
    }
196
    else if texture_is_ready("Shops")
197
        texture_flush("Shops")
198
}