Skip to content

Commit 2d0cf7c

Browse files
committed
Clean up Resource client luadefs
(cherry picked from commit af8a5fb)
1 parent 4e83c8c commit 2d0cf7c

File tree

9 files changed

+616
-601
lines changed

9 files changed

+616
-601
lines changed

MTA10/mods/deathmatch/StdInc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
#include <luadefs/CLuaPedDefs.h>
119119
#include <luadefs/CLuaPlayerDefs.h>
120120
#include <luadefs/CLuaRadarAreaDefs.h>
121+
#include <luadefs/CLuaResourceDefs.h>
121122
#include <luadefs/CLuaVector2Defs.h>
122123
#include <luadefs/CLuaVector3Defs.h>
123124
#include <luadefs/CLuaVector4Defs.h>

MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@
377377
<ClCompile Include="..\shared_logic\luadefs\CLuaPointLightDefs.cpp" />
378378
<ClCompile Include="..\shared_logic\luadefs\CLuaPedDefs.cpp" />
379379
<ClCompile Include="..\shared_logic\luadefs\CLuaRadarAreaDefs.cpp" />
380+
<ClCompile Include="..\shared_logic\luadefs\CLuaResourceDefs.cpp" />
380381
<ClCompile Include="..\shared_logic\luadefs\CLuaSearchLightDefs.cpp" />
381382
<ClCompile Include="..\shared_logic\luadefs\CLuaVector2Defs.cpp" />
382383
<ClCompile Include="..\shared_logic\luadefs\CLuaVector3Defs.cpp" />
@@ -579,7 +580,6 @@
579580
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Output.cpp" />
580581
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Pickup.cpp" />
581582
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Projectile.cpp" />
582-
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Resource.cpp" />
583583
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Shape.cpp" />
584584
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Team.cpp" />
585585
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Util.cpp" />
@@ -768,6 +768,7 @@
768768
<ClInclude Include="..\shared_logic\luadefs\CLuaPointLightDefs.h" />
769769
<ClInclude Include="..\shared_logic\luadefs\CLuaPedDefs.h" />
770770
<ClInclude Include="..\shared_logic\luadefs\CLuaRadarAreaDefs.h" />
771+
<ClInclude Include="..\shared_logic\luadefs\CLuaResourceDefs.h" />
771772
<ClInclude Include="..\shared_logic\luadefs\CLuaSearchLightDefs.h" />
772773
<ClInclude Include="..\shared_logic\luadefs\CLuaVector2Defs.h" />
773774
<ClInclude Include="..\shared_logic\luadefs\CLuaVector3Defs.h" />

MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj.filters

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,6 @@
599599
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Projectile.cpp">
600600
<Filter>Source Files\shared_logic\lua</Filter>
601601
</ClCompile>
602-
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Resource.cpp">
603-
<Filter>Source Files\shared_logic\lua</Filter>
604-
</ClCompile>
605602
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Shape.cpp">
606603
<Filter>Source Files\shared_logic\lua</Filter>
607604
</ClCompile>
@@ -926,6 +923,9 @@
926923
<ClCompile Include="..\shared_logic\luadefs\CLuaCameraDefs.cpp">
927924
<Filter>Source Files\shared_logic\luadefs</Filter>
928925
</ClCompile>
926+
<ClCompile Include="..\shared_logic\luadefs\CLuaResourceDefs.cpp">
927+
<Filter>Source Files\shared_logic\luadefs</Filter>
928+
</ClCompile>
929929
</ItemGroup>
930930
<ItemGroup>
931931
<ClInclude Include="CClient.h">
@@ -1690,5 +1690,8 @@
16901690
<ClInclude Include="..\shared_logic\luadefs\CLuaCameraDefs.h">
16911691
<Filter>Header Files\shared_logic\luadefs</Filter>
16921692
</ClInclude>
1693+
<ClInclude Include="..\shared_logic\luadefs\CLuaResourceDefs.h">
1694+
<Filter>Header Files\shared_logic\luadefs</Filter>
1695+
</ClInclude>
16931696
</ItemGroup>
16941697
</Project>

MTA10/mods/shared_logic/lua/CLuaFunctionDefs.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,6 @@ class CLuaFunctionDefs
4242
// Reserved functions
4343
LUA_DECLARE ( DisabledFunction );
4444

45-
// Resource functions
46-
LUA_DECLARE ( Call );
47-
LUA_DECLARE ( GetThisResource );
48-
LUA_DECLARE ( GetResourceConfig );
49-
LUA_DECLARE ( GetResourceName );
50-
LUA_DECLARE ( GetResourceFromName );
51-
LUA_DECLARE ( GetResourceRootElement );
52-
LUA_DECLARE ( GetResourceGUIElement );
53-
LUA_DECLARE ( GetResourceDynamicElementRoot );
54-
LUA_DECLARE ( GetResourceExportedFunctions );
55-
LUA_DECLARE ( GetResourceState );
56-
LUA_DECLARE ( LoadString );
57-
LUA_DECLARE ( Load );
58-
5945
// Event functions
6046
LUA_DECLARE ( AddEvent );
6147
LUA_DECLARE ( AddEventHandler );

MTA10/mods/shared_logic/lua/CLuaMain.cpp

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -686,36 +686,6 @@ void CLuaMain::AddGuiFontClass ( lua_State* luaVM )
686686
lua_registerclass ( luaVM, "GuiFont", "Element" );
687687
}
688688

689-
690-
void CLuaMain::AddResourceClass ( lua_State* luaVM )
691-
{
692-
lua_newclass ( luaVM );
693-
694-
lua_classfunction ( luaVM, "create", "getResourceFromName" );
695-
lua_classfunction ( luaVM, "getFromName", "getResourceFromName" );
696-
697-
lua_classfunction ( luaVM, "getGuiElement", "getResourceGUIElement" );
698-
lua_classfunction ( luaVM, "getRootElement", "getResourceRootElement" );
699-
lua_classfunction ( luaVM, "getName", "getResourceName" );
700-
lua_classfunction ( luaVM, "getThis", "getThisResource" );
701-
lua_classfunction ( luaVM, "getConfig", "getResourceConfig" );
702-
lua_classfunction ( luaVM, "getConfig", "getResourceConfig" );
703-
lua_classfunction ( luaVM, "getDynamicElementRoot", "getResourceDynamicElementRoot" );
704-
lua_classfunction ( luaVM, "getExportedFunctions", "getResourceExportedFunctions" );
705-
lua_classfunction ( luaVM, "getState", "getResourceState" );
706-
707-
lua_classvariable ( luaVM, "config", NULL, "getResourceConfig" );
708-
lua_classvariable ( luaVM, "dynamicElementRoot", NULL, "getResourceDynamicElementRoot" );
709-
lua_classvariable ( luaVM, "exportedFunctions", NULL, "getResourceExportedFunctions" );
710-
lua_classvariable ( luaVM, "guiElement", NULL, "getResourceGUIElement" );
711-
lua_classvariable ( luaVM, "state", NULL, "getResourceState" );
712-
lua_classvariable ( luaVM, "name", NULL, "getResourceName" );
713-
lua_classvariable ( luaVM, "rootElement", NULL, "getResourceRootElement" );
714-
715-
lua_registerclass ( luaVM, "Resource" );
716-
}
717-
718-
719689
void CLuaMain::AddTimerClass ( lua_State* luaVM )
720690
{
721691
lua_newclass ( luaVM );
@@ -732,7 +702,6 @@ void CLuaMain::AddTimerClass ( lua_State* luaVM )
732702
lua_registerclass ( luaVM, "Timer" );
733703
}
734704

735-
736705
void CLuaMain::AddXMLClass ( lua_State* luaVM )
737706
{
738707
lua_newclass ( luaVM );
@@ -951,7 +920,6 @@ void CLuaMain::InitClasses ( lua_State* luaVM )
951920
AddGuiTabClass ( luaVM );
952921
AddGuiFontClass ( luaVM );
953922

954-
AddResourceClass ( luaVM );
955923
AddTimerClass ( luaVM );
956924
AddXMLClass ( luaVM );
957925

@@ -976,6 +944,7 @@ void CLuaMain::InitClasses ( lua_State* luaVM )
976944
CLuaPlayerDefs::AddClass ( luaVM );
977945
CLuaPointLightDefs::AddClass ( luaVM );
978946
CLuaRadarAreaDefs::AddClass ( luaVM );
947+
CLuaResourceDefs::AddClass ( luaVM );
979948
CLuaSearchLightDefs::AddClass ( luaVM );
980949
CLuaVehicleDefs::AddClass ( luaVM );
981950
}

MTA10/mods/shared_logic/lua/CLuaMain.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ class CLuaMain //: public CClient
102102
void AddGuiTabPanelClass ( lua_State* luaVM );
103103
void AddGuiTabClass ( lua_State* luaVM );
104104

105-
void AddResourceClass ( lua_State* luaVM );
106105
void AddTimerClass ( lua_State* luaVM );
107106
void AddXMLClass ( lua_State* luaVM );
108107

MTA10/mods/shared_logic/lua/CLuaManager.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,6 @@ void CLuaManager::LoadCFunctions ( void )
216216
CLuaCFunctions::AddFunction ( "guiMemoSetCaratIndex", CLuaFunctionDefs::GUIMemoSetCaretIndex );
217217
// ** END OF BACKWARDS COMPATIBILITY FUNCS. **
218218

219-
// Resource funcs
220-
CLuaCFunctions::AddFunction ( "call", CLuaFunctionDefs::Call );
221-
CLuaCFunctions::AddFunction ( "getThisResource", CLuaFunctionDefs::GetThisResource );
222-
CLuaCFunctions::AddFunction ( "getResourceConfig", CLuaFunctionDefs::GetResourceConfig );
223-
CLuaCFunctions::AddFunction ( "getResourceName", CLuaFunctionDefs::GetResourceName );
224-
CLuaCFunctions::AddFunction ( "getResourceFromName", CLuaFunctionDefs::GetResourceFromName );
225-
CLuaCFunctions::AddFunction ( "getResourceRootElement", CLuaFunctionDefs::GetResourceRootElement );
226-
CLuaCFunctions::AddFunction ( "getResourceGUIElement", CLuaFunctionDefs::GetResourceGUIElement );
227-
CLuaCFunctions::AddFunction ( "getResourceDynamicElementRoot", CLuaFunctionDefs::GetResourceDynamicElementRoot );
228-
CLuaCFunctions::AddFunction ( "getResourceExportedFunctions", CLuaFunctionDefs::GetResourceExportedFunctions );
229-
CLuaCFunctions::AddFunction ( "getResourceState", CLuaFunctionDefs::GetResourceState );
230-
CLuaCFunctions::AddFunction ( "loadstring", CLuaFunctionDefs::LoadString );
231-
CLuaCFunctions::AddFunction ( "load", CLuaFunctionDefs::Load );
232-
233219
// Event funcs
234220
CLuaCFunctions::AddFunction ( "addEvent", CLuaFunctionDefs::AddEvent );
235221
CLuaCFunctions::AddFunction ( "addEventHandler", CLuaFunctionDefs::AddEventHandler );
@@ -766,6 +752,7 @@ void CLuaManager::LoadCFunctions ( void )
766752
CLuaPlayerDefs::LoadFunctions ();
767753
CLuaPointLightDefs::LoadFunctions ();
768754
CLuaRadarAreaDefs::LoadFunctions ();
755+
CLuaResourceDefs::LoadFunctions ();
769756
CLuaSearchLightDefs::LoadFunctions ();
770757
CLuaTaskDefs::LoadFunctions ();
771758
CLuaVehicleDefs::LoadFunctions ();

0 commit comments

Comments
 (0)