BillySheet/src/controller.cpp

30 lines
845 B
C++
Raw Normal View History

2022-01-17 19:57:00 +01:00
#include "controller.hpp"
#include "gui/menu/menu_data.hpp"
2022-01-17 23:36:12 +01:00
#include "ImFileDialog.h"
#include <spdlog/spdlog.h>
2022-01-20 22:30:14 +01:00
void Controller::control_menu() const noexcept {
if (ifd::FileDialog::Instance().IsDone(menu_data.open_character_key)) {
2022-01-17 23:36:12 +01:00
if (ifd::FileDialog::Instance().HasResult()) {
fs::path str = ifd::FileDialog::Instance().GetResult();
SPDLOG_DEBUG("path opening: {}", str.string());
}
ifd::FileDialog::Instance().Close();
}
2022-01-20 22:30:14 +01:00
if (ifd::FileDialog::Instance().IsDone(menu_data.save_character_key)) {
2022-01-17 23:36:12 +01:00
if (ifd::FileDialog::Instance().HasResult()) {
const fs::path str = ifd::FileDialog::Instance().GetResult();
SPDLOG_DEBUG("path saving: {}", str.string());
}
ifd::FileDialog::Instance().Close();
}
2022-01-20 22:30:14 +01:00
}
void Controller::control_sheet() const noexcept {
if (menu_data.is_edit_mode()) {
// TODO
} else {
// TODO
}
}