1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-22 15:23:01 +01:00

Implement date API

This commit is contained in:
Ted John
2020-02-18 22:31:54 +00:00
parent b93e5b3456
commit d8b0b24c43
4 changed files with 107 additions and 2 deletions

View File

@@ -18,6 +18,7 @@
#include "Duktape.hpp"
#include "ScConsole.hpp"
#include "ScContext.hpp"
#include "ScDate.hpp"
#include "ScDisposable.hpp"
#include "ScMap.hpp"
#include "ScNetwork.hpp"
@@ -62,6 +63,7 @@ void ScriptEngine::Initialise()
auto ctx = (duk_context*)_context;
ScConsole::Register(ctx);
ScContext::Register(ctx);
ScDate::Register(ctx);
ScDisposable::Register(ctx);
ScMap::Register(ctx);
ScNetwork::Register(ctx);
@@ -76,6 +78,7 @@ void ScriptEngine::Initialise()
dukglue_register_global(ctx, std::make_shared<ScConsole>(_console), "console");
dukglue_register_global(ctx, std::make_shared<ScContext>(_execInfo, _hookEngine), "context");
dukglue_register_global(ctx, std::make_shared<ScDate>(), "date");
dukglue_register_global(ctx, std::make_shared<ScMap>(ctx), "map");
dukglue_register_global(ctx, std::make_shared<ScNetwork>(ctx), "network");
dukglue_register_global(ctx, std::make_shared<ScPark>(), "park");