From f1b68a1bad28fe3d7c22f4a4b6012a7f12160d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89meryc?= Date: Sat, 15 Jul 2023 22:46:41 -0400 Subject: [PATCH] NK-108 - Removed delete from .project context menu --- Editor/src/Windows/FileSystemUI.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Editor/src/Windows/FileSystemUI.cpp b/Editor/src/Windows/FileSystemUI.cpp index 3eb90511..4b309547 100644 --- a/Editor/src/Windows/FileSystemUI.cpp +++ b/Editor/src/Windows/FileSystemUI.cpp @@ -180,16 +180,19 @@ namespace Nuake { OS::ShowInFileExplorer(file->GetAbsolutePath()); } - - ImGui::Separator(); - - if (ImGui::MenuItem("Delete")) + + if(file->GetExtension() != ".project") { - if(FileSystem::RemoveFile(file->GetAbsolutePath()) != 0) + ImGui::Separator(); + + if (ImGui::MenuItem("Delete")) { - Logger::Log("Failed to remove file: " + file->GetRelativePath(), CRITICAL); + if(FileSystem::RemoveFile(file->GetAbsolutePath()) != 0) + { + Logger::Log("Failed to remove file: " + file->GetRelativePath(), CRITICAL); + } + RefreshFileBrowser(); } - RefreshFileBrowser(); } ImGui::EndPopup();