From e0275df9315ffe924c9b8fddde4b351b4333ae0e Mon Sep 17 00:00:00 2001 From: yqco <20593027+yqco@users.noreply.github.com> Date: Fri, 30 Dec 2022 21:02:23 -0600 Subject: [PATCH] CCMD listmaps: Colorize maps loaded from pwads in blue text Colorize maps added from pwads differently so they stand out better --- src/g_dumpinfo.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/g_dumpinfo.cpp b/src/g_dumpinfo.cpp index 72400708bd..96951df6fb 100644 --- a/src/g_dumpinfo.cpp +++ b/src/g_dumpinfo.cpp @@ -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; }