- Volition VPP: Unified BE/LE types using inheritance pattern - THQA PAK: Child types now inherit byte order from parent - Various XScript definition updates and fixes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
879 B
Plaintext
37 lines
879 B
Plaintext
type menulist ui("Menu List")
|
|
{
|
|
const PTR_INLINE = -1;
|
|
|
|
i32 name_ptr ui("Name Ptr");
|
|
u32 menu_count ui("Menu Count");
|
|
i32 menus_ptr ui("Menus Ptr");
|
|
|
|
// Inline data
|
|
if (name_ptr == PTR_INLINE) {
|
|
name = cstring() ui("Name");
|
|
set_name(name);
|
|
}
|
|
|
|
// Menu definitions (complex - need two passes)
|
|
if (menus_ptr == PTR_INLINE && menu_count > 0) {
|
|
// First pass: parse all menu pointers
|
|
menu_ptrs = 0;
|
|
repeat(menu_count) {
|
|
_ptr = parse_here("menuptr");
|
|
menu_ptrs = push("menu_ptrs", _ptr);
|
|
}
|
|
|
|
// Second pass: parse menudefs for inline pointers
|
|
menus = 0;
|
|
repeat(menu_count) {
|
|
_ptr_obj = get(menu_ptrs, _i);
|
|
_ptr_val = get(_ptr_obj, "ptr");
|
|
if (_ptr_val == PTR_INLINE) {
|
|
_menu = parse_here("menudef");
|
|
menus = push("menus", _menu);
|
|
}
|
|
}
|
|
// Table: menus (columns: name)
|
|
}
|
|
}
|