Editor improvements

- Can now copy nuake.net dll in debug build
- Scrolling outside the viewport wont move the editor cam
- Can now double click to to open .sln files
- Right arrow now works in file system panel
This commit is contained in:
Antoine Pilote
2023-10-21 14:41:52 -04:00
parent 1ccd338fc6
commit 978b0a2f84
6 changed files with 60 additions and 39 deletions

View File

@@ -247,16 +247,23 @@ namespace Nuake
if (selected)
{
if (ImGui::IsMouseDoubleClicked(0))
{
if (file->GetFileType() == FileType::Map)
{
switch (file->GetFileType())
{
OS::OpenTrenchbroomMap(file->GetAbsolutePath());
}
if (file->GetFileType() == FileType::Scene)
{
shouldOpenScene = true;
case FileType::Map:
OS::OpenTrenchbroomMap(file->GetAbsolutePath());
break;
case FileType::NetScript:
OS::OpenIn(file->GetAbsolutePath());
break;
case FileType::Scene:
shouldOpenScene = true;
break;
case FileType::Solution:
OS::OpenIn(file->GetAbsolutePath());
break;
}
}
Editor->Selection = EditorSelection(file);
@@ -402,9 +409,6 @@ namespace Nuake
//}
ImGui::PopStyleVar();
const std::string openSceneId = "Open Scene" + std::string("##") + hoverMenuId;
@@ -632,7 +636,7 @@ namespace Nuake
}
else
{
Logger::Log("[FileSystem] Cannot create script files that starts with a number.", "editor", CRITICAL);
Logger::Log("Cannot create script files that starts with a number.", "filesystem", CRITICAL);
}
}
}
@@ -749,7 +753,10 @@ namespace Nuake
const auto buttonWidth = cursorEnd - cursorStart;
if (ImGui::Button((std::string(ICON_FA_ANGLE_RIGHT)).c_str(), buttonSize))
{
// TODO
if (Editor->Selection.Type == EditorSelectionType::Directory)
{
m_CurrentDirectory = Editor->Selection.Directory;
}
}
const uint32_t numButtonAfterPathBrowser = 2;
@@ -808,13 +815,6 @@ namespace Nuake
OS::OpenIn(m_CurrentDirectory->FullPath);
}
ImGui::SameLine();
if (ImGui::Button((std::string(ICON_FA_ELLIPSIS_V)).c_str(), buttonSize))
{
// TODO
}
ImGui::PopStyleColor(); // Button color
ImGui::SameLine();