XPlor/definitions/cod/stringtable_asset.xscript

31 lines
878 B
Plaintext
Raw Normal View History

2026-01-01 22:18:40 -05:00
type stringtable_asset [display="String Table"]
{
i32 name_ptr [ui, readonly, display="Name Ptr"];
i32 column_count [ui, readonly, display="Column Count"];
i32 row_count [ui, readonly, display="Row Count"];
i32 values_ptr [ui, readonly, display="Values Ptr"];
// Parse inline name
2026-01-01 22:18:40 -05:00
if (name_ptr == -1) {
name = cstring() [ui, readonly, display="Name"];
_name = name;
2026-01-01 22:18:40 -05:00
}
// Parse string table values if inline
if (values_ptr == -1 && row_count > 0 && column_count > 0) {
cell_count = row_count * column_count;
2026-01-01 22:18:40 -05:00
// First read all cell pointers (each is 4 bytes)
_cell_ptrs_size = cell_count * 4;
cell_ptrs = read(_cell_ptrs_size) [ui, readonly, display="Cell Pointers"];
2026-01-01 22:18:40 -05:00
// Then read all cell string values
cells = 0;
2026-01-01 22:18:40 -05:00
repeat(cell_count) {
_cell_value = cstring();
cells = push("cells", _cell_value);
2026-01-01 22:18:40 -05:00
}
}
}