Skip to content

Commit e15ad77

Browse files
committed
Add overload for ModuleMan::GetDataModule that gets with name instead of ID
Might be useless, idk
1 parent 64f97ed commit e15ad77

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Lua/LuaBindingsManagers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ namespace RTE {
108108

109109
.def_readwrite("Modules", &ModuleMan::m_LoadedDataModules, luabind::return_stl_iterator)
110110

111-
.def("GetDataModule", &ModuleMan::GetDataModule)
111+
.def("GetDataModule", (DataModule * (ModuleMan::*)(int))&ModuleMan::GetDataModule)
112+
.def("GetDataModule", (DataModule * (ModuleMan::*)(const std::string_view &))&ModuleMan::GetDataModule)
112113
.def("GetModuleID", &ModuleMan::GetModuleID)
113114
.def("GetModuleIDFromPath", &ModuleMan::GetModuleIDFromPath)
114115
.def("GetTotalModuleCount", &ModuleMan::GetTotalModuleCount)

Managers/ModuleMan.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ namespace RTE {
7373
/// <returns>The requested DataModule. Ownership is NOT transferred!</returns>
7474
DataModule * GetDataModule(int whichModule = 0);
7575

76+
/// <summary>
77+
/// Gets a specific loaded DataModule.
78+
/// </summary>
79+
/// <param name="whichModule">The name of the DataModule to get, including the ".rte".</param>
80+
/// <returns>The requested DataModule. Ownership is NOT transferred!</returns>
81+
DataModule * GetDataModule(const std::string_view &moduleName) { return GetDataModule(GetModuleID(moduleName)); }
7682
#pragma endregion
7783

7884
#pragma region DataModule Info Getters

0 commit comments

Comments
 (0)