diff --git a/battle.cpp b/battle.cpp index 4709f3d..e6066e7 100644 --- a/battle.cpp +++ b/battle.cpp @@ -15,10 +15,8 @@ namespace combat { if(enemy.ai.active()) { if(enemy.ai.wants_to("kill_enemy")) { - fmt::println(">> enemy {} wants to KILL", entity); pending_actions.emplace_back(enemy, BattleAction::ATTACK); } else if(enemy.ai.wants_to("run_away")) { - fmt::println(">> enemy {} wants to RUN", entity); pending_actions.emplace_back(enemy, BattleAction::ESCAPE); } } diff --git a/boss/ui.cpp b/boss/ui.cpp index 588c8d7..cb1954e 100644 --- a/boss/ui.cpp +++ b/boss/ui.cpp @@ -1,24 +1,32 @@ #include "boss/ui.hpp" +#include "constants.hpp" namespace boss { - UI::UI(shared_ptr world, Entity boss_id) { - (void)world; - (void)boss_id; + UI::UI(shared_ptr world, Entity boss_id) + : $world(world), $boss_id(boss_id) + { } void UI::init() { - + $gui.position(SCREEN_WIDTH-BOSS_VIEW_WIDTH,0, BOSS_VIEW_WIDTH, SCREEN_HEIGHT); + $gui.layout( + "[a1|b1|c1|d1|e1|f1]" + "[a2|b2|c2|d2|e2|f2]" + "[a3|b3|c3|d3|e3|f3]" + "[a4|b4|c4|d4|e4|f4]" + "[a5|b5|c5|d5|e5|f5]" + "[a6|b6|c6|d6|e6|f6]" + ); + $gui.init(); } void UI::render(sf::RenderWindow& window) { - (void)window; + $gui.render(window); + $gui.debug_layout(window); } bool UI::mouse(float x, float y, guecs::Modifiers mods) { - (void)x; - (void)y; - (void)mods; - return false; + return $gui.mouse(x, y, mods); } bool UI::boss_dead() { diff --git a/boss/ui.hpp b/boss/ui.hpp index 86f2ac7..7dff84e 100644 --- a/boss/ui.hpp +++ b/boss/ui.hpp @@ -9,6 +9,9 @@ namespace boss { using namespace DinkyECS; struct UI { + shared_ptr $world = nullptr; + Entity $boss_id = NONE; + guecs::UI $gui; UI(shared_ptr world, Entity boss_id);