diff --git a/boss/ui.cpp b/boss/ui.cpp index e28ae35..e37f83c 100644 --- a/boss/ui.cpp +++ b/boss/ui.cpp @@ -53,6 +53,7 @@ namespace boss { auto stats = $actions.entity("stats"); $actions.set(stats, {}); $actions.set(stats, {L"stats"}); + $actions.set(stats, {}); $actions.init(); @@ -70,20 +71,28 @@ namespace boss { } void UI::render(sf::RenderWindow& window) { - $arena.render(window); $actions.render(window); $combat_ui.render(window); + $arena.render(window); + window.draw(*$floor_sprite.sprite); window.draw(*$boss_sprite.sprite); window.draw(*$player_sprite.sprite); + // $arena.debug_layout(window); } bool UI::mouse(float x, float y, Modifiers mods) { - return $actions.mouse(x, y, mods); + return $arena.mouse(x, y, mods) + || $combat_ui.mouse(x, y, mods) + || $actions.mouse(x, y, mods); } bool UI::boss_dead() { return false; } + + void UI::run_systems() { + // does nothing yet + } } diff --git a/boss/ui.hpp b/boss/ui.hpp index a908b1c..faf84ab 100644 --- a/boss/ui.hpp +++ b/boss/ui.hpp @@ -33,5 +33,6 @@ namespace boss { bool mouse(float x, float y, guecs::Modifiers mods); void position_sprite(SpriteTexture& st, const std::string& name, float scale, bool at_mid=false); bool boss_dead(); + void run_systems(); }; } diff --git a/gui/fsm.cpp b/gui/fsm.cpp index 0900018..be11acf 100644 --- a/gui/fsm.cpp +++ b/gui/fsm.cpp @@ -226,8 +226,18 @@ namespace gui { event(Event::BOSS_END); } } break; + case ATTACK: + fmt::println("ATTACK THE BOSS!"); + break; + case MOUSE_MOVE: { + sf::Vector2f pos = mouse_position(); + $boss_fight_ui->mouse(pos.x, pos.y, {1 << guecs::ModBit::hover}); + } break; + case TICK: + $boss_fight_ui->run_systems(); + break; default: - break; // do nothing for now + fmt::println("BOSS_FIGHT unknown event {}", (int)ev); } }