Skip to content

Commit 8ba00c7

Browse files
committed
Use DataModuleType instead of separate params in ModuleMan::LoadDataModule (followup to 895556c)
1 parent e5c02b8 commit 8ba00c7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Managers/ModuleMan.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ namespace RTE {
164164

165165
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
166166

167-
bool ModuleMan::LoadDataModule(const std::string &moduleName, bool official, bool userdata, const ProgressCallback &progressCallback) {
167+
bool ModuleMan::LoadDataModule(const std::string &moduleName, DataModule::DataModuleType moduleType, const ProgressCallback &progressCallback) {
168168
if (moduleName.empty()) {
169169
return false;
170170
}
@@ -225,7 +225,7 @@ namespace RTE {
225225

226226
void ModuleMan::LoadOfficialModules() {
227227
for (const std::string &officialModule : c_OfficialModules) {
228-
if (!LoadDataModule(officialModule, true, false, LoadingScreen::LoadingSplashProgressReport)) {
228+
if (!LoadDataModule(officialModule, DataModule::DataModuleType::Official, LoadingScreen::LoadingSplashProgressReport)) {
229229
RTEAbort("Failed to load official DataModule \"" + officialModule + "\"!");
230230
}
231231
}
@@ -241,7 +241,7 @@ namespace RTE {
241241

242242
// If a single module is specified, skip loading all other unofficial modules and load specified module only.
243243
if (!m_SingleModuleToLoad.empty() && !IsModuleOfficial(m_SingleModuleToLoad)) {
244-
if (!LoadDataModule(m_SingleModuleToLoad, false, false, LoadingScreen::LoadingSplashProgressReport)) {
244+
if (!LoadDataModule(m_SingleModuleToLoad, DataModule::DataModuleType::Unofficial, LoadingScreen::LoadingSplashProgressReport)) {
245245
g_ConsoleMan.PrintString("ERROR: Failed to load DataModule \"" + m_SingleModuleToLoad + "\"! Only official modules were loaded!");
246246
return false;
247247
}

Managers/ModuleMan.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,10 @@ namespace RTE {
175175
/// Reads an entire DataModule and adds it to this. NOTE that official modules can't be loaded after any non-official ones!
176176
/// </summary>
177177
/// <param name="moduleName">The module name to read, e.g. "Base.rte".</param>
178-
/// <param name="official">Whether this module is 'official' or third party. If official, it has to not have any name conflicts with any other official module.</param>
179-
/// <param name="userdata">Whether this module is a userdata module. If true, will be treated as an unofficial module.
178+
/// <param name="moduleType">The type of module that is being read. See DataModule::DataModuleType enumeration.</param>
180179
/// <param name="progressCallback">A function pointer to a function that will be called and sent a string with information about the progress of this DataModule's creation.</param>
181180
/// <returns>Whether the DataModule was read and added correctly.</returns>
182-
bool LoadDataModule(const std::string &moduleName, bool official, bool userdata = false, const ProgressCallback &progressCallback = nullptr);
181+
bool LoadDataModule(const std::string &moduleName, DataModule::DataModuleType moduleType, const ProgressCallback &progressCallback = nullptr);
183182

184183
/// <summary>
185184
/// Loads all the official data modules individually with LoadDataModule, then proceeds to look for any non-official modules and loads them as well.

0 commit comments

Comments
 (0)