You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function load_asset_index(index_name, copy = false) {
30
+
31
+
// Loads an asset index.
32
+
33
+
// Open and parse asset index
34
+
var asset_index_path = assets_dir + "indexes\\" + "16.json"
35
+
if (!file_exists(asset_index_path)) {
36
+
show_message("The file for the specified asset index could not be found!")
37
+
return;
38
+
}
39
+
var file_buffer = buffer_load(asset_index_path);
40
+
var content = buffer_read(file_buffer, buffer_string);
41
+
buffer_delete(file_buffer);
42
+
43
+
// Get objects in asset index
44
+
var json = json_parse(content);
45
+
var objects = json[$ "objects"];
46
+
47
+
var count = 0;
48
+
var keys = variable_struct_get_names(objects);
49
+
50
+
var sounds_mc_subdir = sounds_directory + "minecraft";
51
+
52
+
if (directory_exists_lib(sounds_mc_subdir)) {
53
+
if (!message_yesnocancel("An existing folder with imported Minecraft sounds has been found in your Sounds folder. Would you like to replace it?", "Warning")) {
54
+
return;
55
+
} else {
56
+
directory_delete_lib(sounds_mc_subdir);
57
+
}
58
+
}
59
+
60
+
for (var i = array_length(keys) - 1; i >= 0; --i) {
61
+
var key = keys[i];
62
+
var value = objects[$ key];
63
+
64
+
if (string_count("minecraft/sounds/", key) == 0) {
0 commit comments