mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Started to expose DOM to C# API with support for custom nodes. Currently crash when doing FindNodeByID<T>
This commit is contained in:
@@ -65,7 +65,7 @@ namespace Nuake
|
||||
// Instantiate UI widgets
|
||||
for (auto& uiWidget : CanvasParser::Get().GetAllCustomWidgetInstance())
|
||||
{
|
||||
scriptingEngineNet.RegisterCustomWidgetInstance(uiWidget.first, uiWidget.second);
|
||||
scriptingEngineNet.RegisterCustomWidgetInstance(uiWidget.first.first, uiWidget.first.second, uiWidget.second);
|
||||
}
|
||||
|
||||
// Call OnInit on entity script instances
|
||||
@@ -84,10 +84,11 @@ namespace Nuake
|
||||
// Call OnInit on UI widgets
|
||||
for (auto& widget : CanvasParser::Get().GetAllCustomWidgetInstance())
|
||||
{
|
||||
const UUID& widgetInstanceUUID = widget.first;
|
||||
if (scriptingEngineNet.HasCustomWidgetInstance(widgetInstanceUUID))
|
||||
const UUID& canvasInstanceUUID = widget.first.first;
|
||||
const UUID& widgetInstanceUUID = widget.first.second;
|
||||
if (scriptingEngineNet.HasCustomWidgetInstance(canvasInstanceUUID, widgetInstanceUUID))
|
||||
{
|
||||
auto widgetInstance = scriptingEngineNet.GetCustomWidgetInstance(widgetInstanceUUID);
|
||||
auto widgetInstance = scriptingEngineNet.GetCustomWidgetInstance(canvasInstanceUUID, widgetInstanceUUID);
|
||||
widgetInstance.InvokeMethod("OnInit");
|
||||
}
|
||||
}
|
||||
@@ -157,6 +158,17 @@ namespace Nuake
|
||||
scriptInstance.InvokeMethod("OnUpdate", ts.GetSeconds());
|
||||
}
|
||||
|
||||
for (auto& widget : CanvasParser::Get().GetAllCustomWidgetInstance())
|
||||
{
|
||||
const UUID& canvasInstanceUUID = widget.first.first;
|
||||
const UUID& widgetInstanceUUID = widget.first.second;
|
||||
if (scriptingEngineNet.HasCustomWidgetInstance(canvasInstanceUUID, widgetInstanceUUID))
|
||||
{
|
||||
auto widgetInstance = scriptingEngineNet.GetCustomWidgetInstance(canvasInstanceUUID, widgetInstanceUUID);
|
||||
widgetInstance.InvokeMethod("OnTick", ts.GetSeconds());
|
||||
}
|
||||
}
|
||||
|
||||
DispatchPhysicCallbacks();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user