Python command emulation

This commit is contained in:
John McCardle 2025-07-03 10:43:17 -04:00
commit 763fa201f0
17 changed files with 704 additions and 74 deletions

View file

@ -21,6 +21,11 @@ void PyScene::update()
void PyScene::do_mouse_input(std::string button, std::string type)
{
// In headless mode, mouse input is not available
if (game->isHeadless()) {
return;
}
auto unscaledmousepos = sf::Mouse::getPosition(game->getWindow());
auto mousepos = game->getWindow().mapPixelToCoords(unscaledmousepos);
UIDrawable* target;
@ -62,7 +67,7 @@ void PyScene::doAction(std::string name, std::string type)
void PyScene::render()
{
game->getWindow().clear();
game->getRenderTarget().clear();
auto vec = *ui_elements;
for (auto e: vec)
@ -71,5 +76,5 @@ void PyScene::render()
e->render();
}
game->getWindow().display();
// Display is handled by GameEngine
}