paint: text import fixes

This commit is contained in:
luboslenco
2026-07-17 10:25:41 +02:00
parent 606a2f62d7
commit bf514afbe4
9 changed files with 102 additions and 36 deletions
-28
View File
@@ -1,28 +0,0 @@
#include "global.h"
void *plugin;
void *import_txt(char *path) {
void *b = data_get_blob(path);
string_array_t *a = string_split(path, "\\\\");
char *s = array_pop(a);
a = string_split(s, "/");
s = array_pop(a);
char *filename = s;
ui_box_show_message(filename, sys_buffer_to_string(b), true);
data_delete_blob(path);
return NULL;
}
void on_delete() {
plugin_unregister_texture("txt", import_txt);
}
void main() {
plugin = plugin_create();
gc_root(plugin);
plugin_notify_on_delete(plugin, on_delete);
plugin_register_texture("txt", import_txt);
}