Designer is working great now, and this fixes a bunch of things about the mouse.
This commit is contained in:
parent
f05f652c26
commit
ffc787df64
10 changed files with 4958 additions and 91 deletions
12
gui.cpp
12
gui.cpp
|
@ -178,6 +178,7 @@ bool GUI::handle_ui_events() {
|
|||
auto player = $world.get_the<Player>();
|
||||
int map_font_size = $renderer.font_size();
|
||||
auto& player_motion = $world.get<Motion>(player.entity);
|
||||
Point pos;
|
||||
|
||||
while($renderer.poll_event(event)) {
|
||||
if(event.type == sf::Event::Closed) {
|
||||
|
@ -203,15 +204,16 @@ bool GUI::handle_ui_events() {
|
|||
} else if(KB::isKeyPressed(KB::S)) {
|
||||
save_world();
|
||||
} else if(KB::isKeyPressed(KB::Tab)) {
|
||||
$status_ui.$component->OnEvent(Event::Tab);
|
||||
$status_ui.key_press(Event::Tab);
|
||||
} else if(KB::isKeyPressed(KB::Enter)) {
|
||||
$status_ui.$component->OnEvent(Event::Return);
|
||||
$status_ui.key_press(Event::Return);
|
||||
}
|
||||
} else if(MOUSE::isButtonPressed(MOUSE::Left)) {
|
||||
Point pos;
|
||||
if($renderer.mouse_position($status_ui, pos)) {
|
||||
} else if($renderer.mouse_position($status_ui, pos)) {
|
||||
if(MOUSE::isButtonPressed(MOUSE::Left)) {
|
||||
$status_ui.mouse_click(Mouse::Button::Left, pos);
|
||||
event_happened = true;
|
||||
} else {
|
||||
$status_ui.mouse_release(Mouse::Button::Left, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue