Rigs of Rods 2023.09
Soft-body Physics Simulation
Loading...
Searching...
No Matches
ScriptEventsAngelscript.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
22#include "ScriptEvents.h"
23#include "AngelScriptBindings.h"
24#include "Application.h"
25#include <angelscript.h>
26
27using namespace AngelScript;
28
29void RoR::RegisterScriptEvents(asIScriptEngine *engine)
30{
31 int result;
32
33 // enum scriptEvents
34 result = engine->RegisterEnum("scriptEvents"); ROR_ASSERT(result>=0);
35
36 result = engine->RegisterEnumValue("scriptEvents", "SE_EVENTBOX_ENTER", SE_EVENTBOX_ENTER); ROR_ASSERT(result >= 0);
37 result = engine->RegisterEnumValue("scriptEvents", "SE_EVENTBOX_EXIT", SE_EVENTBOX_EXIT); ROR_ASSERT(result >= 0);
38
39 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_ENTER", SE_TRUCK_ENTER); ROR_ASSERT(result>=0);
40 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_EXIT", SE_TRUCK_EXIT); ROR_ASSERT(result>=0);
41
42 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_ENGINE_DIED", SE_TRUCK_ENGINE_DIED); ROR_ASSERT(result>=0);
43 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_ENGINE_FIRE", SE_TRUCK_ENGINE_FIRE); ROR_ASSERT(result>=0);
44 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_TOUCHED_WATER", SE_TRUCK_TOUCHED_WATER); ROR_ASSERT(result>=0);
45 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_LIGHT_TOGGLE", SE_TRUCK_LIGHT_TOGGLE); ROR_ASSERT(result>=0);
46 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_TIE_TOGGLE", SE_TRUCK_TIE_TOGGLE); ROR_ASSERT(result>=0);
47 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_PARKINGBRAKE_TOGGLE", SE_TRUCK_PARKINGBRAKE_TOGGLE); ROR_ASSERT(result>=0);
48 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_BEACONS_TOGGLE", SE_TRUCK_BEACONS_TOGGLE); ROR_ASSERT(result>=0);
49 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_CPARTICLES_TOGGLE", SE_TRUCK_CPARTICLES_TOGGLE); ROR_ASSERT(result>=0);
50
51 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_NEW_TRUCK", SE_GENERIC_NEW_TRUCK); ROR_ASSERT(result>=0);
52 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_DELETED_TRUCK", SE_GENERIC_DELETED_TRUCK); ROR_ASSERT(result>=0);
53
54 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_RESET", SE_TRUCK_RESET); ROR_ASSERT(result>=0);
55 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_TELEPORT", SE_TRUCK_TELEPORT); ROR_ASSERT(result>=0);
56 result = engine->RegisterEnumValue("scriptEvents", "SE_TRUCK_MOUSE_GRAB", SE_TRUCK_MOUSE_GRAB); ROR_ASSERT(result>=0);
57
58 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_MANIPULATIONS", SE_ANGELSCRIPT_MANIPULATIONS); ROR_ASSERT(result>=0);
59 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_MSGCALLBACK", SE_ANGELSCRIPT_MSGCALLBACK); ROR_ASSERT(result>=0);
60 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_LINECALLBACK", SE_ANGELSCRIPT_LINECALLBACK); ROR_ASSERT(result>=0);
61 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_EXCEPTIONCALLBACK", SE_ANGELSCRIPT_EXCEPTIONCALLBACK); ROR_ASSERT(result>=0);
62 result = engine->RegisterEnumValue("scriptEvents", "SE_ANGELSCRIPT_THREAD_STATUS", SE_ANGELSCRIPT_THREAD_STATUS); ROR_ASSERT(result>=0);
63
64 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_MESSAGEBOX_CLICK", SE_GENERIC_MESSAGEBOX_CLICK); ROR_ASSERT(result>=0);
65 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_EXCEPTION_CAUGHT", SE_GENERIC_EXCEPTION_CAUGHT); ROR_ASSERT(result>=0);
66 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_MODCACHE_ACTIVITY", SE_GENERIC_MODCACHE_ACTIVITY); ROR_ASSERT(result>=0);
67 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_TRUCK_LINKING_CHANGED", SE_GENERIC_TRUCK_LINKING_CHANGED); ROR_ASSERT(result>=0);
68 result = engine->RegisterEnumValue("scriptEvents", "SE_GENERIC_FREEFORCES_ACTIVITY", SE_GENERIC_FREEFORCES_ACTIVITY); ROR_ASSERT(result >= 0);
69
70 result = engine->RegisterEnumValue("scriptEvents", "SE_ALL_EVENTS", SE_ALL_EVENTS); ROR_ASSERT(result>=0);
71 result = engine->RegisterEnumValue("scriptEvents", "SE_NO_EVENTS", SE_NO_EVENTS); ROR_ASSERT(result>=0);
72
73 // enum angelScriptManipulationType
74 result = engine->RegisterEnum("angelScriptManipulationType"); ROR_ASSERT(result>=0);
75
76 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_CONSOLE_SNIPPET_EXECUTED", ASMANIP_CONSOLE_SNIPPET_EXECUTED); ROR_ASSERT(result >= 0);
77 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_SCRIPT_LOADED", ASMANIP_SCRIPT_LOADED); ROR_ASSERT(result >= 0);
78 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_SCRIPT_LOAD_FAILED", ASMANIP_SCRIPT_LOAD_FAILED); ROR_ASSERT(result >= 0);
79 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_SCRIPT_UNLOADING", ASMANIP_SCRIPT_UNLOADING); ROR_ASSERT(result >= 0);
80 result = engine->RegisterEnumValue("angelScriptManipulationType", "ASMANIP_ACTORSIMATTR_SET", ASMANIP_ACTORSIMATTR_SET); ROR_ASSERT(result >= 0);
81
82 // enum angelScriptThreadStatus
83 result = engine->RegisterEnum("angelScriptThreadStatus"); ROR_ASSERT(result>=0);
84
85 result = engine->RegisterEnumValue("angelScriptThreadStatus", "ASTHREADSTATUS_NONE", ASTHREADSTATUS_NONE); ROR_ASSERT(result >= 0);
86 result = engine->RegisterEnumValue("angelScriptThreadStatus", "ASTHREADSTATUS_CURLSTRING_PROGRESS", ASTHREADSTATUS_CURLSTRING_PROGRESS); ROR_ASSERT(result >= 0);
87 result = engine->RegisterEnumValue("angelScriptThreadStatus", "ASTHREADSTATUS_CURLSTRING_SUCCESS", ASTHREADSTATUS_CURLSTRING_SUCCESS ); ROR_ASSERT(result >= 0);
88 result = engine->RegisterEnumValue("angelScriptThreadStatus", "ASTHREADSTATUS_CURLSTRING_FAILURE", ASTHREADSTATUS_CURLSTRING_FAILURE ); ROR_ASSERT(result >= 0);
89
90 // enum modCacheActivityType
91 result = engine->RegisterEnum("modCacheActivityType"); ROR_ASSERT(result>=0);
92
93 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_ENTRY_ADDED", MODCACHEACTIVITY_ENTRY_ADDED); ROR_ASSERT(result >= 0);
94 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_ENTRY_DELETED", MODCACHEACTIVITY_ENTRY_DELETED); ROR_ASSERT(result >= 0);
95 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_BUNDLE_LOADED", MODCACHEACTIVITY_BUNDLE_LOADED); ROR_ASSERT(result >= 0);
96 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_BUNDLE_RELOADED", MODCACHEACTIVITY_BUNDLE_RELOADED); ROR_ASSERT(result >= 0);
97 result = engine->RegisterEnumValue("modCacheActivityType", "MODCACHEACTIVITY_BUNDLE_UNLOADED", MODCACHEACTIVITY_BUNDLE_UNLOADED); ROR_ASSERT(result >= 0);
98
99 // enum freeForcesActivityType
100 result = engine->RegisterEnum("freeForcesActivityType"); ROR_ASSERT(result >= 0);
101
102 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_NONE", FREEFORCESACTIVITY_NONE); ROR_ASSERT(result >= 0);
103 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_ADDED", FREEFORCESACTIVITY_ADDED); ROR_ASSERT(result >= 0);
104 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_MODIFIED", FREEFORCESACTIVITY_MODIFIED); ROR_ASSERT(result >= 0);
105 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_REMOVED", FREEFORCESACTIVITY_REMOVED); ROR_ASSERT(result >= 0);
106 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_DEFORMED", FREEFORCESACTIVITY_DEFORMED); ROR_ASSERT(result >= 0);
107 result = engine->RegisterEnumValue("freeForcesActivityType", "FREEFORCESACTIVITY_BROKEN", FREEFORCESACTIVITY_BROKEN); ROR_ASSERT(result >= 0);
108
109}
Central state/object manager and communications hub.
#define ROR_ASSERT(_EXPR)
Definition Application.h:40
void RegisterScriptEvents(AngelScript::asIScriptEngine *engine)
Registers enum scriptEvents, defined in ScriptEventsAngelscript.cpp.