|
|
|
#pragma once
|
|
|
|
#include "panel.hpp"
|
|
|
|
#include "levelmanager.hpp"
|
|
|
|
#include <SFML/Graphics/RenderWindow.hpp>
|
|
|
|
#include <SFML/Graphics/RectangleShape.hpp>
|
|
|
|
#include <SFML/Graphics/Font.hpp>
|
|
|
|
#include <SFML/Graphics/Text.hpp>
|
|
|
|
#include "lel.hpp"
|
|
|
|
|
|
|
|
namespace gui {
|
|
|
|
class CombatUI {
|
|
|
|
public:
|
|
|
|
std::string $grid =
|
|
|
|
"[*%(200,90)hp | _ | *%(200,90)ap | _ ]"
|
|
|
|
"[attack1 | attack2 | attack3 | heal]";
|
|
|
|
lel::Parser $layout;
|
|
|
|
GameLevel $level;
|
|
|
|
sf::Font $font;
|
|
|
|
std::unordered_map<std::string, sf::RectangleShape> $shapes;
|
|
|
|
std::vector<sf::Text> $labels;
|
|
|
|
CombatUI(GameLevel level);
|
|
|
|
|
|
|
|
void render();
|
|
|
|
void draw(sf::RenderWindow& window);
|
|
|
|
void update_level(GameLevel &level) { $level = level; }
|
|
|
|
void click(int x, int y);
|
|
|
|
};
|
|
|
|
}
|