CCMD listmaps: Colorize maps loaded from pwads in blue text

Colorize maps added from pwads differently so they stand out better
This commit is contained in:
yqco 2022-12-30 21:02:23 -06:00 committed by Christoph Oelckers
parent 80d1c61714
commit e0275df931

View file

@ -361,6 +361,8 @@ CCMD(targetinv)
CCMD(listmaps)
{
int iwadNum = fileSystem.GetIwadNum();
for (unsigned i = 0; i < wadlevelinfos.Size(); i++)
{
level_info_t *info = &wadlevelinfos[i];
@ -368,13 +370,20 @@ CCMD(listmaps)
if (map != NULL)
{
int mapWadNum = fileSystem.GetFileContainer(map->lumpnum);
if (argv.argc() == 1
|| CheckWildcards(argv[1], info->MapName.GetChars())
|| CheckWildcards(argv[1], info->LookupLevelName().GetChars())
|| CheckWildcards(argv[1], fileSystem.GetResourceFileName(fileSystem.GetFileContainer(map->lumpnum))))
|| CheckWildcards(argv[1], fileSystem.GetResourceFileName(mapWadNum)))
{
Printf("%s: '%s' (%s)\n", info->MapName.GetChars(), info->LookupLevelName().GetChars(),
fileSystem.GetResourceFileName(fileSystem.GetFileContainer(map->lumpnum)));
bool isFromPwad = mapWadNum != iwadNum;
const char* lineColor = isFromPwad ? TEXTCOLOR_LIGHTBLUE : "";
Printf("%s%s: '%s' (%s)\n", lineColor, info->MapName.GetChars(),
info->LookupLevelName().GetChars(),
fileSystem.GetResourceFileName(mapWadNum));
}
delete map;
}