Can now open .map in trenchbroom automatically

This commit is contained in:
Antoine Pilote
2023-09-15 17:53:07 -04:00
parent a5cf290f4c
commit 61776b4fb8
11 changed files with 26 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
#include "OS.h"
#include "src/Window.h"
#include "Engine.h"
#define GLFW_EXPOSE_NATIVE_WIN32
#include "GLFW/glfw3.h"
@@ -69,6 +70,11 @@ void OS::ShowInFileExplorer(const std::string& filePath)
ShellExecuteA(nullptr, "open", "explorer.exe", ("/select," + std::string(filePath)).c_str(), nullptr, SW_SHOWDEFAULT);
}
void OS::OpenTrenchbroomMap(const std::string& filePath)
{
ShellExecuteA(nullptr, nullptr, Engine::GetProject()->TrenchbroomPath.c_str(), filePath.c_str(), nullptr, SW_SHOW);
}
void OS::OpenURL(const std::string& url)
{
ShellExecute(nullptr, nullptr, std::wstring(url.begin(), url.end()).c_str(), 0, 0, SW_SHOW);