Separate out the major UIs to get ready for their development, and enable debug button.

This commit is contained in:
Zed A. Shaw 2025-02-13 10:55:45 -05:00
parent 7eec67ffc8
commit 9b3b81683a
11 changed files with 154 additions and 116 deletions

36
gui.hpp
View file

@ -7,41 +7,10 @@
#include "fsm.hpp"
#include "render.hpp"
#include "map_view.hpp"
#include <ftxui/dom/elements.hpp> // for hflow, paragraph, separator, hbox, vbox, filler, operator|, border, Element
#include "combat_ui.hpp"
#include "status_ui.hpp"
namespace gui {
class StatusUI : public Panel {
public:
GameLevel $level;
StatusUI(GameLevel level) :
Panel(43, 200, 29, 25, false),
$level(level)
{
default_bg = sf::Color{30,30,30};
}
void create_render();
void update_level(GameLevel &level) { $level = level; }
};
class CombatUI : public Panel {
public:
GameLevel $level;
Component $attack1_button;
Component $attack2_button;
CombatUI(GameLevel level) :
Panel(RAY_VIEW_X, RAY_VIEW_HEIGHT, 89, 6, false),
$level(level)
{
default_bg = sf::Color{30,30,30};
}
void create_render();
void update_level(GameLevel &level) { $level = level; }
};
enum class State {
START,
MOVING,
@ -72,6 +41,7 @@ namespace gui {
// ZED: these two will go away soon
int $rotation_count = 0;
float $rotation = -10.0f;
bool $draw_stats = false;
Point $player{0,0};
LevelManager $levels;
sf::RenderWindow $window;