Add new asset type definitions: - GfxWorld and related structures (cells, lights, probes) - Menu system (menudef, itemdef, windowdef, listboxdef) - Sound system (soundalias, soundfile, speakermap, sndcurve) - D3D resources (vertex/index buffers) - Font glyphs and expression entries Update existing definitions with improved field annotations and UI display properties. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
252 lines
8.9 KiB
Plaintext
252 lines
8.9 KiB
Plaintext
type itemdef [display="Item Def"]
|
|
{
|
|
// itemDef_s struct from IW3_Assets.h
|
|
// Total fixed size: ~368 bytes
|
|
|
|
// ============ WindowDef_t embedded (156 bytes) ============
|
|
window = parse_here("windowdef") [display="Window"];
|
|
|
|
// ============ Text Rect (24 bytes) ============
|
|
text_rect = parse_here("rectdef") [display="Text Rect"];
|
|
|
|
// ============ Item Properties ============
|
|
i32 item_type [ui, readonly, display="Type"];
|
|
i32 data_type [ui, readonly, display="Data Type"];
|
|
i32 alignment [ui, readonly, display="Alignment"];
|
|
i32 font_enum [ui, readonly, display="Font Enum"];
|
|
i32 text_align_mode [ui, readonly, display="Text Align Mode"];
|
|
|
|
f32 text_align_x [ui, readonly, display="Text Align X"];
|
|
f32 text_align_y [ui, readonly, display="Text Align Y"];
|
|
f32 text_scale [ui, readonly, display="Text Scale"];
|
|
|
|
i32 text_style [ui, readonly, display="Text Style"];
|
|
i32 game_msg_window_index [ui, readonly, display="Game Msg Window Index"];
|
|
i32 game_msg_window_mode [ui, readonly, display="Game Msg Window Mode"];
|
|
|
|
// Pointers
|
|
i32 text_ptr [ui, readonly, display="Text Ptr"];
|
|
i32 item_flags [ui, readonly, display="Item Flags"];
|
|
i32 parent_ptr [ui, readonly, display="Parent Ptr"];
|
|
|
|
i32 mouse_enter_text_ptr [ui, readonly, display="Mouse Enter Text Ptr"];
|
|
i32 mouse_exit_text_ptr [ui, readonly, display="Mouse Exit Text Ptr"];
|
|
i32 mouse_enter_ptr [ui, readonly, display="Mouse Enter Ptr"];
|
|
i32 mouse_exit_ptr [ui, readonly, display="Mouse Exit Ptr"];
|
|
i32 action_ptr [ui, readonly, display="Action Ptr"];
|
|
i32 on_accept_ptr [ui, readonly, display="On Accept Ptr"];
|
|
i32 on_focus_ptr [ui, readonly, display="On Focus Ptr"];
|
|
i32 leave_focus_ptr [ui, readonly, display="Leave Focus Ptr"];
|
|
|
|
i32 dvar_ptr [ui, readonly, display="Dvar Ptr"];
|
|
i32 dvar_test_ptr [ui, readonly, display="Dvar Test Ptr"];
|
|
i32 on_key_ptr [ui, readonly, display="On Key Ptr"];
|
|
i32 enable_dvar_ptr [ui, readonly, display="Enable Dvar Ptr"];
|
|
i32 dvar_flags [ui, readonly, display="Dvar Flags"];
|
|
|
|
i32 focus_sound_ptr [ui, readonly, display="Focus Sound Ptr"];
|
|
f32 special [ui, readonly, display="Special"];
|
|
i32 cursor_pos [ui, readonly, display="Cursor Pos"];
|
|
|
|
i32 type_data_ptr [ui, readonly, display="Type Data Ptr"];
|
|
i32 image_track [ui, readonly, display="Image Track"];
|
|
|
|
// ============ Expressions (8 x statement_s = 64 bytes) ============
|
|
visible_exp = parse_here("statement") [display="Visible Exp"];
|
|
text_exp = parse_here("statement") [display="Text Exp"];
|
|
material_exp = parse_here("statement") [display="Material Exp"];
|
|
rect_x_exp = parse_here("statement") [display="Rect X Exp"];
|
|
rect_y_exp = parse_here("statement") [display="Rect Y Exp"];
|
|
rect_w_exp = parse_here("statement") [display="Rect W Exp"];
|
|
rect_h_exp = parse_here("statement") [display="Rect H Exp"];
|
|
forecolor_a_exp = parse_here("statement") [display="Forecolor A Exp"];
|
|
|
|
// ============================================================
|
|
// INLINE DATA PARSING (zone file streaming order)
|
|
// ============================================================
|
|
|
|
// 1. Window name (if name_ptr == -1)
|
|
_win_name_ptr = get(window, "name_ptr");
|
|
if (_win_name_ptr == -1) {
|
|
name = cstring() [ui, readonly, display="Name"];
|
|
}
|
|
|
|
// 2. Window group (if group_ptr == -1)
|
|
_win_group_ptr = get(window, "group_ptr");
|
|
if (_win_group_ptr == -1) {
|
|
group = cstring() [ui, readonly, display="Group"];
|
|
}
|
|
|
|
// 3. Window background Material (if background_ptr == -1)
|
|
_win_bg_ptr = get(window, "background_ptr");
|
|
if (_win_bg_ptr == -1) {
|
|
background = parse_here("material") [display="Background"];
|
|
}
|
|
|
|
// 4. Text string (if text_ptr == -1)
|
|
if (text_ptr == -1) {
|
|
text = cstring() [ui, readonly, display="Text"];
|
|
}
|
|
|
|
// 5. Mouse/action handlers (if ptr == -1)
|
|
if (mouse_enter_text_ptr == -1) {
|
|
mouse_enter_text = cstring() [ui, readonly, display="Mouse Enter Text"];
|
|
}
|
|
if (mouse_exit_text_ptr == -1) {
|
|
mouse_exit_text = cstring() [ui, readonly, display="Mouse Exit Text"];
|
|
}
|
|
if (mouse_enter_ptr == -1) {
|
|
mouse_enter = cstring() [ui, readonly, display="Mouse Enter"];
|
|
}
|
|
if (mouse_exit_ptr == -1) {
|
|
mouse_exit = cstring() [ui, readonly, display="Mouse Exit"];
|
|
}
|
|
if (action_ptr == -1) {
|
|
action = cstring() [ui, readonly, display="Action"];
|
|
}
|
|
if (on_accept_ptr == -1) {
|
|
on_accept = cstring() [ui, readonly, display="On Accept"];
|
|
}
|
|
if (on_focus_ptr == -1) {
|
|
on_focus = cstring() [ui, readonly, display="On Focus"];
|
|
}
|
|
if (leave_focus_ptr == -1) {
|
|
leave_focus = cstring() [ui, readonly, display="Leave Focus"];
|
|
}
|
|
|
|
// 6. Dvar strings (if ptr == -1)
|
|
if (dvar_ptr == -1) {
|
|
dvar = cstring() [ui, readonly, display="Dvar"];
|
|
}
|
|
if (dvar_test_ptr == -1) {
|
|
dvar_test = cstring() [ui, readonly, display="Dvar Test"];
|
|
}
|
|
|
|
// 7. OnKey handler (if on_key_ptr == -1)
|
|
if (on_key_ptr == -1) {
|
|
on_key = parse_here("itemkeyhandler") [display="On Key"];
|
|
}
|
|
|
|
// 8. Enable dvar (if enable_dvar_ptr == -1)
|
|
if (enable_dvar_ptr == -1) {
|
|
enable_dvar = cstring() [ui, readonly, display="Enable Dvar"];
|
|
}
|
|
|
|
// 9. Focus sound (if focus_sound_ptr == -1)
|
|
if (focus_sound_ptr == -1) {
|
|
focus_sound = parse_here("sound") [display="Focus Sound"];
|
|
}
|
|
|
|
|
|
// 10. Type-specific data (typeData)
|
|
// ITEM_TYPE_LISTBOX = 6
|
|
// ITEM_TYPE_EDITFIELD = 4, NUMERICFIELD = 9, VALIDFILEFIELD = 16, DECIMALFIELD = 17, UPREDITFIELD = 18
|
|
// ITEM_TYPE_MULTI = 12
|
|
// ITEM_TYPE_DVARENUM = 13
|
|
if (type_data_ptr == -1) {
|
|
if (item_type == 6) {
|
|
type_data = parse_here("listboxdef") [display="List Box Data"];
|
|
}
|
|
if (item_type == 4 || item_type == 9 || item_type == 16 || item_type == 17 || item_type == 18) {
|
|
type_data = parse_here("editfielddef") [display="Edit Field Data"];
|
|
}
|
|
if (item_type == 12) {
|
|
type_data = parse_here("multidef") [display="Multi Data"];
|
|
}
|
|
if (item_type == 13) {
|
|
type_data = cstring() [ui, readonly, display="Enum Dvar Name"];
|
|
}
|
|
}
|
|
|
|
// ============ Expression Entries ============
|
|
// Parse expression entries for all 8 statements
|
|
|
|
// 11. Visible expression entries
|
|
_vis_num = get(visible_exp, "num_entries");
|
|
_vis_ptr = get(visible_exp, "entries_ptr");
|
|
if (_vis_ptr == -1 && _vis_num > 0) {
|
|
_vis_ptr_size = _vis_num * 4;
|
|
_vis_ptrs = read(_vis_ptr_size) [display="Visible Entry Ptrs"];
|
|
repeat(_vis_num) {
|
|
_vis_entry = parse_here("expressionentry") [display="Visible Entry"];
|
|
}
|
|
}
|
|
|
|
// 12. Text expression entries
|
|
_txt_num = get(text_exp, "num_entries");
|
|
_txt_ptr = get(text_exp, "entries_ptr");
|
|
if (_txt_ptr == -1 && _txt_num > 0) {
|
|
_txt_ptr_size = _txt_num * 4;
|
|
_txt_ptrs = read(_txt_ptr_size) [display="Text Entry Ptrs"];
|
|
repeat(_txt_num) {
|
|
_txt_entry = parse_here("expressionentry") [display="Text Entry"];
|
|
}
|
|
}
|
|
|
|
// 13. Material expression entries
|
|
_mat_num = get(material_exp, "num_entries");
|
|
_mat_ptr = get(material_exp, "entries_ptr");
|
|
if (_mat_ptr == -1 && _mat_num > 0) {
|
|
_mat_ptr_size = _mat_num * 4;
|
|
_mat_ptrs = read(_mat_ptr_size) [display="Material Entry Ptrs"];
|
|
repeat(_mat_num) {
|
|
_mat_entry = parse_here("expressionentry") [display="Material Entry"];
|
|
}
|
|
}
|
|
|
|
// 14. Rect X expression entries
|
|
_rx_num = get(rect_x_exp, "num_entries");
|
|
_rx_ptr = get(rect_x_exp, "entries_ptr");
|
|
if (_rx_ptr == -1 && _rx_num > 0) {
|
|
_rx_ptr_size = _rx_num * 4;
|
|
_rx_ptrs = read(_rx_ptr_size) [display="Rect X Entry Ptrs"];
|
|
repeat(_rx_num) {
|
|
_rx_entry = parse_here("expressionentry") [display="Rect X Entry"];
|
|
}
|
|
}
|
|
|
|
// 15. Rect Y expression entries
|
|
_ry_num = get(rect_y_exp, "num_entries");
|
|
_ry_ptr = get(rect_y_exp, "entries_ptr");
|
|
if (_ry_ptr == -1 && _ry_num > 0) {
|
|
_ry_ptr_size = _ry_num * 4;
|
|
_ry_ptrs = read(_ry_ptr_size) [display="Rect Y Entry Ptrs"];
|
|
repeat(_ry_num) {
|
|
_ry_entry = parse_here("expressionentry") [display="Rect Y Entry"];
|
|
}
|
|
}
|
|
|
|
// 16. Rect W expression entries
|
|
_rw_num = get(rect_w_exp, "num_entries");
|
|
_rw_ptr = get(rect_w_exp, "entries_ptr");
|
|
if (_rw_ptr == -1 && _rw_num > 0) {
|
|
_rw_ptr_size = _rw_num * 4;
|
|
_rw_ptrs = read(_rw_ptr_size) [display="Rect W Entry Ptrs"];
|
|
repeat(_rw_num) {
|
|
_rw_entry = parse_here("expressionentry") [display="Rect W Entry"];
|
|
}
|
|
}
|
|
|
|
// 17. Rect H expression entries
|
|
_rh_num = get(rect_h_exp, "num_entries");
|
|
_rh_ptr = get(rect_h_exp, "entries_ptr");
|
|
if (_rh_ptr == -1 && _rh_num > 0) {
|
|
_rh_ptr_size = _rh_num * 4;
|
|
_rh_ptrs = read(_rh_ptr_size) [display="Rect H Entry Ptrs"];
|
|
repeat(_rh_num) {
|
|
_rh_entry = parse_here("expressionentry") [display="Rect H Entry"];
|
|
}
|
|
}
|
|
|
|
// 18. Forecolor A expression entries
|
|
_fc_num = get(forecolor_a_exp, "num_entries");
|
|
_fc_ptr = get(forecolor_a_exp, "entries_ptr");
|
|
if (_fc_ptr == -1 && _fc_num > 0) {
|
|
_fc_ptr_size = _fc_num * 4;
|
|
_fc_ptrs = read(_fc_ptr_size) [display="Forecolor A Entry Ptrs"];
|
|
repeat(_fc_num) {
|
|
_fc_entry = parse_here("expressionentry") [display="Forecolor A Entry"];
|
|
}
|
|
}
|
|
}
|