Skip to content

Commit eff3355

Browse files
committed
Merge branch 'master' of https://github.com/ivansafrin/Polycode
2 parents d69a199 + 9ccb129 commit eff3355

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

CMake/FindSDL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ FIND_PATH(SDL_INCLUDE_DIR
1212
PATH_SUFFIXES include SDL
1313
)
1414

15-
#SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
15+
SET(CMAKE_FIND_LIBRARY_SUFFIXES .so ${CMAKE_FIND_LIBRARY_SUFFIXES})
1616
FIND_LIBRARY(SDL_LIBRARY
1717
NAMES SDL libSDL
1818
PATHS $ENV{LD_LIBRARY_PATH} $ENV{LIBRARY_PATH} $ENV{LIB}

IDE/Contents/Source/PolycodeIDEApp.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,24 @@ void PolycodeIDEApp::importAssets() {
572572
extensions.push_back(CoreFileExtension("TrueSpace", "scn"));
573573
extensions.push_back(CoreFileExtension("XGL", "xgl"));
574574

575+
#ifdef USE_POLYCODEUI_FILE_DIALOGS
576+
std::vector<String> exts;
577+
for(int i=0; i < extensions.size(); i++) {
578+
exts.push_back(extensions[i].extension);
579+
}
580+
581+
frame->showFileBrowser(CoreServices::getInstance()->getCore()->getUserHomeDirectory(), false, exts, false);
582+
frame->fileDialog->addEventListener(this, UIEvent::OK_EVENT);
583+
frame->fileDialog->action = "openImportAssets";
584+
585+
#else
575586
std::vector<String> files = core->openFilePicker(extensions, false);
576587
if(files.size()) {
577588
frame->assetImporterWindow->setSourceFileAndTargetFolder(files[0], projectManager->activeFolder, projectManager->activeFolder.replace(projectManager->getActiveProject()->getRootFolder(), ""));
578589
frame->showModal(frame->assetImporterWindow);
579590
frame->assetImporterWindow->addEventListener(this, UIEvent::OK_EVENT);
580591
}
592+
#endif
581593
}
582594

583595
void PolycodeIDEApp::addFiles() {
@@ -740,7 +752,11 @@ void PolycodeIDEApp::handleEvent(Event *event) {
740752
} else if(frame->fileDialog->action == "addFiles") {
741753
OSFileEntry entry = OSFileEntry(path, OSFileEntry::TYPE_FILE);
742754
core->copyDiskItem(path, projectManager->activeFolder + "/" + entry.name);
743-
refreshProject();
755+
refreshProject();
756+
} else if(frame->fileDialog->action == "openImportAssets") {
757+
frame->assetImporterWindow->setSourceFileAndTargetFolder(path, projectManager->activeFolder, projectManager->activeFolder.replace(projectManager->getActiveProject()->getRootFolder(), ""));
758+
frame->showModal(frame->assetImporterWindow);
759+
frame->assetImporterWindow->addEventListener(this, UIEvent::OK_EVENT);
744760
}
745761
}
746762
}

0 commit comments

Comments
 (0)