#include "combat_ui.hpp" #include "constants.hpp" #include "color.hpp" #include "events.hpp" namespace gui { using namespace guecs; CombatUI::CombatUI(GameLevel level) : $level(level) { $gui.position(COMBAT_UI_X, COMBAT_UI_Y, COMBAT_UI_WIDTH, COMBAT_UI_HEIGHT); $gui.layout( "[*%(100,150)button_attack1 | *%(100,150)button_attack2 | *%(100,150)button_attack3 | *%(100,150)button_heal]" "[ >.%(100,50)label_hp | *%.(198,50)bar_hp | _ ]"); } void CombatUI::init() { auto& world = $gui.world(); world.set_the({$gui.$parser}); for(auto& [name, cell] : $gui.cells()) { if(name.starts_with("button_")) { auto button = $gui.entity(name); world.set(button, {}); world.set(button, guecs::make_action(*$level.world, Events::GUI::ATTACK)); world.set