diff --git a/src/deh_soc.c b/src/deh_soc.c index 14544c2fc..764d08628 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -3432,7 +3432,16 @@ void readcupheader(MYFILE *f, cupheader_t *cup) i = atoi(word2); // used for numerical settings strupr(word2); - if (fastcmp(word, "ICON")) + if (fastcmp(word, "MONITOR")) + { + if (i > 0 && i < 10) + cup->monitor = i; + else if (!word2[0] || word2[1] != '\0' || word2[0] == '0') + deh_warning("%s Cup: Invalid monitor type \"%s\" (should be 1-9 or A-Z)\n", cup->name, word2); + else + cup->monitor = (word2[0] - 'A') + 10; + } + else if (fastcmp(word, "ICON")) { deh_strlcpy(cup->icon, word2, sizeof(cup->icon), va("%s Cup: icon", cup->name)); diff --git a/src/dehacked.c b/src/dehacked.c index 7a916c950..9e50a9f42 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -486,6 +486,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile) { cup = Z_Calloc(sizeof (cupheader_t), PU_STATIC, NULL); cup->id = numkartcupheaders; + cup->monitor = 1; deh_strlcpy(cup->name, word2, sizeof(cup->name), va("Cup header %s: name", word2)); if (prev != NULL) diff --git a/src/doomstat.h b/src/doomstat.h index 8496c27b5..ad4bf3b14 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -375,6 +375,7 @@ struct customoption_t struct cupheader_t { UINT16 id; ///< Cup ID + UINT8 monitor; ///< Monitor graphic 1-9 or A-Z char name[15]; ///< Cup title (14 chars) char icon[9]; ///< Name of the icon patch char *levellist[CUPCACHE_MAX]; ///< List of levels that belong to this cup diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 273ffdf95..01089958e 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -2134,7 +2134,7 @@ void M_DrawCupSelect(void) INT16 x, y; INT16 icony = 7; char status = 'A'; - UINT8 monitor = 1; + char monitor; INT32 rankx = 0; if (!cupgrid.builtgrid[id]) @@ -2176,14 +2176,24 @@ void M_DrawCupSelect(void) colormap = NULL; } - if (templevelsearch.cup->emeraldnum > 7) { - monitor = 2; - icony = 5; - rankx = 2; + if (templevelsearch.cup->monitor < 10) + { + monitor = '0' + templevelsearch.cup->monitor; + + if (templevelsearch.cup->monitor == '2') + { + icony = 5; + rankx = 2; + } + } + else + { + monitor = 'A' + (templevelsearch.cup->monitor - 10); + } } - patch = W_CachePatchName(va("CUPMON%d%c", monitor, status), PU_CACHE); + patch = W_CachePatchName(va("CUPMON%c%c", monitor, status), PU_CACHE); x = 14 + (i*42); y = 20 + (j*44) - (30*menutransition.tics);