diff --git a/include/guecs/ui.hpp b/include/guecs/ui.hpp index 2d30731..af61965 100644 --- a/include/guecs/ui.hpp +++ b/include/guecs/ui.hpp @@ -26,13 +26,16 @@ namespace guecs { }; enum class ModBit { - hover=0, - left=1, - right=2 + NONE=0, + hover=1, + left=2, + right=3 }; using Modifiers = std::bitset<16>; + constexpr const Modifiers NO_MODS{size_t(ModBit::NONE)}; + struct Clickable { /* This is actually called by UI::mouse and passed the entity ID of the * button pressed so you can interact with it in the event handler. @@ -74,7 +77,7 @@ namespace guecs { void init(); void render(sf::RenderWindow& window); bool mouse(float x, float y, Modifiers mods); - void click_on(Entity slot_id, Modifiers mods); + void click_on(Entity slot_id, Modifiers mods=NO_MODS); void debug_layout(sf::RenderWindow& window); Entity entity() { return ++entity_count; }