Implement a way to map entities to their names, which comes up often enough.

This commit is contained in:
Zed A. Shaw 2025-07-07 10:54:23 -04:00
parent e1d61dc2c1
commit ad78c186c6
3 changed files with 12 additions and 0 deletions

View file

@ -153,7 +153,9 @@ struct CalculatorUI {
$gui.set<guecs::Background>($gui.MAIN, {$gui.$parser});
for(auto& [name, cell] : $gui.cells()) {
// NOTE: quick test here for the ent->name functionality
auto id = $gui.entity(name);
assert(name == $gui.name_for(id) && "BUG! name and entity don't match");
auto& label = LABELS.at(name);
$gui.set<guecs::Rectangle>(id, {});