Application: add initial UI for style import/export.

This commit is contained in:
Guillaume Jacquemin 2024-04-14 10:29:05 +02:00
parent 2f70aa7672
commit 555cfcaadd
Signed by: williamjcm
SSH Key Fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A
1 changed files with 12 additions and 0 deletions

View File

@ -333,6 +333,18 @@ Application::drawCustomStyle(GameObjects::CustomStyle& style) {
style.name = name_buf.data();
}
if(ImGui::SmallButton(ICON_FA_FILE_EXPORT " Export")) {
if(!ImportExport::exportStyle(_currentMass->name(), style)) {
_queue.addToast(Toast::Type::Error, ImportExport::lastExportError());
}
else {
_queue.addToast(Toast::Type::Success, "Style exported successfully.");
}
}
if(drawUnsafeWidget(ImGui::SmallButton, ICON_FA_FILE_IMPORT " Import")) {
// TODO: implement once the style manager is ready.
}
ImGui::EndMenuBar();
}