Finally can pick things up, but it's really bad so far. Need a bunch of refactoring in how the collision system works, and make it so collision and maps can have multiple entities in the same square.
This commit is contained in:
parent
2458f01ebd
commit
2aa4f0a2e8
13 changed files with 78 additions and 43 deletions
|
@ -1,4 +1,5 @@
|
|||
#include "gui/overlay_ui.hpp"
|
||||
#include "gui/guecstra.hpp"
|
||||
#include "constants.hpp"
|
||||
#include "events.hpp"
|
||||
#include <optional>
|
||||
|
@ -17,6 +18,13 @@ namespace gui {
|
|||
|
||||
void OverlayUI::init() {
|
||||
$gui.init();
|
||||
auto bottom = $gui.entity("bottom");
|
||||
$gui.set<Clickable>(bottom, {
|
||||
[&](auto ent, auto data) {
|
||||
$level.world->send<Events::GUI>(
|
||||
Events::GUI::AIM_CLICK, ent, data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void OverlayUI::render(sf::RenderWindow& window) {
|
||||
|
@ -47,4 +55,9 @@ namespace gui {
|
|||
void OverlayUI::close_label(string region) {
|
||||
$gui.close<Label>(region);
|
||||
}
|
||||
|
||||
void OverlayUI::update_level(GameLevel level) {
|
||||
$level = level;
|
||||
// BUG: I think I have to redo the clickable
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue