Refactored the mouse handling to use the new guecss Modifiers system and improved Clickable.
This commit is contained in:
parent
ad0069e899
commit
a86912705c
20 changed files with 67 additions and 64 deletions
|
@ -31,7 +31,7 @@ namespace gui {
|
|||
$gui.set<guecs::Rectangle>(button, {});
|
||||
$gui.set<guecs::Text>(button, {label});
|
||||
$gui.set<guecs::Clickable>(button,
|
||||
guecs::make_action($level, event));
|
||||
guecs::make_action($level, button, event));
|
||||
}
|
||||
|
||||
void LootUI::init() {
|
||||
|
@ -52,7 +52,7 @@ namespace gui {
|
|||
THEME.TRANSPARENT, THEME.LIGHT_MID });
|
||||
$gui.set<guecs::Effect>(id, {0.4f, "ui_shader"});
|
||||
$gui.set<guecs::Clickable>(id, {
|
||||
guecs::make_action($level, Events::GUI::LOOT_SELECT, {id})
|
||||
guecs::make_action($level, id, Events::GUI::LOOT_SELECT, {id})
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -132,8 +132,8 @@ namespace gui {
|
|||
update();
|
||||
}
|
||||
|
||||
bool LootUI::mouse(float x, float y, bool hover) {
|
||||
return $gui.mouse(x, y, hover);
|
||||
bool LootUI::mouse(float x, float y, guecs::Modifiers mods) {
|
||||
return $gui.mouse(x, y, mods);
|
||||
}
|
||||
|
||||
bool LootUI::occupied(guecs::Entity slot) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue