Changes GameView to expose global functions to scripts instead of using CJSObject.

Fixes #2126
Refs #1886

This was SVN commit r13826.
This commit is contained in:
Yves
2013-09-12 12:40:05 +00:00
parent 05422ad545
commit 5304bc9d6a
8 changed files with 142 additions and 40 deletions
+3
View File
@@ -23,6 +23,7 @@
#include "graphics/GameView.h"
#include "graphics/MapReader.h"
#include "gui/GUIManager.h"
#include "graphics/scripting/JSInterface_GameView.h"
#include "lib/timer.h"
#include "lib/utf8.h"
#include "lib/sysdep/sysdep.h"
@@ -650,6 +651,8 @@ void SetBoundingBoxDebugOverlay(void* UNUSED(cbdata), bool enabled)
void GuiScriptingInit(ScriptInterface& scriptInterface)
{
JSI_GameView::RegisterScriptFunctions(scriptInterface);
// GUI manager functions:
scriptInterface.RegisterFunction<CScriptVal, &GetActiveGui>("GetActiveGui");
scriptInterface.RegisterFunction<void, std::wstring, CScriptVal, &PushGuiPage>("PushGuiPage");