summaryrefslogtreecommitdiff
path: root/src/engine/editor/SceneManager.cpp
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-12-15 12:29:58 -0700
committerGitHub <noreply@github.com>2025-12-15 12:29:58 -0700
commiteb11374093b07bd968ccb955eecd06133db0ab74 (patch)
tree8e584cd21b9ea22403c903621d300d8223a62c86 /src/engine/editor/SceneManager.cpp
parent2995361eb152a5c0c8add52c590e30ec916b81ec (diff)
Edit TrackInfo Properties (#594)
* Fix finishline for toads turnpike in extra * Fixed trash bin in extra * Refactor fov * Update scene.json * Allow setting fog * impl fog save & load * Fix modifying resourceName and rename editor namespace to trackeditor * small change
Diffstat (limited to 'src/engine/editor/SceneManager.cpp')
-rw-r--r--src/engine/editor/SceneManager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/engine/editor/SceneManager.cpp b/src/engine/editor/SceneManager.cpp
index 026dfbfe0..1a0c129c0 100644
--- a/src/engine/editor/SceneManager.cpp
+++ b/src/engine/editor/SceneManager.cpp
@@ -33,7 +33,7 @@ extern "C" {
#include "render_courses.h"
}
-namespace Editor {
+namespace TrackEditor {
void SaveLevel(Track* track, const TrackInfo* info) {
nlohmann::json data;
@@ -42,6 +42,7 @@ namespace Editor {
*/
try {
data["Props"] = track->Props.to_json();
+ data["Props"]["ResourceName"] = track->ResourceName.c_str();
} catch (...) {
SPDLOG_ERROR("[SceneManager] [SaveLevel] Failed serializing track Props");
}
@@ -331,6 +332,7 @@ namespace Editor {
try {
track->Props.from_json(data["Props"]);
+ track->ResourceName = data["Props"].at("ResourceName").get<std::string>();
} catch(const std::exception& e) {
std::cerr << " Error parsing track properties: " << e.what() << std::endl;
std::cerr << " Is your scene.json file out of date?" << std::endl;