| 67 | } |
| 68 | |
| 69 | void BaseScriptPane::tick(float dt) { |
| 70 | Pane::tick(dt); |
| 71 | |
| 72 | for (auto p : m_canvasClickCallbacks) { |
| 73 | for (auto const& clickEvent : p.first->pullClickEvents()) |
| 74 | m_script.invoke(p.second, jsonFromVec2I(clickEvent.position), (uint8_t)clickEvent.button, clickEvent.buttonDown); |
| 75 | } |
| 76 | for (auto p : m_canvasKeyCallbacks) { |
| 77 | for (auto const& keyEvent : p.first->pullKeyEvents()) |
| 78 | m_script.invoke(p.second, (int)keyEvent.key, keyEvent.keyDown, KeyNames.getRight(keyEvent.key)); |
| 79 | } |
| 80 | |
| 81 | m_script.update(m_script.updateDt(dt)); |
| 82 | } |
| 83 | |
| 84 | bool BaseScriptPane::sendEvent(InputEvent const& event) { |
| 85 | // Intercept GuiClose before the canvas child so GuiClose always closes |
nothing calls this directly
no test coverage detected