Bring back the convenience method to click on a cell by name.
This commit is contained in:
parent
4b4992185f
commit
41d568ab25
2 changed files with 5 additions and 0 deletions
|
@ -77,6 +77,7 @@ namespace guecs {
|
|||
void init();
|
||||
void render(sf::RenderWindow& window);
|
||||
bool mouse(float x, float y, Modifiers mods);
|
||||
void click_on(const std::string& name, Modifiers mods=NO_MODS);
|
||||
void click_on(Entity slot_id, Modifiers mods=NO_MODS);
|
||||
void debug_layout(sf::RenderWindow& window);
|
||||
|
||||
|
|
|
@ -220,6 +220,10 @@ namespace guecs {
|
|||
}
|
||||
}
|
||||
|
||||
void UI::click_on(const std::string& name, Modifiers mods) {
|
||||
click_on(entity(name), mods);
|
||||
}
|
||||
|
||||
void UI::click_on(Entity gui_id, Modifiers mods) {
|
||||
if(auto to_click = get_if<Clickable>(gui_id)) {
|
||||
to_click->action(mods);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue