Updates Angelscript addons, adds angelscript dictionary addon.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2021-03-27 22:39:25 +01:00
parent e5b2ff5c59
commit e748f6e96f
10 changed files with 1921 additions and 376 deletions

View File

@@ -1,6 +1,7 @@
#include "AngelScriptResolver.hpp"
#include <CreatureLib/Battling/Models/Creature.hpp>
#include <regex>
#include "../../../extern/angelscript_addons/scriptdictionary/scriptdictionary.h"
#include "../../../extern/angelscript_addons/scripthandle/scripthandle.h"
#include "../../../extern/angelscript_addons/scripthelper/scripthelper.h"
#include "../../../extern/angelscript_addons/scriptstdstring/scriptstdstring.h"
@@ -35,7 +36,7 @@ static void TranslateException(asIScriptContext* ctx, void* /*userParam*/) {
} catch (ArbUt::Exception& e) {
// Tell the VM the type of exception that occurred
ctx->SetException(e.what());
}catch (std::exception& e) {
} catch (std::exception& e) {
// Tell the VM the type of exception that occurred
ctx->SetException(e.what());
} catch (...) {
@@ -76,6 +77,7 @@ void AngelScriptResolver::Initialize(CreatureLib::Battling::BattleLibrary* arg,
// Register Script Array type
RegisterScriptArray(_engine, true);
RegisterScriptHandle(_engine);
RegisterScriptDictionary(_engine);
r = _engine->RegisterGlobalFunction("void print(const string &in)", asFUNCTION(Print), asCALL_CDECL);
if (r < 0)
throw ArbUt::Exception("Registering print function failed.");