Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
ScriptEventsAngelscriptCommon.cpp
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2013-2022 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
23
24#include "ScriptEvents.h"
25#include "AngelScriptBindings.h"
26#include "Application.h"
27#include <angelscript.h>
28
29using namespace AngelScript;
30
31void RoR::RegisterScriptEventsCommon(asIScriptEngine *engine)
32{
33 int result;
34
35 // enum scriptEvents
36 result = engine->RegisterEnum("scriptEvents"); ROR_ASSERT(result>=0);
37
38 result = engine->RegisterEnumValue("scriptEvents", "SE_EVENTBOX_ENTER", SE_EVENTBOX_ENTER); ROR_ASSERT(result >= 0);
39 result = engine->RegisterEnumValue("scriptEvents", "SE_EVENTBOX_EXIT", SE_EVENTBOX_EXIT); ROR_ASSERT(result >= 0);
40
41 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_ENTER", SE_TRUCK_ENTER); ROR_ASSERT(result>=0);
42 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_EXIT", SE_TRUCK_EXIT); ROR_ASSERT(result>=0);
43
44 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_ENGINE_DIED", SE_TRUCK_ENGINE_DIED); ROR_ASSERT(result>=0);
45 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_ENGINE_FIRE", SE_TRUCK_ENGINE_FIRE); ROR_ASSERT(result>=0);
46 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_TOUCHED_WATER", SE_TRUCK_TOUCHED_WATER); ROR_ASSERT(result>=0);
47 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_LIGHT_TOGGLE", SE_TRUCK_LIGHT_TOGGLE); ROR_ASSERT(result>=0);
48 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_TIE_TOGGLE", SE_TRUCK_TIE_TOGGLE); ROR_ASSERT(result>=0);
49 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_PARKINGBRAKE_TOGGLE", SE_TRUCK_PARKINGBRAKE_TOGGLE); ROR_ASSERT(result>=0);
50 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_BEACONS_TOGGLE", SE_TRUCK_BEACONS_TOGGLE); ROR_ASSERT(result>=0);
51 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_CPARTICLES_TOGGLE", SE_TRUCK_CPARTICLES_TOGGLE); ROR_ASSERT(result>=0);
52
53 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_NEW_TRUCK", SE_GENERIC_NEW_TRUCK); ROR_ASSERT(result>=0);
54 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_DELETED_TRUCK", SE_GENERIC_DELETED_TRUCK); ROR_ASSERT(result>=0);
55
56 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_RESET", SE_TRUCK_RESET); ROR_ASSERT(result>=0);
57 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_TELEPORT", SE_TRUCK_TELEPORT); ROR_ASSERT(result>=0);
58 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_MOUSE_GRAB", SE_TRUCK_MOUSE_GRAB); ROR_ASSERT(result>=0);
59
60 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_MANIPULATIONS", SE_ANGELSCRIPT_MANIPULATIONS); ROR_ASSERT(result>=0);
61 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_MSGCALLBACK", SE_ANGELSCRIPT_MSGCALLBACK); ROR_ASSERT(result>=0);
62 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_LINECALLBACK", SE_ANGELSCRIPT_LINECALLBACK); ROR_ASSERT(result>=0);
63 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_EXCEPTIONCALLBACK", SE_ANGELSCRIPT_EXCEPTIONCALLBACK); ROR_ASSERT(result>=0);
64 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_THREAD_STATUS", SE_ANGELSCRIPT_THREAD_STATUS); ROR_ASSERT(result>=0);
65
66 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_MESSAGEBOX_CLICK", SE_GENERIC_MESSAGEBOX_CLICK); ROR_ASSERT(result>=0);
67 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_EXCEPTION_CAUGHT", SE_GENERIC_EXCEPTION_CAUGHT); ROR_ASSERT(result>=0);
68 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_MODCACHE_ACTIVITY", SE_GENERIC_MODCACHE_ACTIVITY); ROR_ASSERT(result>=0);
69 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_TRUCK_LINKING_CHANGED", SE_GENERIC_TRUCK_LINKING_CHANGED); ROR_ASSERT(result>=0);
70 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_FREEFORCES_ACTIVITY", SE_GENERIC_FREEFORCES_ACTIVITY); ROR_ASSERT(result >= 0);
71
72 result = engine->RegisterEnumValue("scriptEvents", "SE_ALL_EVENTS", SE_ALL_EVENTS); ROR_ASSERT(result>=0);
73 result = engine->RegisterEnumValue("scriptEvents", "SE_NO_EVENTS", SE_NO_EVENTS); ROR_ASSERT(result>=0);
74
75 // enum angelScriptManipulationType
76 result = engine->RegisterEnum("angelScriptManipulationType"); ROR_ASSERT(result>=0);
77
78 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_CONSOLE_SNIPPET_EXECUTED", ASMANIP_CONSOLE_SNIPPET_EXECUTED); ROR_ASSERT(result >= 0);
79 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_SCRIPT_LOADED", ASMANIP_SCRIPT_LOADED); ROR_ASSERT(result >= 0);
80 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_SCRIPT_LOAD_FAILED", ASMANIP_SCRIPT_LOAD_FAILED); ROR_ASSERT(result >= 0);
81 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_SCRIPT_UNLOADING", ASMANIP_SCRIPT_UNLOADING); ROR_ASSERT(result >= 0);
82 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_ACTORSIMATTR_SET", ASMANIP_ACTORSIMATTR_SET); ROR_ASSERT(result >= 0);
83
84 // enum angelScriptThreadStatus
85 result = engine->RegisterEnum("angelScriptThreadStatus"); ROR_ASSERT(result>=0);
86
87 result = engine->RegisterEnumValue("angelScriptThreadStatus", "ASTHREADSTATUS_NONE", ASTHREADSTATUS_NONE); ROR_ASSERT(result >= 0);
88 result = engine->RegisterEnumValue("angelScriptThreadStatus", "ASTHREADSTATUS_CURLSTRING_PROGRESS", ASTHREADSTATUS_CURLSTRING_PROGRESS); ROR_ASSERT(result >= 0);
89 result = engine->RegisterEnumValue("angelScriptThreadStatus", "ASTHREADSTATUS_CURLSTRING_SUCCESS", ASTHREADSTATUS_CURLSTRING_SUCCESS ); ROR_ASSERT(result >= 0);
90 result = engine->RegisterEnumValue("angelScriptThreadStatus", "ASTHREADSTATUS_CURLSTRING_FAILURE", ASTHREADSTATUS_CURLSTRING_FAILURE ); ROR_ASSERT(result >= 0);
91
92 // enum modCacheActivityType
93 result = engine->RegisterEnum("modCacheActivityType"); ROR_ASSERT(result>=0);
94
95 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_ENTRY_ADDED", MODCACHEACTIVITY_ENTRY_ADDED); ROR_ASSERT(result >= 0);
96 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_ENTRY_DELETED", MODCACHEACTIVITY_ENTRY_DELETED); ROR_ASSERT(result >= 0);
97 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_BUNDLE_LOADED", MODCACHEACTIVITY_BUNDLE_LOADED); ROR_ASSERT(result >= 0);
98 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_BUNDLE_RELOADED", MODCACHEACTIVITY_BUNDLE_RELOADED); ROR_ASSERT(result >= 0);
99 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_BUNDLE_UNLOADED", MODCACHEACTIVITY_BUNDLE_UNLOADED); ROR_ASSERT(result >= 0);
100
101 // enum freeForcesActivityType
102 result = engine->RegisterEnum("freeForcesActivityType"); ROR_ASSERT(result >= 0);
103
104 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_NONE", FREEFORCESACTIVITY_NONE); ROR_ASSERT(result >= 0);
105 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_ADDED", FREEFORCESACTIVITY_ADDED); ROR_ASSERT(result >= 0);
106 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_MODIFIED", FREEFORCESACTIVITY_MODIFIED); ROR_ASSERT(result >= 0);
107 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_REMOVED", FREEFORCESACTIVITY_REMOVED); ROR_ASSERT(result >= 0);
108 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_DEFORMED", FREEFORCESACTIVITY_DEFORMED); ROR_ASSERT(result >= 0);
109 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_BROKEN", FREEFORCESACTIVITY_BROKEN); ROR_ASSERT(result >= 0);
110
111}
Central state/object manager and communications hub.
#define ROR_ASSERT(_EXPR)
Definition Application.h:40
void RegisterScriptEventsCommon(AngelScript::asIScriptEngine *engine)
Registers enum scriptEvents and related enums, defined in ScriptEventsAngelscriptCommon....