Fixing more bugs related to percentages and then prototype a more complex UI.

This commit is contained in:
Zed A. Shaw 2025-02-15 22:14:19 -05:00
parent e106ad4be7
commit a7991a8f06
5 changed files with 45 additions and 20 deletions

View file

@ -3,16 +3,24 @@
#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)hp | _ | *%(200)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);