Have an initial start screen and simple prototypes for other screens.

This commit is contained in:
Zed A. Shaw 2026-04-01 15:31:36 -04:00
parent e113c0bc97
commit d03020cfef
8 changed files with 139 additions and 53 deletions

View file

@ -11,10 +11,12 @@
#include "gui/event_router.hpp"
#include "gui/dnd_loot.hpp"
#include "events.hpp"
#include "gui/scene_ui.hpp"
namespace gui {
enum class State {
START=__LINE__,
START_SCREEN=__LINE__,
MOVING=__LINE__,
ATTACKING=__LINE__,
ROTATING=__LINE__,
@ -27,7 +29,6 @@ namespace gui {
public:
sf::RenderWindow $window;
bool $draw_stats = false;
bool autowalking = false;
DebugUI $debug_ui;
MainUI $main_ui;
StatusUI $status_ui{STATUS_UI_X, STATUS_UI_Y, STATUS_UI_WIDTH, STATUS_UI_HEIGHT};
@ -35,17 +36,26 @@ namespace gui {
gui::routing::Router $router;
DNDLoot $dnd_loot;
System::Registry $systems;
std::unordered_map<std::string, std::shared_ptr<gui::SceneUI>> $scenes{
{"STARTING", std::make_shared<gui::SceneUI>("STARTING")},
{"DEATH", std::make_shared<gui::SceneUI>("DEATH")},
{"WIN", std::make_shared<gui::SceneUI>("WIN")},
{"NEXT_LEVEL", std::make_shared<gui::SceneUI>("NEXT_LEVEL")},
};
std::shared_ptr<gui::SceneUI> $cur_scene = nullptr;
FSM();
void event(game::Event ev, std::any data={});
void START(game::Event ev);
void START_SCREEN(game::Event ev);
void IDLE(game::Event ev, std::any data);
void MOVING(game::Event ev);
void ATTACKING(game::Event ev, std::any data);
void MAPPING(game::Event ev);
void ROTATING(game::Event ev);
void IDLE(game::Event ev, std::any data);
void LOOTING(game::Event ev, std::any data);
void END(game::Event ev);