Skip to content

Commit

Permalink
Include unsupported types in component window
Browse files Browse the repository at this point in the history
  • Loading branch information
dextercd committed Oct 17, 2023
1 parent ac4a573 commit 22a0700
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions component-explorer/component_fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,16 @@ function show_field_material_pairs(name, description, component_id)
imgui.TreePop()
end

function show_field_unsupported(field_name, description, component_id, field_type)
imgui.Text(field_name .. " (" .. field_type .. ")")
imgui.SameLine()
exclam_marker("Field is unsupported. Let me know if you think this is a mistake")
if description then
imgui.SameLine()
help_marker(description)
end
end

local type_stored_in_vector = {"int", "float", "string"}

function show_field_unknown(name, type, description, component_id)
Expand Down
5 changes: 5 additions & 0 deletions component-explorer/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ function help_tooltip(desc)
end
end

function exclam_marker(desc)
imgui.TextDisabled("(!)")
help_tooltip(desc)
end

function help_marker(desc)
imgui.TextDisabled("(?)")
help_tooltip(desc)
Expand Down
1 change: 1 addition & 0 deletions components.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ function show_{{ component.name }}_fields(entity_id, component_id, data)
show_field_ro_list("{{ field.name }}", {{ description }}, component_id)
{% else %}
-- show_field_{{ field_type }}("{{ field.name }}", {{ description }}, component_id)
show_field_unsupported("{{ field.name }}", {{ description }}, component_id, "{{ field.type }}")
{% endif -%}

{% endfor %}
Expand Down

0 comments on commit 22a0700

Please sign in to comment.