Initial idea for the boss fight UI but it's just a temporary holder for now.

This commit is contained in:
Zed A. Shaw 2025-02-27 15:24:17 -05:00
parent a72d2879fd
commit 64807174c0
16 changed files with 165 additions and 36 deletions

View file

@ -15,7 +15,7 @@ namespace gui {
"[ >.%(100,50)label_hp | *%.(198,50)bar_hp | _ ]");
}
void CombatUI::render() {
void CombatUI::init() {
auto& world = $gui.world();
world.set_the<Background>({$gui.$parser});
@ -40,7 +40,7 @@ namespace gui {
$gui.init();
}
void CombatUI::draw(sf::RenderWindow& window) {
void CombatUI::render(sf::RenderWindow& window) {
auto& player_combat = $level.world->get<components::Combat>($level.player);
set_damage(float(player_combat.hp) / float(player_combat.max_hp));
$gui.render(window);
@ -53,6 +53,6 @@ namespace gui {
void CombatUI::update_level(GameLevel &level) {
$level = level;
render();
init();
}
}