Opening is working.
This commit is contained in:
parent
2023360149
commit
061883ced0
@ -11,6 +11,14 @@ void Controller::control_menu() const noexcept {
|
|||||||
if (ifd::FileDialog::Instance().HasResult()) {
|
if (ifd::FileDialog::Instance().HasResult()) {
|
||||||
fs::path str = ifd::FileDialog::Instance().GetResult();
|
fs::path str = ifd::FileDialog::Instance().GetResult();
|
||||||
SPDLOG_DEBUG("path opening: {}", str.string());
|
SPDLOG_DEBUG("path opening: {}", str.string());
|
||||||
|
const auto filename = str.filename();
|
||||||
|
const auto save_path = str.remove_filename();
|
||||||
|
menu_data.set_filename(*this, filename);
|
||||||
|
menu_data.set_save_path(*this, save_path);
|
||||||
|
std::ifstream file{ save_path / filename };
|
||||||
|
json j = json::parse(file);
|
||||||
|
file.close();
|
||||||
|
sheet = j.at("character_sheet").get<character::CharacterSheet>();
|
||||||
}
|
}
|
||||||
ifd::FileDialog::Instance().Close();
|
ifd::FileDialog::Instance().Close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user