You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
670 B
28 lines
670 B
3 weeks ago
|
#pragma once
|
||
|
#include "levelmanager.hpp"
|
||
|
#include <SFML/Graphics/RenderWindow.hpp>
|
||
|
#include <SFML/Graphics/Font.hpp>
|
||
|
#include "guecs.hpp"
|
||
|
|
||
|
namespace gui {
|
||
|
class OverlayUI {
|
||
|
public:
|
||
|
guecs::UI $gui;
|
||
|
GameLevel $level;
|
||
|
std::unordered_map<std::string, DinkyECS::Entity> $name_ents;
|
||
|
|
||
|
OverlayUI(GameLevel level);
|
||
|
|
||
|
void render(TexturePack& texture);
|
||
|
void draw(sf::RenderWindow& window);
|
||
|
void click(int x, int y);
|
||
|
|
||
|
template <typename Comp>
|
||
|
// this should be in the GUECS really
|
||
|
void set(std::string name, Comp val) {
|
||
|
auto ent = $name_ents.at(name);
|
||
|
$level.world->set<Comp>(ent, val);
|
||
|
}
|
||
|
};
|
||
|
}
|