33 lines
665 B
C++
33 lines
665 B
C++
#include "gui/menu/menu.hpp"
|
|
#include "imgui.h"
|
|
#include "gui/menu/menu_data.hpp"
|
|
#include <fstream>
|
|
#include <nlohmann/json.hpp>
|
|
|
|
void gui::menu::Menu::gui() const noexcept {
|
|
if (ImGui::BeginMenuBar()) {
|
|
if (ImGui::BeginMenu("File")) {
|
|
if (ImGui::MenuItem("Open file")) {
|
|
|
|
}
|
|
|
|
if (ImGui::MenuItem("Save")) {
|
|
std::ofstream file{ data.save_path / data.filename };
|
|
nlohmann::json j;
|
|
j.emplace("character_sheet", data)
|
|
}
|
|
|
|
if (ImGui::MenuItem("Save as...")) {
|
|
|
|
}
|
|
|
|
ImGui::EndMenu();
|
|
}
|
|
if (ImGui::BeginMenu("Editor")) {
|
|
ImGui::MenuItem("Edit mode", nullptr, &data.edit_mode);
|
|
ImGui::EndMenu();
|
|
}
|
|
ImGui::EndMenuBar();
|
|
}
|
|
}
|