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

@ -31,7 +31,7 @@ namespace gui {
$gui.set<Sound>(button, {sound});
$gui.set<Effect>(button, {.duration=0.5f, .name=effect_name});
$gui.set<Clickable>(button,
guecs::make_action($level, event, {action}));
guecs::make_action($level, button, event, {action}));
return button;
}
@ -67,7 +67,7 @@ namespace gui {
auto hp_gauge = $gui.entity("hp_gauge");
$gui.set<Sprite>(hp_gauge, {"stone_doll_cursed"});
$gui.set<Clickable>(hp_gauge,
guecs::make_action($level, Events::GUI::HP_STATUS, {}));
guecs::make_action($level, hp_gauge, Events::GUI::HP_STATUS, {}));
$gui.init();
}
@ -81,7 +81,7 @@ namespace gui {
init();
}
bool CombatUI::mouse(float x, float y, bool hover) {
return $gui.mouse(x, y, hover);
bool CombatUI::mouse(float x, float y, guecs::Modifiers mods) {
return $gui.mouse(x, y, mods);
}
}