2026-01-11 16:08:46 -05:00
|
|
|
type itemdef ui("Item Def")
|
2026-01-07 16:36:40 -05:00
|
|
|
{
|
2026-01-11 12:09:57 -05:00
|
|
|
const PTR_INLINE = -1;
|
2026-01-07 16:36:40 -05:00
|
|
|
|
2026-01-11 12:09:57 -05:00
|
|
|
// itemDef_s struct - ~368 bytes fixed
|
2026-01-07 16:36:40 -05:00
|
|
|
|
2026-01-11 12:09:57 -05:00
|
|
|
// WindowDef_t embedded
|
2026-01-11 16:08:46 -05:00
|
|
|
window = parse_here("windowdef") ui("Window");
|
2026-01-07 16:36:40 -05:00
|
|
|
|
2026-01-11 12:09:57 -05:00
|
|
|
// Text Rect
|
2026-01-11 16:08:46 -05:00
|
|
|
text_rect = parse_here("rectdef") ui("Text Rect");
|
2026-01-07 16:36:40 -05:00
|
|
|
|
2026-01-11 12:09:57 -05:00
|
|
|
// Item Properties
|
2026-01-11 16:08:46 -05:00
|
|
|
i32 item_type ui("Type");
|
|
|
|
|
i32 data_type ui("Data Type");
|
|
|
|
|
i32 alignment ui("Alignment");
|
|
|
|
|
i32 font_enum ui("Font Enum");
|
|
|
|
|
i32 text_align_mode ui("Text Align Mode");
|
|
|
|
|
f32 text_align_x ui("Text Align X");
|
|
|
|
|
f32 text_align_y ui("Text Align Y");
|
|
|
|
|
f32 text_scale ui("Text Scale");
|
|
|
|
|
i32 text_style ui("Text Style");
|
|
|
|
|
i32 game_msg_window_index ui("Game Msg Window Index");
|
|
|
|
|
i32 game_msg_window_mode ui("Game Msg Window Mode");
|
2026-01-07 16:36:40 -05:00
|
|
|
|
|
|
|
|
// Pointers
|
2026-01-11 16:08:46 -05:00
|
|
|
i32 text_ptr ui("Text Ptr");
|
|
|
|
|
i32 item_flags ui("Item Flags");
|
|
|
|
|
i32 parent_ptr ui("Parent Ptr");
|
|
|
|
|
i32 mouse_enter_text_ptr ui("Mouse Enter Text Ptr");
|
|
|
|
|
i32 mouse_exit_text_ptr ui("Mouse Exit Text Ptr");
|
|
|
|
|
i32 mouse_enter_ptr ui("Mouse Enter Ptr");
|
|
|
|
|
i32 mouse_exit_ptr ui("Mouse Exit Ptr");
|
|
|
|
|
i32 action_ptr ui("Action Ptr");
|
|
|
|
|
i32 on_accept_ptr ui("On Accept Ptr");
|
|
|
|
|
i32 on_focus_ptr ui("On Focus Ptr");
|
|
|
|
|
i32 leave_focus_ptr ui("Leave Focus Ptr");
|
|
|
|
|
i32 dvar_ptr ui("Dvar Ptr");
|
|
|
|
|
i32 dvar_test_ptr ui("Dvar Test Ptr");
|
|
|
|
|
i32 on_key_ptr ui("On Key Ptr");
|
|
|
|
|
i32 enable_dvar_ptr ui("Enable Dvar Ptr");
|
|
|
|
|
i32 dvar_flags ui("Dvar Flags");
|
|
|
|
|
i32 focus_sound_ptr ui("Focus Sound Ptr");
|
|
|
|
|
f32 special ui("Special");
|
|
|
|
|
i32 cursor_pos ui("Cursor Pos");
|
|
|
|
|
i32 type_data_ptr ui("Type Data Ptr");
|
|
|
|
|
i32 image_track ui("Image Track");
|
2026-01-11 12:09:57 -05:00
|
|
|
|
|
|
|
|
// Expressions
|
2026-01-11 16:08:46 -05:00
|
|
|
visible_exp = parse_here("statement") ui("Visible Exp");
|
|
|
|
|
text_exp = parse_here("statement") ui("Text Exp");
|
|
|
|
|
material_exp = parse_here("statement") ui("Material Exp");
|
|
|
|
|
rect_x_exp = parse_here("statement") ui("Rect X Exp");
|
|
|
|
|
rect_y_exp = parse_here("statement") ui("Rect Y Exp");
|
|
|
|
|
rect_w_exp = parse_here("statement") ui("Rect W Exp");
|
|
|
|
|
rect_h_exp = parse_here("statement") ui("Rect H Exp");
|
|
|
|
|
forecolor_a_exp = parse_here("statement") ui("Forecolor A Exp");
|
2026-01-11 12:09:57 -05:00
|
|
|
|
|
|
|
|
// ============ INLINE DATA ============
|
|
|
|
|
|
|
|
|
|
// Window inline data
|
|
|
|
|
_win_name_ptr = get(window, "name_ptr");
|
|
|
|
|
if (_win_name_ptr == PTR_INLINE) {
|
2026-01-11 16:08:46 -05:00
|
|
|
name = cstring() ui("Name");
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
|
2026-01-11 12:09:57 -05:00
|
|
|
_win_group_ptr = get(window, "group_ptr");
|
|
|
|
|
if (_win_group_ptr == PTR_INLINE) {
|
2026-01-11 16:08:46 -05:00
|
|
|
group = cstring() ui("Group");
|
2026-01-11 12:09:57 -05:00
|
|
|
}
|
2026-01-07 16:36:40 -05:00
|
|
|
|
2026-01-11 12:09:57 -05:00
|
|
|
_win_bg_ptr = get(window, "background_ptr");
|
|
|
|
|
if (_win_bg_ptr == PTR_INLINE) {
|
2026-01-11 16:08:46 -05:00
|
|
|
background = parse_here("material") ui("Background");
|
2026-01-11 12:09:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Simple inline strings
|
2026-01-11 16:08:46 -05:00
|
|
|
if (text_ptr == PTR_INLINE) {
|
|
|
|
|
text = cstring() ui("Text");
|
|
|
|
|
}
|
|
|
|
|
if (mouse_enter_text_ptr == PTR_INLINE) {
|
|
|
|
|
mouse_enter_text = cstring() ui("Mouse Enter Text");
|
|
|
|
|
}
|
|
|
|
|
if (mouse_exit_text_ptr == PTR_INLINE) {
|
|
|
|
|
mouse_exit_text = cstring() ui("Mouse Exit Text");
|
|
|
|
|
}
|
|
|
|
|
if (mouse_enter_ptr == PTR_INLINE) {
|
|
|
|
|
mouse_enter = cstring() ui("Mouse Enter");
|
|
|
|
|
}
|
|
|
|
|
if (mouse_exit_ptr == PTR_INLINE) {
|
|
|
|
|
mouse_exit = cstring() ui("Mouse Exit");
|
|
|
|
|
}
|
|
|
|
|
if (action_ptr == PTR_INLINE) {
|
|
|
|
|
action = cstring() ui("Action");
|
|
|
|
|
}
|
|
|
|
|
if (on_accept_ptr == PTR_INLINE) {
|
|
|
|
|
on_accept = cstring() ui("On Accept");
|
|
|
|
|
}
|
|
|
|
|
if (on_focus_ptr == PTR_INLINE) {
|
|
|
|
|
on_focus = cstring() ui("On Focus");
|
|
|
|
|
}
|
|
|
|
|
if (leave_focus_ptr == PTR_INLINE) {
|
|
|
|
|
leave_focus = cstring() ui("Leave Focus");
|
|
|
|
|
}
|
|
|
|
|
if (dvar_ptr == PTR_INLINE) {
|
|
|
|
|
dvar = cstring() ui("Dvar");
|
|
|
|
|
}
|
|
|
|
|
if (dvar_test_ptr == PTR_INLINE) {
|
|
|
|
|
dvar_test = cstring() ui("Dvar Test");
|
|
|
|
|
}
|
|
|
|
|
if (on_key_ptr == PTR_INLINE) {
|
|
|
|
|
on_key = parse_here("itemkeyhandler") ui("On Key");
|
|
|
|
|
}
|
|
|
|
|
if (enable_dvar_ptr == PTR_INLINE) {
|
|
|
|
|
enable_dvar = cstring() ui("Enable Dvar");
|
|
|
|
|
}
|
|
|
|
|
if (focus_sound_ptr == PTR_INLINE) {
|
|
|
|
|
focus_sound = parse_here("sound") ui("Focus Sound");
|
|
|
|
|
}
|
2026-01-11 12:09:57 -05:00
|
|
|
|
|
|
|
|
// Type-specific data
|
|
|
|
|
if (type_data_ptr == PTR_INLINE) {
|
|
|
|
|
match(item_type) {
|
|
|
|
|
6 => {
|
2026-01-11 16:08:46 -05:00
|
|
|
type_data = parse_here("listboxdef") ui("List Box Data");
|
2026-01-11 12:09:57 -05:00
|
|
|
}
|
|
|
|
|
4 | 9 | 16 | 17 | 18 => {
|
2026-01-11 16:08:46 -05:00
|
|
|
type_data = parse_here("editfielddef") ui("Edit Field Data");
|
2026-01-11 12:09:57 -05:00
|
|
|
}
|
|
|
|
|
12 => {
|
2026-01-11 16:08:46 -05:00
|
|
|
type_data = parse_here("multidef") ui("Multi Data");
|
2026-01-11 12:09:57 -05:00
|
|
|
}
|
|
|
|
|
13 => {
|
2026-01-11 16:08:46 -05:00
|
|
|
type_data = cstring() ui("Enum Dvar Name");
|
2026-01-11 12:09:57 -05:00
|
|
|
}
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-11 12:09:57 -05:00
|
|
|
// Expression entries (complex patterns - need ptr array first)
|
2026-01-07 16:36:40 -05:00
|
|
|
_vis_num = get(visible_exp, "num_entries");
|
|
|
|
|
_vis_ptr = get(visible_exp, "entries_ptr");
|
2026-01-11 12:09:57 -05:00
|
|
|
if (_vis_ptr == PTR_INLINE && _vis_num > 0) {
|
|
|
|
|
skip _vis_num * 4;
|
|
|
|
|
array[_vis_num] vis_entries: expressionentry;
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_txt_num = get(text_exp, "num_entries");
|
|
|
|
|
_txt_ptr = get(text_exp, "entries_ptr");
|
2026-01-11 12:09:57 -05:00
|
|
|
if (_txt_ptr == PTR_INLINE && _txt_num > 0) {
|
|
|
|
|
skip _txt_num * 4;
|
|
|
|
|
array[_txt_num] txt_entries: expressionentry;
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_mat_num = get(material_exp, "num_entries");
|
|
|
|
|
_mat_ptr = get(material_exp, "entries_ptr");
|
2026-01-11 12:09:57 -05:00
|
|
|
if (_mat_ptr == PTR_INLINE && _mat_num > 0) {
|
|
|
|
|
skip _mat_num * 4;
|
|
|
|
|
array[_mat_num] mat_entries: expressionentry;
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_rx_num = get(rect_x_exp, "num_entries");
|
|
|
|
|
_rx_ptr = get(rect_x_exp, "entries_ptr");
|
2026-01-11 12:09:57 -05:00
|
|
|
if (_rx_ptr == PTR_INLINE && _rx_num > 0) {
|
|
|
|
|
skip _rx_num * 4;
|
|
|
|
|
array[_rx_num] rx_entries: expressionentry;
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_ry_num = get(rect_y_exp, "num_entries");
|
|
|
|
|
_ry_ptr = get(rect_y_exp, "entries_ptr");
|
2026-01-11 12:09:57 -05:00
|
|
|
if (_ry_ptr == PTR_INLINE && _ry_num > 0) {
|
|
|
|
|
skip _ry_num * 4;
|
|
|
|
|
array[_ry_num] ry_entries: expressionentry;
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_rw_num = get(rect_w_exp, "num_entries");
|
|
|
|
|
_rw_ptr = get(rect_w_exp, "entries_ptr");
|
2026-01-11 12:09:57 -05:00
|
|
|
if (_rw_ptr == PTR_INLINE && _rw_num > 0) {
|
|
|
|
|
skip _rw_num * 4;
|
|
|
|
|
array[_rw_num] rw_entries: expressionentry;
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_rh_num = get(rect_h_exp, "num_entries");
|
|
|
|
|
_rh_ptr = get(rect_h_exp, "entries_ptr");
|
2026-01-11 12:09:57 -05:00
|
|
|
if (_rh_ptr == PTR_INLINE && _rh_num > 0) {
|
|
|
|
|
skip _rh_num * 4;
|
|
|
|
|
array[_rh_num] rh_entries: expressionentry;
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_fc_num = get(forecolor_a_exp, "num_entries");
|
|
|
|
|
_fc_ptr = get(forecolor_a_exp, "entries_ptr");
|
2026-01-11 12:09:57 -05:00
|
|
|
if (_fc_ptr == PTR_INLINE && _fc_num > 0) {
|
|
|
|
|
skip _fc_num * 4;
|
|
|
|
|
array[_fc_num] fc_entries: expressionentry;
|
2026-01-07 16:36:40 -05:00
|
|
|
}
|
|
|
|
|
}
|