diff options
| author | ilotterytea <iltsu@alright.party> | 2025-02-03 00:05:27 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-02-03 00:05:47 +0500 |
| commit | 9362a01f6f8b6339944f5ddf8d2f597ca672f56e (patch) | |
| tree | b81cd4e947819560261ea60bb173b7b0f0653529 /src/editor.cpp | |
| parent | cac7fa97ec7b2db3a3153f9a82a31c59e5c333ae (diff) | |
feat: import package
Diffstat (limited to 'src/editor.cpp')
| -rw-r--r-- | src/editor.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/editor.cpp b/src/editor.cpp index 5417a59..6d7e0d6 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -302,10 +302,26 @@ namespace silly::editor { if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMenu("File")) { - if (ImGui::MenuItem("New package")) { + if (ImGui::MenuItem("New")) { createNewPackage(window); } + if (ImGui::MenuItem("Open...")) { + NFD::UniquePath outPath; + + nfdfilteritem_t filterItem[1] = {{"sillypackage text format", "txt"}}; + + nfdresult_t result = NFD::OpenDialog(outPath, filterItem, 1); + if (result == NFD_OKAY) { + this->newFloorState = std::nullopt; + this->newLevelState = std::nullopt; + this->newPackageState = std::nullopt; + this->newTileState = std::nullopt; + std::string path = outPath.get(); + this->package.load(PACKAGE_TXT, path); + } + } + ImGui::Separator(); if (!pkg.get_levels().empty() && |
