|
|
@@ -1,6 +1,7 @@
|
|
|
|
|
|
#include <AtomicJS/Javascript/JSVM.h>
|
|
|
#include <ToolCore/ToolEnvironment.h>
|
|
|
+#include <ToolCore/ToolSystem.h>
|
|
|
|
|
|
using namespace Atomic;
|
|
|
|
|
|
@@ -21,6 +22,13 @@ static int js_atomic_GetToolEnvironment(duk_context* ctx)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+static int js_atomic_GetToolSystem(duk_context* ctx)
|
|
|
+{
|
|
|
+ JSVM* vm = JSVM::GetJSVM(ctx);
|
|
|
+ js_push_class_object_instance(ctx, vm->GetSubsystem<ToolSystem>());
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
void jsapi_init_toolcore(JSVM* vm)
|
|
|
{
|
|
|
jsb_package_toolcore_init(vm);
|
|
|
@@ -32,6 +40,9 @@ void jsapi_init_toolcore(JSVM* vm)
|
|
|
duk_push_c_function(ctx, js_atomic_GetToolEnvironment, 0);
|
|
|
duk_put_prop_string(ctx, -2, "getToolEnvironment");
|
|
|
|
|
|
+ duk_push_c_function(ctx, js_atomic_GetToolSystem, 0);
|
|
|
+ duk_put_prop_string(ctx, -2, "getToolSystem");
|
|
|
+
|
|
|
duk_pop(ctx);
|
|
|
|
|
|
}
|