Skip to content

Commit

Permalink
Fix types::iaabb not working
Browse files Browse the repository at this point in the history
  • Loading branch information
dextercd committed Sep 10, 2024
1 parent 7f02c1b commit 3012913
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions component-explorer/component_fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 3012913

Please sign in to comment.