Implements multiple mouse event improvements for UI elements: - Mouse enter/exit events (#140): on_enter, on_exit callbacks and hovered property for all UIDrawable types (Frame, Caption, Sprite, Grid) - Headless click events (#111): Track simulated mouse position for automation testing in headless mode - Mouse move events (#141): on_move callback fires continuously while mouse is within element bounds - Grid cell events (#142): on_cell_enter, on_cell_exit, on_cell_click callbacks with cell coordinates (x, y), plus hovered_cell property Includes comprehensive tests for all new functionality. Closes #140, closes #111, closes #141, closes #142 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
21 lines
493 B
C++
21 lines
493 B
C++
#pragma once
|
|
|
|
#include "Common.h"
|
|
#include "Scene.h"
|
|
#include "GameEngine.h"
|
|
|
|
class PyScene: public Scene
|
|
{
|
|
|
|
public:
|
|
PyScene(GameEngine*);
|
|
void update() override final;
|
|
void doAction(std::string, std::string) override final;
|
|
void render() override final;
|
|
|
|
void do_mouse_input(std::string, std::string);
|
|
void do_mouse_hover(int x, int y); // #140 - Mouse enter/exit tracking
|
|
|
|
// Dirty flag for z_index sorting optimization
|
|
bool ui_elements_need_sort = true;
|
|
};
|