diff --git a/gui.cpp b/gui.cpp index 9530428..ba8e526 100644 --- a/gui.cpp +++ b/gui.cpp @@ -200,6 +200,13 @@ bool GUI::handle_ui_events() { } else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Enter)) { $status_ui.$component->OnEvent(Event::Return); } + } else if(sf::Mouse::isButtonPressed(sf::Mouse::Left)) { + sf::Vector2i pos = sf::Mouse::getPosition($renderer.$window); + Mouse mev; + mev.button = Mouse::Button::Left, + mev.x=pos.x / $renderer.$ui_bounds.width; // this needs to be in...panel coordinates? + mev.y=pos.y / $renderer.$ui_bounds.height; + $status_ui.$component->OnEvent(Event::Mouse("", mev)); } }