XPlor/definitions/cod/rawfile.xscript

23 lines
476 B
Plaintext
Raw Normal View History

type rawfile ui("Raw File")
2026-01-01 22:18:40 -05:00
{
const PTR_INLINE = -1;
2026-01-01 22:18:40 -05:00
i32 name_ptr ui("Name Ptr");
i32 len ui("Length");
i32 buffer_ptr ui("Buffer Ptr");
// Inline data
if (name_ptr == PTR_INLINE) {
name = cstring() ui("Name");
set_name(name);
}
2026-01-01 22:18:40 -05:00
// Data buffer (if inline) - read len + 1 bytes for null terminator
if (buffer_ptr == PTR_INLINE && len > 0) {
raw_data = read(len + 1) ui("Raw Data");
set_viewer("text");
set_text(ascii(raw_data));
2026-01-01 22:18:40 -05:00
}
}