Reworked file structure

This commit is contained in:
antopilo
2025-01-30 22:41:17 -05:00
parent e8a84c98ec
commit 92a64f19ea
2215 changed files with 1832 additions and 2069 deletions

View File

@@ -0,0 +1,39 @@
#include "ScriptingContext.h"
#include "Nuake/Core/String.h"
#include "Modules/EditorModule.h"
void ScriptingContext::Initialize()
{
modules =
{
CreateRef<EditorNetAPI>()
};
for (auto& m : modules)
{
m->RegisterMethods();
}
// Load Nuake assembly DLL
/*auto loadContext2 = Nuake::ScriptingEngineNet::Get().GetHostInstance()->CreateAssemblyLoadContext("NuakeEditorContext");
nuakeAssembly = Nuake::ScriptingEngineNet::Get().ReloadEngineAPI(loadContext2);
m_EditorAssembly = loadContext2.LoadAssembly("EditorNet.dll");
for (const auto& netModule : modules)
{
for (const auto& [methodName, methodPtr] : netModule->GetMethods())
{
auto namespaceClassSplit = Nuake::String::Split(methodName, '.');
m_EditorAssembly.AddInternalCall("Nuake." + namespaceClassSplit[0], namespaceClassSplit[1], methodPtr);
}
}
m_EditorAssembly.UploadInternalCalls();
m_EditorAssembly.GetType("Nuake.Editor").InvokeStaticMethod("Initialize");*/
}
void ScriptingContext::PushCommand(const std::string & command, const std::string & arg)
{
m_EditorAssembly.GetType("Nuake.Editor").InvokeStaticMethod("Initialize");
}