From 555cfcaadd4fca13d0c8863ccd1a2a04299a8f31 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquemin Date: Sun, 14 Apr 2024 10:29:05 +0200 Subject: [PATCH] Application: add initial UI for style import/export. --- src/Application/Application_MassViewer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Application/Application_MassViewer.cpp b/src/Application/Application_MassViewer.cpp index d17c259..1cda5f6 100644 --- a/src/Application/Application_MassViewer.cpp +++ b/src/Application/Application_MassViewer.cpp @@ -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(); }