Refactored the mouse handling to use the new guecss Modifiers system and improved Clickable.

This commit is contained in:
Zed A. Shaw 2025-08-14 14:10:28 -04:00
parent ad0069e899
commit a86912705c
20 changed files with 67 additions and 64 deletions

View file

@ -35,7 +35,9 @@ namespace gui {
void DebugUI::add_spawn_button(std::string enemy_key, std::string sprite_name, std::string region) {
auto button = $gui.entity(region);
$gui.set<guecs::Clickable>(button, { [this, enemy_key](auto, auto){ spawn(enemy_key); } });
$gui.set<guecs::Clickable>(button, {
[this, enemy_key](auto){ spawn(enemy_key); }
});
$gui.set<guecs::Sprite>(button, { sprite_name});
}
@ -91,8 +93,8 @@ namespace gui {
}
}
bool DebugUI::mouse(float x, float y, bool hover) {
return $gui.mouse(x, y, hover);
bool DebugUI::mouse(float x, float y, guecs::Modifiers mods) {
return $gui.mouse(x, y, mods);
}
Stats::TimeBullshit DebugUI::time_start() {