mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-28 18:00:40 +00:00
- autodetect .inis when loading Blood mods.
This works as long as the loaded mods have one single .ini file in them - in that case it is assumed that it is supposed to replace blood.ini, which will allow dragging & dropping such archives without further user intervention.
This commit is contained in:
parent
5984fda8a1
commit
bfcedc2177
1 changed files with 22 additions and 0 deletions
|
@ -115,6 +115,28 @@ void levelLoadMapInfo(IniFile *pIni, MapRecord *pLevelInfo, const char *pzSectio
|
||||||
|
|
||||||
static const char* DefFile(void)
|
static const char* DefFile(void)
|
||||||
{
|
{
|
||||||
|
int found = -1;
|
||||||
|
if (userConfig.DefaultCon.IsEmpty() || userConfig.DefaultCon.CompareNoCase("blood.ini") == 0)
|
||||||
|
{
|
||||||
|
int numlumps = fileSystem.GetNumEntries();
|
||||||
|
for (int i = numlumps - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
if (fileSystem.GetFileContainer(i) <= fileSystem.GetMaxIwadNum()) break;
|
||||||
|
FString fn = fileSystem.GetFileFullName(i, false);
|
||||||
|
FString ext = fn.Right(4);
|
||||||
|
if (ext.CompareNoCase(".ini") == 0)
|
||||||
|
{
|
||||||
|
if (fileSystem.CheckNumForFullName(fn) != i) continue;
|
||||||
|
if (found == -1) found = i;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
found = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found >= 0) return fileSystem.GetFileFullName(found);
|
||||||
// The command line parser stores this in the CON field.
|
// The command line parser stores this in the CON field.
|
||||||
return userConfig.DefaultCon.IsNotEmpty() ? userConfig.DefaultCon.GetChars() : "blood.ini";
|
return userConfig.DefaultCon.IsNotEmpty() ? userConfig.DefaultCon.GetChars() : "blood.ini";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue