Skip to content

Commit

Permalink
And also a tag count in heading
Browse files Browse the repository at this point in the history
  • Loading branch information
dextercd committed Oct 17, 2023
1 parent f98aee1 commit ac4a573
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions component-explorer/entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,13 @@ local function show_entity(entity_id, data)
end
end

if imgui.CollapsingHeader("Tags") then
local tag_string = EntityGetTags(entity_id)
---@cast tag_string string

local tags = {}
for tag in string.gmatch(tag_string, "[^,]+") do
table.insert(tags, tag)
end
local tag_string = EntityGetTags(entity_id) --[[@as string]]
local tags = {}
for tag in string.gmatch(tag_string, "[^,]+") do
table.insert(tags, tag)
end

if imgui.CollapsingHeader("Tags (" .. #tags .. ")") then
local function add_tag(t) EntityAddTag(entity_id, t) end
local function remove_tag(t) EntityRemoveTag(entity_id, t) end
tags_gui.show(data.tag_data, tags, add_tag, remove_tag, common_entity_tags)
Expand Down

0 comments on commit ac4a573

Please sign in to comment.