mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add "Show Hitboxes" to the debug panel
This commit is contained in:
parent
9efb327270
commit
5522cfc231
3 changed files with 16 additions and 1 deletions
|
|
@ -33,6 +33,7 @@ static std::shared_ptr<Label> create_label(wstringsupplier supplier) {
|
|||
return label;
|
||||
}
|
||||
|
||||
// TODO: move to xml
|
||||
std::shared_ptr<UINode> create_debug_panel(
|
||||
Engine* engine,
|
||||
Level* level,
|
||||
|
|
@ -181,6 +182,18 @@ std::shared_ptr<UINode> create_debug_panel(
|
|||
});
|
||||
panel->add(checkbox);
|
||||
}
|
||||
{
|
||||
auto checkbox = std::make_shared<FullCheckBox>(
|
||||
L"Show Hitboxes", glm::vec2(400, 24)
|
||||
);
|
||||
checkbox->setSupplier([=]() {
|
||||
return WorldRenderer::showEntitiesDebug;
|
||||
});
|
||||
checkbox->setConsumer([=](bool checked) {
|
||||
WorldRenderer::showEntitiesDebug = checked;
|
||||
});
|
||||
panel->add(checkbox);
|
||||
}
|
||||
panel->refresh();
|
||||
return panel;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue