All of the GUI panels are now their own classes and pulled out of the main GUI so I can devise how they're managed.

This commit is contained in:
Zed A. Shaw 2024-12-31 05:53:27 -05:00
parent 941be008f8
commit 380e18b91a
2 changed files with 33 additions and 15 deletions

16
gui.hpp
View file

@ -65,6 +65,7 @@ class StatusUI : public Panel {
Panel(0, 0, STATUS_UI_WIDTH, STATUS_UI_HEIGHT),
$log({{"Welcome to the game!"}}),
$world(world) {}
void create_render();
void log(string msg) {
$log.log(msg);
@ -73,19 +74,26 @@ class StatusUI : public Panel {
class MapViewUI : public Panel {
public:
MapViewUI() : Panel(GAME_MAP_PIXEL_POS, 0, 0, 0, true) {}
Canvas $canvas;
DinkyECS::World& $world;
LightRender& $lights;
Map& $game_map;
MapViewUI(DinkyECS::World& world, LightRender& lights, Map& game_map);
void create_render();
void resize_canvas();
};
class GUI {
Canvas $canvas;
DinkyECS::World& $world;
Map& $game_map;
StatusUI $status_ui;
LightRender $lights;
MapViewUI $map_view;
InventoryUI $inventory_ui;
LightRender $lights;
Canvas $canvas;
bool $show_modal = false;
Component $test_button;
DinkyECS::World& $world;
SoundManager $sounds;
SFMLRender $renderer;
UnDumbTSS $paused;