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:
Zed A. Shaw 2025-02-18 14:24:57 -05:00
parent 722d55d948
commit 69a810b5a1
7 changed files with 38 additions and 20 deletions

View file

@ -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);
}