Tests are now clean so next step is to officially nuke the level manager.
This commit is contained in:
parent
564f9842a2
commit
5aca2fb56a
8 changed files with 47 additions and 72 deletions
|
@ -18,23 +18,22 @@ namespace gui {
|
|||
$gui.init();
|
||||
}
|
||||
|
||||
inline void make_clickable_area(std::shared_ptr<DinkyECS::World> world, guecs::UI &gui, const std::string &name) {
|
||||
inline void make_clickable_area(guecs::UI &gui, const std::string &name) {
|
||||
auto area = gui.entity(name);
|
||||
|
||||
gui.set<Clickable>(area, {
|
||||
[&](auto) {
|
||||
auto world = Game::current_world();
|
||||
world->send<Events::GUI>(Events::GUI::AIM_CLICK, area, {});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void OverlayUI::init() {
|
||||
auto world = Game::current_world();
|
||||
|
||||
// gui.init is in the constructor
|
||||
make_clickable_area(world, $gui, "top");
|
||||
make_clickable_area(world, $gui, "middle");
|
||||
make_clickable_area(world, $gui, "bottom");
|
||||
make_clickable_area($gui, "top");
|
||||
make_clickable_area($gui, "middle");
|
||||
make_clickable_area($gui, "bottom");
|
||||
}
|
||||
|
||||
void OverlayUI::render(sf::RenderWindow& window) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue