Submodule for JSON added.
Menu data and menu in their own folder.
This commit is contained in:
parent
27c571a6b9
commit
9142896237
12 changed files with 106 additions and 60 deletions
|
@ -2,7 +2,7 @@
|
|||
#define BILLYSHEET_GUI_HPP
|
||||
|
||||
#include <filesystem>
|
||||
#include "menu.hpp"
|
||||
#include "gui/menu/menu.hpp"
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
|
@ -10,11 +10,13 @@ namespace gui {
|
|||
|
||||
class GuiData;
|
||||
|
||||
namespace menu { class MenuData; }
|
||||
|
||||
class Gui final {
|
||||
private:
|
||||
GuiData &data;
|
||||
|
||||
Menu menu;
|
||||
menu::Menu menu;
|
||||
|
||||
fs::path font;
|
||||
|
||||
|
@ -22,7 +24,7 @@ namespace gui {
|
|||
public:
|
||||
Gui() = delete;
|
||||
|
||||
explicit Gui(GuiData &data);
|
||||
explicit Gui(GuiData &data, menu::MenuData &menuData);
|
||||
|
||||
~Gui() noexcept;
|
||||
|
||||
|
|
|
@ -2,32 +2,28 @@
|
|||
#define BILLYSHEET_GUI_DATA_HPP
|
||||
|
||||
#include "character_sheet.hpp"
|
||||
#include <filesystem>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace gui {
|
||||
class Window;
|
||||
|
||||
class GuiData final {
|
||||
private:
|
||||
friend class Gui;
|
||||
|
||||
Window &window;
|
||||
|
||||
character::CharacterSheet billy;
|
||||
|
||||
// Is it the right place here for both ? Not sure.
|
||||
fs::path save_path{ "./" };
|
||||
std::string filename{ "character_sheet.json" };
|
||||
|
||||
public:
|
||||
GuiData() = delete;
|
||||
|
||||
explicit GuiData(Window &wwindow) : window(wwindow) { SPDLOG_DEBUG("Creating GUI Data"); }
|
||||
|
||||
[[nodiscard]] Window &get_window() const;
|
||||
|
||||
~GuiData() noexcept = default;
|
||||
|
||||
[[nodiscard]] Window &get_window() const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef BILLYSHEET_MENU_HPP
|
||||
#define BILLYSHEET_MENU_HPP
|
||||
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
namespace gui {
|
||||
class GuiData;
|
||||
|
||||
class Menu final {
|
||||
private:
|
||||
GuiData &data;
|
||||
public:
|
||||
Menu() noexcept = delete;
|
||||
|
||||
explicit Menu(GuiData &data) noexcept: data(data) { SPDLOG_DEBUG("Creating Menu"); }
|
||||
|
||||
~Menu() noexcept = default;
|
||||
|
||||
void gui() const noexcept;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //BILLYSHEET_MENU_HPP
|
30
include/gui/menu/menu.hpp
Normal file
30
include/gui/menu/menu.hpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef BILLYSHEET_MENU_HPP
|
||||
#define BILLYSHEET_MENU_HPP
|
||||
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
namespace gui {
|
||||
class GuiData;
|
||||
|
||||
namespace menu {
|
||||
class MenuData;
|
||||
|
||||
class Menu final {
|
||||
private:
|
||||
MenuData &data;
|
||||
public:
|
||||
Menu() noexcept = delete;
|
||||
|
||||
explicit Menu(MenuData &data) noexcept: data(data) { SPDLOG_DEBUG("Creating Menu"); }
|
||||
|
||||
~Menu() noexcept = default;
|
||||
|
||||
void gui() const noexcept;
|
||||
|
||||
[[nodiscard]] const MenuData &get_data() const { return data; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif //BILLYSHEET_MENU_HPP
|
28
include/gui/menu/menu_data.hpp
Normal file
28
include/gui/menu/menu_data.hpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#ifndef BILLYSHEET_MENU_DATA_HPP
|
||||
#define BILLYSHEET_MENU_DATA_HPP
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace gui::menu {
|
||||
class MenuData final {
|
||||
private:
|
||||
friend class Menu;
|
||||
|
||||
fs::path save_path{ "./" };
|
||||
|
||||
std::string filename{ "character_sheet.json" };
|
||||
|
||||
bool edit_mode{ true };
|
||||
public:
|
||||
MenuData() noexcept = default;
|
||||
|
||||
~MenuData() noexcept = default;
|
||||
|
||||
[[nodiscard]] bool is_edit_mode() const { return edit_mode; }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //BILLYSHEET_MENU_DATA_HPP
|
Loading…
Add table
Add a link
Reference in a new issue