Combat UI can now send events to the GUIwhen they click on buttons, and I've got a crappy wood texture for the buttons to test that.

This commit is contained in:
Zed A. Shaw 2025-02-18 14:24:57 -05:00
parent 722d55d948
commit 69a810b5a1
7 changed files with 38 additions and 20 deletions

View file

@ -77,10 +77,15 @@ namespace guecs {
(pos.y >= cell.y && pos.y <= cell.y + cell.h))
{
auto& cn = $world.get<CellName>(ent);
fmt::println("clicked on entity {} with name {} and event {}",
ent, cn.name, clicked.event);
clicked.action(ent, cn.name);
}
});
}
}
Clickable make_action(DinkyECS::World& target, Events::GUI event) {
return {[&, event](auto ent, auto&){
target.send<Events::GUI>(event, ent, {});
}};
}
}