mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Removed the last remnants of Wren QQ
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include "ScriptingSystem.h"
|
||||
#include "src/Scene/Components/WrenScriptComponent.h"
|
||||
#include "src/Scene/Components/NetScriptComponent.h"
|
||||
#include "src/Scene/Scene.h"
|
||||
#include "Engine.h"
|
||||
@@ -17,30 +16,8 @@ namespace Nuake
|
||||
|
||||
bool ScriptingSystem::Init()
|
||||
{
|
||||
ScriptingEngine::Init();
|
||||
|
||||
Logger::Log("Initializing ScriptingSystem");
|
||||
|
||||
auto wrenEntities = m_Scene->m_Registry.view<WrenScriptComponent>();
|
||||
for (auto& e : wrenEntities)
|
||||
{
|
||||
WrenScriptComponent& wren = wrenEntities.get<WrenScriptComponent>(e);
|
||||
|
||||
if (!wren.mWrenScript)
|
||||
continue;
|
||||
|
||||
wren.mWrenScript->Build(wren.mModule, true);
|
||||
|
||||
if (!wren.mWrenScript->HasCompiledSuccesfully())
|
||||
{
|
||||
Logger::Log("Failed to compile Wren script: " + wren.Script, "scripting system");
|
||||
return false;
|
||||
}
|
||||
|
||||
wren.mWrenScript->SetScriptableEntityID((int)e);
|
||||
wren.mWrenScript->CallInit();
|
||||
}
|
||||
|
||||
auto& scriptingEngineNet = ScriptingEngineNet::Get();
|
||||
scriptingEngineNet.Uninitialize();
|
||||
scriptingEngineNet.Initialize();
|
||||
@@ -101,15 +78,6 @@ namespace Nuake
|
||||
if (!Engine::IsPlayMode())
|
||||
return;
|
||||
|
||||
auto entities = m_Scene->m_Registry.view<WrenScriptComponent>();
|
||||
for (auto& e : entities)
|
||||
{
|
||||
WrenScriptComponent& wren = entities.get<WrenScriptComponent>(e);
|
||||
|
||||
if (wren.mWrenScript != nullptr)
|
||||
wren.mWrenScript->CallUpdate(ts);
|
||||
}
|
||||
|
||||
auto& scriptingEngineNet = ScriptingEngineNet::Get();
|
||||
auto netEntities = m_Scene->m_Registry.view<NetScriptComponent>();
|
||||
|
||||
@@ -177,15 +145,6 @@ namespace Nuake
|
||||
if (!Engine::IsPlayMode())
|
||||
return;
|
||||
|
||||
auto entities = m_Scene->m_Registry.view<WrenScriptComponent>();
|
||||
for (auto& e : entities)
|
||||
{
|
||||
WrenScriptComponent& wren = entities.get<WrenScriptComponent>(e);
|
||||
|
||||
if (wren.mWrenScript != nullptr)
|
||||
wren.mWrenScript->CallFixedUpdate(ts);
|
||||
}
|
||||
|
||||
auto& scriptingEngineNet = ScriptingEngineNet::Get();
|
||||
auto netEntities = m_Scene->m_Registry.view<NetScriptComponent>();
|
||||
for (auto& e : netEntities)
|
||||
@@ -203,21 +162,6 @@ namespace Nuake
|
||||
|
||||
void ScriptingSystem::Exit()
|
||||
{
|
||||
auto entities = m_Scene->m_Registry.view<WrenScriptComponent>();
|
||||
for (auto& e : entities)
|
||||
{
|
||||
WrenScriptComponent& wren = entities.get<WrenScriptComponent>(e);
|
||||
|
||||
try
|
||||
{
|
||||
if (wren.mWrenScript != nullptr)
|
||||
wren.mWrenScript->CallExit();
|
||||
}
|
||||
catch (std::exception* /*e*/)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
auto& scriptingEngineNet = ScriptingEngineNet::Get();
|
||||
auto netEntities = m_Scene->m_Registry.view<NetScriptComponent>();
|
||||
for (auto& e : netEntities)
|
||||
@@ -236,7 +180,6 @@ namespace Nuake
|
||||
}
|
||||
}
|
||||
|
||||
ScriptingEngine::Close();
|
||||
ScriptingEngineNet::Get().Uninitialize();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user