From 30129138a5f35785e1b9d0ba97d84fd5ce623877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dexter=20Castor=20D=C3=B6pping?= Date: Tue, 10 Sep 2024 20:04:38 +0200 Subject: [PATCH] Fix types::iaabb not working --- component-explorer/component_fields.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/component-explorer/component_fields.lua b/component-explorer/component_fields.lua index a63bd32..af1db1b 100644 --- a/component-explorer/component_fields.lua +++ b/component-explorer/component_fields.lua @@ -305,6 +305,23 @@ function show_field_types_aabb(name, description, component_id) end end +function show_field_types_iaabb(name, description, component_id) + local min_x, min_y, max_x, max_y = ComponentGetValue2(component_id, name) + + local c1, c2 + c1, min_x, min_y = imgui.InputInt2(name .. " min", min_x, min_y) + if description then + imgui.SameLine() + help.marker(description) + end + + c2, max_x, max_y = imgui.InputInt2(name .. " max", max_x, max_y) + + if c1 or c2 then + ComponentSetValue2(component_id, name, min_x, min_y, max_x, max_y) + end +end + function show_field_spread_aabb(prefix, description, component_id) local min_x = ComponentGetValue2(component_id, prefix .. "_min_x") local min_y = ComponentGetValue2(component_id, prefix .. "_min_y")