Combat UI can now send events to the GUIwhen they click on buttons, and I've got a crappy wood texture for the buttons to test that.
This commit is contained in:
parent
722d55d948
commit
69a810b5a1
7 changed files with 38 additions and 20 deletions
|
@ -6,6 +6,8 @@
|
|||
#include <memory>
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "texture.hpp"
|
||||
#include <functional>
|
||||
#include "events.hpp"
|
||||
|
||||
namespace guecs {
|
||||
using std::shared_ptr, std::make_shared;
|
||||
|
@ -27,7 +29,7 @@ namespace guecs {
|
|||
};
|
||||
|
||||
struct Clickable {
|
||||
int event = 0;
|
||||
std::function<void(DinkyECS::Entity ent, std::string &name)> action;
|
||||
};
|
||||
|
||||
struct Sprite {
|
||||
|
@ -88,4 +90,6 @@ namespace guecs {
|
|||
void render(sf::RenderWindow& window);
|
||||
void mouse(sf::RenderWindow &window);
|
||||
};
|
||||
|
||||
Clickable make_action(DinkyECS::World& target, Events::GUI event);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue