Added OpenFolderDialog + now project creation selects folder instead

This commit is contained in:
Antoine Pilote
2024-09-16 12:40:57 -04:00
parent cff63d71cc
commit 4ac7d1cfc9
2 changed files with 56 additions and 45 deletions

View File

@@ -139,28 +139,26 @@ namespace Nuake
ImGui::InputText("##Location", &location); ImGui::SameLine();
if (ImGui::Button((ICON_FA_FOLDER + std::string("##folderOpen")).c_str()))
{
std::string folderPath = Nuake::FileDialog::SaveFile("Project File\0*.project");
std::string folderPath = Nuake::FileDialog::OpenFolder();
folderPath = Nuake::String::ReplaceSlash(folderPath);
if (!folderPath.empty())
{
auto splits = Nuake::String::Split(folderPath, '/');
projectFileName = splits[splits.size() - 1];
if (!Nuake::String::EndsWith(projectFileName, ".project"))
{
projectFileName += ".project";
}
location = "";
for (int i = 0; i < splits.size() - 1; i++)
for (int i = 0; i < splits.size(); i++)
{
location += splits[i] + "/";
}
}
}
projectFileName = Nuake::String::RemoveWhiteSpace(projectTitle) + ".project";
finalLocation = location;
static std::string projectParentPath = location;
projectParentPath = location;