XPlor/definitions/cod/rawfile.xscript
njohnson f3bca6871e Update COD XScript definitions with new syntax
- Migrate from set_global/get_global to ctx_set/ctx_get
- Replace if-else chains with match() expressions
- Update inline pointer handling patterns
- Improve GfxWorld and asset parsing structures
- Clean up redundant code across 60+ definition files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 12:09:57 -05:00

25 lines
512 B
Plaintext

type rawfile [display="Raw File"]
{
const PTR_INLINE = -1;
i32 name_ptr;
i32 len;
i32 buffer_ptr;
ui("name_ptr", "Name Ptr");
ui("len", "Length");
ui("buffer_ptr", "Buffer Ptr");
// Inline data
inline cstring name when name_ptr [ui="Name", set_name];
// 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", "Raw Data");
set_viewer("text");
set_text(ascii(raw_data));
}
}