Skip to content

Commit fa997c2

Browse files
committed
- Tidy up massively inconsistent autoload and autoexec setup in config file.
1 parent ceb8b21 commit fa997c2

File tree

1 file changed

+53
-46
lines changed

1 file changed

+53
-46
lines changed

source/core/gameconfigfile.cpp

Lines changed: 53 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -215,64 +215,71 @@ void FGameConfigFile::DoAutoloadSetup (/*FIWadManager *iwad_man*/)
215215
isInitialized = true;
216216
}
217217

218-
CreateSectionAtStart("Exhumed.Autoload");
219-
CreateSectionAtStart("WW2GI.Autoload");
220-
CreateSectionAtStart("Nam.Autoload");
221-
CreateSectionAtStart("Exhumed.Autoload");
222-
CreateSectionAtStart("Redneck.Route66.Autoload");
223-
CreateSectionAtStart("Redneck.RidesAgain.Autoload");
224-
CreateSectionAtStart("Redneck.Redneck.Autoload");
225-
CreateSectionAtStart("Redneck.Autoload");
226-
CreateSectionAtStart("ShadowWarrior.TwinDragon.Autoload");
227-
CreateSectionAtStart("ShadowWarrior.Wanton.Autoload");
228-
CreateSectionAtStart("ShadowWarrior.ShadowWarrior.Autoload");
229-
CreateSectionAtStart("ShadowWarrior.Autoload");
230-
CreateSectionAtStart("Blood.Cryptic.Autoload");
231-
CreateSectionAtStart("Blood.Blood.Autoload");
232-
CreateSectionAtStart("Blood.Autoload");
233-
CreateSectionAtStart("Duke.WorldTour.Autoload");
234-
CreateSectionAtStart("Duke.NWinter.Autoload");
235-
CreateSectionAtStart("Duke.Vacation.15.Autoload");
236-
CreateSectionAtStart("Duke.Vacation.13.Autoload");
237-
CreateSectionAtStart("Duke.Vacation.Autoload");
238-
CreateSectionAtStart("Duke.DukeDC.15.Autoload");
239-
CreateSectionAtStart("Duke.DukeDC.13.Autoload");
240-
CreateSectionAtStart("Duke.DukeDC.Autoload");
241-
CreateSectionAtStart("Duke.Duke.15.Autoload");
242-
CreateSectionAtStart("Duke.Duke.13.Autoload");
243-
CreateSectionAtStart("Duke.Duke.Autoload");
244-
CreateSectionAtStart("Duke.PParadise.Autoload");
245-
CreateSectionAtStart("Duke.Autoload");
246-
247-
CreateSectionAtStart("Global.Autoload");
248-
249-
// The same goes for auto-exec files.
250-
CreateStandardAutoExec("ShadowWarrior.AutoLoad", true);
251-
CreateStandardAutoExec("Redneck.RidesAgain.AutoLoad", true);
252-
CreateStandardAutoExec("Redneck.Redneck.AutoLoad", true);
253-
CreateStandardAutoExec("WW2GI.AutoLoad", true);
254-
CreateStandardAutoExec("Nam.AutoLoad", true);
255-
CreateStandardAutoExec("DukeNukem3D.AutoLoad", true);
256-
CreateStandardAutoExec("DukeNukem3D.DN3D.AutoLoad", true);
257-
CreateStandardAutoExec("DukeNukem3D.DukeDC.AutoLoad", true);
258-
CreateStandardAutoExec("DukeNukem3D.NWinter.AutoLoad", true);
259-
CreateStandardAutoExec("DukeNukem3D.Vacation.AutoLoad", true);
260-
CreateStandardAutoExec("DukeNukem3D.PParadise.AutoLoad", true);
218+
static constexpr const char* gamefilters[] = {
219+
"Blood",
220+
"Blood.Blood",
221+
"Blood.Cryptic",
222+
"Duke"
223+
"Duke.Duke"
224+
"Duke.Duke.13",
225+
"Duke.Duke.15",
226+
"Duke.DukeDC"
227+
"Duke.DukeDC.13",
228+
"Duke.DukeDC.15",
229+
"Duke.NWinter",
230+
"Duke.PParadise",
231+
"Duke.Vacation"
232+
"Duke.Vacation.13",
233+
"Duke.Vacation.15",
234+
"Duke.WorldTour",
235+
"Duke.Zone"
236+
"Duke.Zone.13",
237+
"Duke.Zone.15",
238+
"Exhumed"
239+
"Exhumed.Exhumed",
240+
"Exhumed.Powerslave",
241+
"Nam"
242+
"Nam.Nam",
243+
"Nam.Napalm",
244+
"Redneck"
245+
"Redneck.Redneck",
246+
"Redneck.RidesAgain",
247+
"Redneck.Route66",
248+
"ShadowWarrior"
249+
"ShadowWarrior.ShadowWarrior",
250+
"ShadowWarrior.TwinDragon",
251+
"ShadowWarrior.Wanton",
252+
"WW2GI"
253+
"WW2GI.Platoon",
254+
"WW2GI.WW2GI",
255+
};
256+
257+
for (const auto& gamefilter : gamefilters)
258+
{
259+
CreateSectionAtStart((FString(gamefilter) + ".Autoload").GetChars());
260+
CreateStandardAutoExec((FString(gamefilter) + ".Autoexec").GetChars(), true);
261+
}
261262

262263
// Move search paths back to the top.
263264
MoveSectionToStart("SoundfontSearch.Directories");
264265
MoveSectionToStart("FileSearch.Directories");
265266
MoveSectionToStart("IWADSearch.Directories");
266267

267-
SetSectionNote("DukeNukem3D.AutoLoad",
268+
SetSectionNote("Duke.Autoexec",
268269
"# Files to automatically execute when running the corresponding game.\n"
269270
"# Each file should be on its own line, preceded by Path=\n\n");
270271
SetSectionNote("Global.Autoload",
271272
"# Files to always load. These are loaded after the game data but before\n"
272273
"# any files added with -file. Place each file on its own line, preceded\n"
273274
"# by Path=\n");
274-
SetSectionNote("DukeNukem3D.Autoload",
275-
"# Files to automatically load depending on the game you are playing\n\n");
275+
SetSectionNote("Duke.Autoload",
276+
"# Files to automatically load depending on the game you are playing.\n"
277+
"# You may have have files that are loaded for all similar games and\n"
278+
"# files that are only loaded for particular games. For example, any\n"
279+
"# files listed under 'Duke.Autoload' will be loaded for any version of Duke 3D,\n"
280+
"# but files listed under 'Duke.Vacation.Autoload' will only load when you are\n"
281+
"# playing a Duke Caribbean Vacation-based game (Vaca 1.3, 1.5, etc), and files\n"
282+
"# listed under 'Duke.Vacation.15.Autoload' only when playing Duke Carribean Vacation 1.5.\n\n");
276283
}
277284

278285
void FGameConfigFile::DoGlobalSetup ()

0 commit comments

Comments
 (0)