2023-02-08 14:51:54 +01:00
|
|
|
|
2024-04-02 15:45:49 +02:00
|
|
|
let import_txt = function(path) {
|
|
|
|
|
let b = data_get_blob(path);
|
|
|
|
|
var filename = path.split('\\').pop().split('/').pop();
|
|
|
|
|
try {
|
|
|
|
|
ui_box_show_message(filename, sys_buffer_to_string(b), true);
|
|
|
|
|
ui_box_click_to_hide = false;
|
|
|
|
|
data_delete_blob(path);
|
|
|
|
|
}
|
|
|
|
|
catch(e) {
|
|
|
|
|
console.error(e);
|
|
|
|
|
}
|
2023-02-08 14:51:54 +01:00
|
|
|
}
|
|
|
|
|
|
2024-04-02 15:45:49 +02:00
|
|
|
let plugin = plugin_create();
|
|
|
|
|
let formats = path_texture_formats;
|
|
|
|
|
let importers = path_texture_importers;
|
2023-02-08 14:51:54 +01:00
|
|
|
formats.push("txt");
|
2024-01-21 09:53:08 +01:00
|
|
|
importers.set("txt", import_txt);
|
2023-02-08 14:51:54 +01:00
|
|
|
|
|
|
|
|
plugin.delete = function() {
|
|
|
|
|
formats.splice(formats.indexOf("txt"), 1);
|
2024-01-21 09:53:08 +01:00
|
|
|
importers.delete("txt");
|
2023-02-08 14:51:54 +01:00
|
|
|
};
|