mirror of
https://github.com/antopilo/Nuake.git
synced 2026-01-03 14:09:46 +03:00
Now exports prefabs to trenchbroom automatically
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "src/Core/Logger.h"
|
||||
#include "src/Audio/AudioManager.h"
|
||||
#include "src/Scripting/ScriptingEngineNet.h"
|
||||
|
||||
#include "src/FileSystem/File.h"
|
||||
#include <json/json.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
@@ -211,6 +211,23 @@ namespace Nuake
|
||||
file->PointEntities.push_back(pointEntity);
|
||||
}
|
||||
|
||||
for (auto& p : FileSystem::GetAllFiles(FileType::Prefab))
|
||||
{
|
||||
const std::string& fileContent = FileSystem::ReadFile(p->GetRelativePath());
|
||||
json fileJson = json::parse(fileContent);
|
||||
|
||||
std::string name = p->GetName();
|
||||
if (fileJson.contains("DisplayName"))
|
||||
{
|
||||
name = fileJson["DisplayName"];
|
||||
}
|
||||
|
||||
FGDPointEntity pointEntity = FGDPointEntity(name);
|
||||
pointEntity.Description = "A Prefab entity";
|
||||
|
||||
file->PointEntities.push_back(pointEntity);
|
||||
}
|
||||
|
||||
for (auto& b : bases)
|
||||
{
|
||||
FGDBaseEntity baseEntity;
|
||||
|
||||
Reference in New Issue
Block a user