@@ -136,131 +136,6 @@ void CLuaMain::InitSecurity ( void )
136136 lua_register ( m_luaVM, " newproxy" , CLuaFunctionDefs::DisabledFunction );
137137}
138138
139-
140- // TODO: specials
141- void CLuaMain::AddElementClass ( lua_State* luaVM )
142- {
143- lua_newclass ( luaVM );
144-
145- // Class functions
146- lua_classfunction ( luaVM, " getByID" , " getElementByID" );
147- lua_classfunction ( luaVM, " getAllByType" , " getElementsByType" );
148-
149- // Action functions
150- lua_classfunction ( luaVM, " create" , " createElement" );
151- lua_classfunction ( luaVM, " clone" , " cloneElement" );
152- lua_classfunction ( luaVM, " attach" , " attachElements" );
153- lua_classfunction ( luaVM, " detach" , " detachElements" );
154- lua_classfunction ( luaVM, " destroy" , " destroyElement" );
155- lua_classfunction ( luaVM, " removeData" , " removeElementData" );
156- lua_classfunction ( luaVM, " clearVisibleTo" , " clearElementVisibleTo" );
157-
158- // Get functions
159- lua_classfunction ( luaVM, " areCollisionsEnabled" , " areElementCollisionsEnabled" );
160- lua_classfunction ( luaVM, " isWithinColShape" , " isElementWithinColShape" );
161- lua_classfunction ( luaVM, " isWithinMarker" , " isElementWithinMarker" );
162- lua_classfunction ( luaVM, " isInWater" , " isElementInWater" );
163- lua_classfunction ( luaVM, " isFrozen" , " isElementFrozen" );
164- lua_classfunction ( luaVM, " isLowLOD" , " isElementLowLOD" );
165- lua_classfunction ( luaVM, " isDoubleSided" , " isElementDoubleSided" );
166- lua_classfunction ( luaVM, " isVisibleTo" , " isElementVisibleTo" );
167- lua_classfunction ( luaVM, " isCollidableWith" , " isElementCollidableWith" );
168- lua_classfunction ( luaVM, " isAttached" , " isElementAttached" );
169- lua_classfunction ( luaVM, " isCallPropagationEnabled" , " isElementCallPropagationEnabled" );
170- lua_classfunction ( luaVM, " isWaitingForGroundToLoad" , " isElementWaitingForGroundToLoad" );
171- lua_classfunction ( luaVM, " isOnScreen" , " isElementOnScreen" );
172- lua_classfunction ( luaVM, " isStreamedIn" , " isElementStreamedIn" );
173- lua_classfunction ( luaVM, " isStreamable" , " isElementStreamable" );
174- lua_classfunction ( luaVM, " isLocal" , " isElementLocal" );
175- lua_classfunction ( luaVM, " isSyncer" , " isElementSyncer" );
176- lua_classfunction ( luaVM, " getChildren" , " getElementChildren" );
177- lua_classfunction ( luaVM, " getChild" , " getElementChild" );
178- lua_classfunction ( luaVM, " getChildrenCount" , " getElementChildrenCount" );
179- lua_classfunction ( luaVM, " getAllData" , " getAllElementData" );
180- lua_classfunction ( luaVM, " getID" , " getElementID" );
181- lua_classfunction ( luaVM, " getParent" , " getElementParent" );
182- lua_classfunction ( luaVM, " getBoundingBox" , " getElementBoundingBox" );
183- lua_classfunction ( luaVM, " getPosition" , CLuaOOPDefs::GetElementPosition );
184- lua_classfunction ( luaVM, " getRotation" , CLuaOOPDefs::GetElementRotation );
185- lua_classfunction ( luaVM, " getMatrix" , CLuaOOPDefs::GetElementMatrix );
186- lua_classfunction ( luaVM, " getVelocity" , CLuaOOPDefs::GetElementVelocity );
187- lua_classfunction ( luaVM, " getByType" , " getElementsByType" );
188- lua_classfunction ( luaVM, " getDistanceFromCentreOfMassToBaseOfModel" , " getElementDistanceFromCentreOfMassToBaseOfModel" );
189- lua_classfunction ( luaVM, " getRadius" , " getElementRadius" );
190- lua_classfunction ( luaVM, " getType" , " getElementType" );
191- lua_classfunction ( luaVM, " getInterior" , " getElementInterior" );
192- lua_classfunction ( luaVM, " getWithinColShape" , " getElementsWithinColShape" );
193- lua_classfunction ( luaVM, " getDimension" , " getElementDimension" );
194- lua_classfunction ( luaVM, " getZoneName" , " getElementZoneName" );
195- lua_classfunction ( luaVM, " getColShape" , " getElementColShape" );
196- lua_classfunction ( luaVM, " getAlpha" , " getElementAlpha" );
197- lua_classfunction ( luaVM, " getHealth" , " getElementHealth" );
198- lua_classfunction ( luaVM, " getModel" , " getElementModel" );
199- lua_classfunction ( luaVM, " getLowLOD" , " getLowLODElement" );
200- lua_classfunction ( luaVM, " getAttachedElements" , " getAttachedElements" );
201- lua_classfunction ( luaVM, " getAttachedTo" , " getElementAttachedTo" );
202- lua_classfunction ( luaVM, " getAttachedOffsets" , " getElementAttachedOffsets" );
203- lua_classfunction ( luaVM, " getData" , " getElementData" );
204-
205- lua_classfunction ( luaVM, " setAttachedOffsets" , " setElementAttachedOffsets" );
206- lua_classfunction ( luaVM, " setData" , " setElementData" );
207- lua_classfunction ( luaVM, " setID" , " setElementID" );
208- lua_classfunction ( luaVM, " setParent" , " setElementParent" );
209- lua_classfunction ( luaVM, " setPosition" , " setElementPosition" );
210- lua_classfunction ( luaVM, " setRotation" , CLuaOOPDefs::SetElementRotation );
211- lua_classfunction ( luaVM, " setMatrix" , " setElementMatrix" );
212- lua_classfunction ( luaVM, " setVelocity" , " setElementVelocity" );
213- lua_classfunction ( luaVM, " setVisibleTo" , " setElementVisibleTo" );
214- lua_classfunction ( luaVM, " setInterior" , " setElementInterior" );
215- lua_classfunction ( luaVM, " setDimension" , " setElementDimension" );
216- lua_classfunction ( luaVM, " setAlpha" , " setElementAlpha" );
217- lua_classfunction ( luaVM, " setDoubleSided" , " setElementDoubleSided" );
218- lua_classfunction ( luaVM, " setHealth" , " setElementHealth" );
219- lua_classfunction ( luaVM, " setModel" , " setElementModel" );
220- lua_classfunction ( luaVM, " setCollisionsEnabled" , " setElementCollisionsEnabled" );
221- lua_classfunction ( luaVM, " setCollidableWith" , " setElementCollidableWith" );
222- lua_classfunction ( luaVM, " setFrozen" , " setElementFrozen" );
223- lua_classfunction ( luaVM, " setLowLOD" , " setLowLODElement" );
224- lua_classfunction ( luaVM, " setCallPropagationEnabled" , " setElementCallPropagationEnabled" );
225- lua_classfunction ( luaVM, " setStreamable" , " setElementStreamable" );
226-
227- lua_classvariable ( luaVM, " callPropagationEnabled" , " setElementCallPropagationEnabled" , " isElementCallPropagationEnabled" );
228- lua_classvariable ( luaVM, " waitingForGroundToLoad" , NULL , " isElementWaitingForGroundToLoad" );
229- lua_classvariable ( luaVM, " onScreen" , NULL , " isElementOnScreen" );
230- lua_classvariable ( luaVM, " streamedIn" , NULL , " isElementStreamedIn" );
231- lua_classvariable ( luaVM, " streamable" , " setElementStreamable" , " isElementStreamable" );
232- lua_classvariable ( luaVM, " localElement" , NULL , " isElementLocal" );
233- lua_classvariable ( luaVM, " id" , " setElementID" , " getElementID" );
234- lua_classvariable ( luaVM, " type" , NULL , " getElementType" );
235- lua_classvariable ( luaVM, " colShape" , NULL , " getElementColShape" );
236- lua_classvariable ( luaVM, " parent" , " setElementParent" , " getElementParent" );
237- lua_classvariable ( luaVM, " attachedTo" , " attachElements" , " getElementAttachedTo" );
238- lua_classvariable ( luaVM, " attached" , NULL , " isElementAttached" );
239- lua_classvariable ( luaVM, " health" , " setElementHealth" , " getElementHealth" );
240- lua_classvariable ( luaVM, " alpha" , " setElementAlpha" , " getElementAlpha" );
241- lua_classvariable ( luaVM, " doubleSided" , " setElementDoubleSided" , " isElementDoubleSided" );
242- lua_classvariable ( luaVM, " model" , " setElementModel" , " getElementModel" );
243- lua_classvariable ( luaVM, " syncedByLocalPlayer" , NULL , " isElementSyncer" );
244- lua_classvariable ( luaVM, " collisions" , " setElementCollisionsEnabled" , " getElementCollisionsEnabled" );
245- lua_classvariable ( luaVM, " frozen" , " setElementFrozen" , " isElementFrozen" );
246- lua_classvariable ( luaVM, " inWater" , NULL , " isElementInWater" );
247- lua_classvariable ( luaVM, " lowLOD" , " setLowLODElement" , " getLowLODElement" );
248- lua_classvariable ( luaVM, " dimension" , " setElementDimension" , " getElementDimension" );
249- lua_classvariable ( luaVM, " interior" , " setElementInterior" , " getElementInterior" );
250- lua_classvariable ( luaVM, " distanceFromCentreOfMassToBaseOfModel" , NULL , " getElementDistanceFromCentreOfMassToBaseOfModel" );
251- lua_classvariable ( luaVM, " radius" , NULL , " getElementRadius" );
252- lua_classvariable ( luaVM, " childrenCount" , NULL , " getElementChildrenCount" );
253- lua_classvariable ( luaVM, " position" , CLuaFunctionDefs::SetElementPosition, CLuaOOPDefs::GetElementPosition );
254- lua_classvariable ( luaVM, " rotation" , CLuaOOPDefs::SetElementRotation, CLuaOOPDefs::GetElementRotation );
255- lua_classvariable ( luaVM, " matrix" , CLuaFunctionDefs::SetElementMatrix, CLuaOOPDefs::GetElementMatrix );
256- lua_classvariable ( luaVM, " velocity" , CLuaFunctionDefs::SetElementVelocity, CLuaOOPDefs::GetElementVelocity );
257- lua_classvariable ( luaVM, " isElement" , NULL , " isElement" );
258- lua_classvariable ( luaVM, " data" , NULL , " getAllElementData" ); // TODO: .data["age"] = 1337;
259-
260- lua_registerclass ( luaVM, " Element" );
261- }
262-
263-
264139void CLuaMain::AddPickupClass ( lua_State* luaVM )
265140{
266141 lua_newclass ( luaVM );
@@ -1119,7 +994,7 @@ void CLuaMain::InitClasses ( lua_State* luaVM )
1119994 if ( !m_bEnableOOP )
1120995 return ;
1121996
1122- AddElementClass ( luaVM );
997+ CLuaElementDefs::AddClass ( luaVM );
1123998 AddPickupClass ( luaVM );
1124999 AddColShapeClass ( luaVM );
11251000 AddProjectileClass ( luaVM );
0 commit comments