Merge branch 'main' into NK-103-Camera-corrupted-transform-2

This commit is contained in:
Antoine Pilote
2023-07-12 22:50:42 -04:00
10 changed files with 44 additions and 14 deletions

View File

@@ -41,8 +41,7 @@ namespace Nuake
{
// Parse the project and load it.
std::string projectPath = FileDialog::OpenFile(".project");
FileSystem::SetRootDirectory(projectPath + "/../");
FileSystem::SetRootDirectory(FileSystem::GetParentPath(projectPath));
Ref<Project> project = Project::New();
if (!project->Deserialize(FileSystem::ReadFile(projectPath, true)))
{

View File

@@ -1291,7 +1291,7 @@ namespace Nuake {
if (projectPath == "") // Hit cancel.
return;
FileSystem::SetRootDirectory(projectPath + "/../");
FileSystem::SetRootDirectory(FileSystem::GetParentPath(projectPath));
Ref<Project> project = Project::New();
if (!project->Deserialize(FileSystem::ReadFile(projectPath, true)))
{

View File

@@ -176,15 +176,23 @@ namespace Nuake
if (ImGui::BeginPopup(hoverMenuId.c_str()))
{
if (ImGui::MenuItem("Show in File Explorer"))
{
OS::ShowInFileExplorer(file->GetAbsolutePath());
}
ImGui::Separator();
if (ImGui::MenuItem("Delete"))
{
if(FileSystem::RemoveFile(file->GetAbsolutePath()) != 0)
{
Logger::Log("Failed to remove file: " + file->GetAbsolutePath(), CRITICAL);
Logger::Log("Failed to remove file: " + file->GetRelativePath(), CRITICAL);
}
RefreshFileBrowser();
}
ImGui::EndPopup();
RefreshFileBrowser();
}
ImGui::Text(file->GetName().c_str());

View File

@@ -254,7 +254,7 @@ namespace Nuake
SaveRecentFile();
std::string projectPath = _Projects[SelectedProject].Path;
FileSystem::SetRootDirectory(projectPath + "/../");
FileSystem::SetRootDirectory(FileSystem::GetParentPath(projectPath));
auto project = Project::New();
auto projectFileData = FileSystem::ReadFile(projectPath, true);