2022-01-14 22:06:07 +01:00
|
|
|
#ifndef BILLYSHEET_MENU_DATA_HPP
|
|
|
|
#define BILLYSHEET_MENU_DATA_HPP
|
|
|
|
|
|
|
|
#include <filesystem>
|
|
|
|
|
|
|
|
namespace fs = std::filesystem;
|
|
|
|
|
2022-01-17 23:36:12 +01:00
|
|
|
class Controller;
|
|
|
|
|
2022-01-17 22:00:26 +01:00
|
|
|
namespace character {
|
2024-01-28 20:31:50 +01:00
|
|
|
class CharacterSheet;
|
2022-01-17 22:00:26 +01:00
|
|
|
}
|
|
|
|
|
2022-01-14 22:06:07 +01:00
|
|
|
namespace gui::menu {
|
2024-01-28 20:31:50 +01:00
|
|
|
class MenuData final {
|
|
|
|
public:
|
|
|
|
const std::string open_character_key{ "CharacterSheetOpen" };
|
2022-01-17 23:36:12 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
const std::string save_character_key{ "CharacterSheetSaveAs" };
|
|
|
|
private:
|
|
|
|
friend class Menu;
|
2022-01-14 22:06:07 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
const character::CharacterSheet &character_sheet;
|
2022-01-17 22:00:26 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
mutable fs::path save_path{ "./" };
|
2022-01-14 22:06:07 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
mutable std::string filename{ "character_sheet.json" };
|
2022-01-14 22:06:07 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
bool edit_mode{ true };
|
|
|
|
public:
|
|
|
|
MenuData() noexcept = delete;
|
2022-01-17 22:00:26 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
explicit MenuData(const character::CharacterSheet &characterSheet) noexcept: character_sheet(characterSheet) {}
|
2022-01-14 22:06:07 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
~MenuData() noexcept = default;
|
2022-01-14 22:06:07 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
[[nodiscard]] bool is_edit_mode() const { return edit_mode; }
|
2022-01-17 23:36:12 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
void set_save_path([[maybe_unused]] const Controller &controller,
|
2024-02-29 12:04:09 +01:00
|
|
|
const fs::path &savePath) const { save_path = savePath; }
|
2022-01-17 23:36:12 +01:00
|
|
|
|
2024-01-28 20:31:50 +01:00
|
|
|
void set_filename([[maybe_unused]] const Controller &controller,
|
2024-02-29 12:04:09 +01:00
|
|
|
const std::string &fileName) const { filename = fileName; }
|
2024-01-28 20:31:50 +01:00
|
|
|
};
|
2022-01-14 22:06:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif //BILLYSHEET_MENU_DATA_HPP
|