mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Added support for skyboxes using a new SkyBox resource and component
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "../Misc/ThumbnailManager.h"
|
||||
|
||||
#include <Tracy.hpp>
|
||||
#include <src/Resource/SkyResource.h>
|
||||
|
||||
namespace Nuake
|
||||
{
|
||||
@@ -328,6 +329,10 @@ namespace Nuake
|
||||
{
|
||||
dragType = "_UIFile";
|
||||
}
|
||||
else if (fileExtension == ".sky")
|
||||
{
|
||||
dragType = "_SkyFile";
|
||||
}
|
||||
|
||||
ImGui::SetDragDropPayload(dragType.c_str(), (void*)(pathBuffer), sizeof(pathBuffer));
|
||||
ImGui::Text(file->GetName().c_str());
|
||||
@@ -674,6 +679,28 @@ namespace Nuake
|
||||
RefreshFileBrowser();
|
||||
}
|
||||
}
|
||||
if (ImGui::MenuItem("Sky"))
|
||||
{
|
||||
const std::string path = FileDialog::SaveFile("*.sky");
|
||||
if (!path.empty())
|
||||
{
|
||||
std::string finalPath = path;
|
||||
if (!String::EndsWith(path, ".sky"))
|
||||
{
|
||||
finalPath = path + ".sky";
|
||||
}
|
||||
|
||||
Ref<SkyResource> sky = CreateRef<SkyResource>(FileSystem::AbsoluteToRelative(finalPath));
|
||||
sky->IsEmbedded = false;
|
||||
auto jsonData = sky->Serialize();
|
||||
|
||||
FileSystem::BeginWriteFile(finalPath, true);
|
||||
FileSystem::WriteLine(jsonData.dump(4));
|
||||
FileSystem::EndWriteFile();
|
||||
|
||||
RefreshFileBrowser();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user