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
|
@ -35,17 +35,17 @@ namespace gui {
|
|||
$gui.set<Sprite>(gui_id, {"armored_knight"});
|
||||
} else {
|
||||
$gui.set<Rectangle>(gui_id, {});
|
||||
$gui.set<ActionData>(gui_id, {make_any<string>(name)});
|
||||
dbc::log("!!!!!!!!!!!!!!!!! is this used: $gui.set<ActionData>(gui_id, {make_any<string>(name)});");
|
||||
|
||||
if(name == "ritual_ui") {
|
||||
$gui.set<Clickable>(gui_id, {
|
||||
[this](auto, auto){ select_ritual(); }
|
||||
[this](auto){ select_ritual(); }
|
||||
});
|
||||
$gui.set<Sound>(gui_id, {"pickup"});
|
||||
} else {
|
||||
$gui.set<Text>(gui_id, {guecs::to_wstring(name)});
|
||||
$gui.set<Clickable>(gui_id, {
|
||||
guecs::make_action($level, Events::GUI::INV_SELECT, {gui_id})
|
||||
guecs::make_action($level, gui_id, Events::GUI::INV_SELECT, {gui_id})
|
||||
});
|
||||
$gui.set<DropTarget>(gui_id, {
|
||||
.commit=[&, gui_id](DinkyECS::Entity world_target) -> bool {
|
||||
|
@ -61,11 +61,11 @@ namespace gui {
|
|||
update();
|
||||
}
|
||||
|
||||
bool StatusUI::mouse(float x, float y, bool hover) {
|
||||
bool StatusUI::mouse(float x, float y, guecs::Modifiers mods) {
|
||||
if($ritual_ui.is_open()) {
|
||||
return $ritual_ui.mouse(x, y, hover);
|
||||
return $ritual_ui.mouse(x, y, mods);
|
||||
} else {
|
||||
return $gui.mouse(x, y, hover);
|
||||
return $gui.mouse(x, y, mods);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue