Started to expose DOM to C# API with support for custom nodes. Currently crash when doing FindNodeByID<T>

This commit is contained in:
antopilo
2024-09-13 00:51:34 -04:00
parent 9e87dca9ce
commit 3b148b76c4
18 changed files with 390 additions and 90 deletions

View File

@@ -24,7 +24,9 @@ UIResource::UIResource(const std::string& path) :
inputManager = new MyInputManager(*Engine::GetCurrentWindow());
}
canvas = CanvasParser::Get().Parse(FileSystem::RelativeToAbsolute(path));
canvas = Canvas::New();
canvas->uuid = this->ID;
canvas = CanvasParser::Get().Parse(canvas, FileSystem::RelativeToAbsolute(path));
canvas->SetInputManager(inputManager);
canvas->ComputeLayout(defaultSize);
}
@@ -65,7 +67,7 @@ void UIResource::Reload()
return;
}
canvas = CanvasParser::Get().Parse(FileSystem::RelativeToAbsolute(filePath));
canvas = CanvasParser::Get().Parse(canvas, FileSystem::RelativeToAbsolute(filePath));
if (canvas)
{
canvas->SetInputManager(inputManager);