From 6604d0181c426f3a710107d20e840e636a815f94 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 4 Nov 2018 01:00:17 +0000 Subject: [PATCH 1/9] Staff attack ghost names on the `REPLAY...` menu. Also: Remove playercolor being set to the replay's color. No need to kill your settings, seeing as it makes no tangible effect on your replay (doesn't even lose colour when you die, so I don't even know...) --- src/g_game.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++- src/g_game.h | 1 + src/m_menu.c | 27 ++++++++++++++++++++-- src/m_menu.h | 2 ++ 4 files changed, 91 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index fecef69a..54f7c329 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5861,7 +5861,7 @@ void G_DoPlayDemo(char *defdemoname) players[0].skincolor = i; break; } - CV_StealthSetValue(&cv_playercolor, players[0].skincolor); + //CV_StealthSetValue(&cv_playercolor, players[0].skincolor); -- as far as I can tell this is more trouble than it's worth if (players[0].mo) { players[0].mo->color = players[0].skincolor; @@ -6115,6 +6115,68 @@ void G_AddGhost(char *defdemoname) Z_Free(pdemoname); } +// A simplified version of G_AddGhost... +void G_UpdateStaffGhostName(lumpnum_t l) +{ + UINT8 *buffer,*p; + UINT16 ghostversion; + UINT8 flags; + + buffer = p = W_CacheLumpNum(l, PU_CACHE); + + // read demo header + if (memcmp(p, DEMOHEADER, 12)) + { + goto fail; + } p += 12; // DEMOHEADER + p++; // VERSION + p++; // SUBVERSION + ghostversion = READUINT16(p); + switch(ghostversion) + { + case DEMOVERSION: // latest always supported + break; + // too old, cannot support. + default: + goto fail; + } + p += 16; // demo checksum + if (memcmp(p, "PLAY", 4)) + { + goto fail; + } p += 4; // "PLAY" + p += 2; // gamemap + p += 16; // mapmd5 (possibly check for consistency?) + flags = READUINT8(p); + if (!(flags & DF_GHOST)) + { + goto fail; // we don't NEED to do it here, but whatever + } + switch ((flags & DF_ATTACKMASK)>>DF_ATTACKSHIFT) + { + case ATTACKING_NONE: // 0 + break; + case ATTACKING_RECORD: // 1 + p += 8; // demo time, lap + break; + /*case ATTACKING_NIGHTS: // 2 + p += 8; // demo time left, score + break;*/ + default: // 3 + break; + } + p += 4; // random seed + + // Player name + M_Memcpy(dummystaffname, p,16); + dummystaffname[16] = '\0'; + + // Ok, no longer any reason to care, bye +fail: + Z_Free(buffer); + return; +} + // // G_TimeDemo // NOTE: name is a full filename for external demos diff --git a/src/g_game.h b/src/g_game.h index 7620861e..898ce424 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -183,6 +183,7 @@ extern demoghost *ghosts; void G_DoPlayDemo(char *defdemoname); void G_TimeDemo(const char *name); void G_AddGhost(char *defdemoname); +void G_UpdateStaffGhostName(lumpnum_t l); void G_DoPlayMetal(void); void G_DoneLevelLoad(void); void G_StopMetalDemo(void); diff --git a/src/m_menu.c b/src/m_menu.c index 5dc09a83..b81f827f 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1472,7 +1472,7 @@ static menuitem_t OP_ServerOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 40}, {IT_STRING | IT_CVAR, NULL, "Map Progression", &cv_advancemap, 50}, {IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 60}, - {IT_STRING | IT_CVAR, NULL, "Voting Rule Changes", &cv_kartvoterulechanges, 70}, + {IT_STRING | IT_CVAR, NULL, "Voting Rule Changes", &cv_kartvoterulechanges, 70}, #ifndef NONET {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90}, @@ -2098,6 +2098,9 @@ static void Nextmap_OnChange(void) SP_GhostMenu[4].status = IT_STRING|IT_CVAR; CV_StealthSetValue(&cv_dummystaff, 1); active |= 1; + + dummystaffname[0] = '\0'; + G_UpdateStaffGhostName(l); } if (active) { @@ -2145,9 +2148,14 @@ static void Dummymenuplayer_OnChange(void) } }*/ +char dummystaffname[17]; + static void Dummystaff_OnChange(void) { lumpnum_t l; + + dummystaffname[0] = '\0'; + if ((l = W_CheckNumForName(va("%sS01",G_BuildMapName(cv_nextmap.value)))) == LUMPERROR) { CV_StealthSetValue(&cv_dummystaff, 0); @@ -2163,6 +2171,11 @@ static void Dummystaff_OnChange(void) CV_StealthSetValue(&cv_dummystaff, numstaff); else if (cv_dummystaff.value > numstaff) CV_StealthSetValue(&cv_dummystaff, 1); + + if ((l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(cv_nextmap.value), cv_dummystaff.value))) == LUMPERROR) + return; // shouldn't happen but might as well check... + + G_UpdateStaffGhostName(l); } } @@ -6433,7 +6446,17 @@ void M_DrawTimeAttackMenu(void) } } else if ((currentMenu->menuitems[i].status & IT_TYPE) == IT_KEYHANDLER && cv_dummystaff.value) // bad hacky assumption: IT_KEYHANDLER is assumed to be staff ghost selector - V_DrawString(BASEVIDWIDTH - x - 80 - V_StringWidth(cv_dummystaff.string, 0), y, highlightflags, cv_dummystaff.string); + { + INT32 strw = V_StringWidth(dummystaffname, V_ALLOWLOWERCASE); + V_DrawString(BASEVIDWIDTH - x - strw, y, highlightflags|V_ALLOWLOWERCASE, dummystaffname); + if (i == itemOn) + { + V_DrawCharacter(BASEVIDWIDTH - x - 10 - strw - (skullAnimCounter/5), y, + '\x1C' | highlightflags, false); // left arrow + V_DrawCharacter(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y, + '\x1D' | highlightflags, false); // right arrow + } + } } x = currentMenu->x; diff --git a/src/m_menu.h b/src/m_menu.h index c300380b..d9770711 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -211,6 +211,8 @@ extern description_t description[32]; extern consvar_t cv_newgametype, cv_nextmap, cv_chooseskin, cv_serversort; extern CV_PossibleValue_t gametype_cons_t[]; +extern char dummystaffname[17]; + extern INT16 startmap; extern INT32 ultimate_selectable; From e2f57e5ca0e8052bebd58afc102bd718630dc44f Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 4 Nov 2018 12:15:13 +0000 Subject: [PATCH 2/9] Add a wide lap sticker for the record attack menu, so you're not looking at the same icon twice to mean two different things. https://cdn.discordapp.com/attachments/270211093761097728/508614473628647442/kart0002.png --- src/k_kart.c | 18 ++++++++++-------- src/k_kart.h | 2 +- src/m_menu.c | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 39ef34c0..6d4e8e58 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5575,6 +5575,7 @@ static patch_t *kp_nodraw; static patch_t *kp_timesticker; static patch_t *kp_timestickerwide; static patch_t *kp_lapsticker; +static patch_t *kp_lapstickerwide; static patch_t *kp_lapstickernarrow; static patch_t *kp_splitlapflag; static patch_t *kp_bumpersticker; @@ -5654,6 +5655,7 @@ void K_LoadKartHUDGraphics(void) kp_timesticker = W_CachePatchName("K_STTIME", PU_HUDGFX); kp_timestickerwide = W_CachePatchName("K_STTIMW", PU_HUDGFX); kp_lapsticker = W_CachePatchName("K_STLAPS", PU_HUDGFX); + kp_lapstickerwide = W_CachePatchName("K_STLAPW", PU_HUDGFX); kp_lapstickernarrow = W_CachePatchName("K_STLAPN", PU_HUDGFX); kp_splitlapflag = W_CachePatchName("K_SPTLAP", PU_HUDGFX); kp_bumpersticker = W_CachePatchName("K_STBALN", PU_HUDGFX); @@ -6258,7 +6260,7 @@ static void K_drawKartItem(void) V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); } -void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing) +void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UINT8 mode) { // TIME_X = BASEVIDWIDTH-124; // 196 // TIME_Y = 6; // 6 @@ -6266,7 +6268,7 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, bo tic_t worktime; INT32 splitflags = 0; - if (playing) + if (!mode) { splitflags = V_HUDTRANS|K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTORIGHT); if (cv_timelimit.value && timelimitintics > 0) @@ -6278,13 +6280,13 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, bo } } - V_DrawScaledPatch(TX, TY, splitflags, kp_timestickerwide); + V_DrawScaledPatch(TX, TY, splitflags, ((mode == 2) ? kp_lapstickerwide : kp_timestickerwide)); TX += 33; worktime = drawtime/(60*TICRATE); - if (!playing && !drawtime) + if (mode && !drawtime) V_DrawKartString(TX, TY+3, splitflags, va("--'--\"--")); else if (worktime < 100) // 99:99:99 only { @@ -6334,7 +6336,7 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, bo else if ((drawtime/TICRATE) & 1) V_DrawKartString(TX, TY+3, splitflags, va("99'59\"99")); - if (emblemmap && (modeattacking || !playing)) // emblem time! + if (emblemmap && (modeattacking || (mode == 1))) // emblem time! { INT32 workx = TX + 96, worky = TY+18; SINT8 curemb = 0; @@ -6367,7 +6369,7 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, bo G_TicsToSeconds(timetoreach), G_TicsToCentiseconds(timetoreach)); - if (playing) + if (!mode) { if (stplyr->realtime > timetoreach) { @@ -6399,7 +6401,7 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, bo emblem = M_GetLevelEmblems(-1); } - if (playing) + if (!mode) splitflags = (splitflags &~ V_HUDTRANSHALF)|V_HUDTRANS; while (curemb--) { @@ -7770,7 +7772,7 @@ void K_drawKartHUD(void) if (!splitscreen) { // Draw the timestamp - K_drawKartTimestamp(stplyr->realtime, TIME_X, TIME_Y, gamemap, true); + K_drawKartTimestamp(stplyr->realtime, TIME_X, TIME_Y, gamemap, 0); if (!modeattacking) { diff --git a/src/k_kart.h b/src/k_kart.h index 67229330..3f4002a8 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -67,7 +67,7 @@ void K_LoadKartHUDGraphics(void); fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my); void K_drawKartHUD(void); void K_drawKartFreePlay(UINT32 flashtime); -void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing); +void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UINT8 mode); // ========================================================================= #endif // __K_KART__ diff --git a/src/m_menu.c b/src/m_menu.c index b81f827f..c93c3937 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6480,10 +6480,10 @@ void M_DrawTimeAttackMenu(void) V_DrawFill((BASEVIDWIDTH - dupadjust)>>1, 78, dupadjust, 36, 239); V_DrawRightAlignedString(149, 80, highlightflags, "BEST LAP:"); - K_drawKartTimestamp(lap, 19, 86, 0, false); + K_drawKartTimestamp(lap, 19, 86, 0, 2); V_DrawRightAlignedString(292, 80, highlightflags, "BEST TIME:"); - K_drawKartTimestamp(time, 162, 86, cv_nextmap.value, false); + K_drawKartTimestamp(time, 162, 86, cv_nextmap.value, 1); } /*{ char beststr[40]; From 75d08f2048eb27f9285ec44dd76d79f3ee1601e3 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 5 Nov 2018 13:45:40 +0000 Subject: [PATCH 3/9] TITLE SCREEN DEMOS: Pick a random Staff Attack demo!!! Also: Fix watching a demo replay of a map with a palette not resetting your palette back to normal when you go back to the menu(/titlescreen). --- src/f_finale.c | 40 +++++++++++++++++++++++++++++++++------- src/g_game.c | 26 +++++++++++++++++++++----- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index a6689d34..a87dc0b9 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -49,7 +49,7 @@ static tic_t stoptimer; static boolean keypressed = false; // (no longer) De-Demo'd Title Screen -static UINT8 curDemo = 0; +static UINT8 laststaff = 0; static UINT32 demoDelayLeft; static UINT32 demoIdleLeft; @@ -985,8 +985,8 @@ void F_TitleScreenTicker(boolean run) if (gameaction != ga_nothing || gamestate != GS_TITLESCREEN) return; - // no demos to play? or, are they disabled? - if (!cv_rollingdemos.value || !numDemos) + // are demos disabled? + if (!cv_rollingdemos.value) return; // Wait for a while (for the music to finish, preferably) @@ -1009,27 +1009,53 @@ void F_TitleScreenTicker(boolean run) { char dname[9]; lumpnum_t l; + const char *mapname; + UINT8 numstaff; // prevent console spam if failed demoIdleLeft = demoIdleTime; + if ((l = W_CheckNumForName("MAP01S01")) == LUMPERROR) // gotta have ONE + { + F_StartIntro(); + return; + } + // Replay intro when done cycling through demos - if (curDemo == numDemos) + /*if (curDemo == numDemos) -- uuuh... we have a LOT of maps AND a big devteam... probably not gonna see a repeat unless you're super unlucky :V { curDemo = 0; F_StartIntro(); return; + }*/ + + mapname = G_BuildMapName(G_RandMap(TOL_RACE, -2, false, false, 0, false)+1); + + numstaff = 1; + while (numstaff < 100 && (l = W_CheckNumForName(va("%sS%02u",mapname,numstaff+1))) != LUMPERROR) + numstaff++; + if (laststaff && laststaff <= numstaff) // don't do the same staff member twice in a row, even if they're on different maps + { + numstaff = M_RandomKey(numstaff-1)+1; + if (numstaff >= laststaff) + numstaff++; + laststaff = numstaff; + } + else + { + numstaff = M_RandomKey(numstaff)+1; + laststaff = 0; } // Setup demo name - snprintf(dname, 9, "DEMO_%03u", ++curDemo); + snprintf(dname, 9, "%sS%02u", mapname, numstaff); - if ((l = W_CheckNumForName(dname)) == LUMPERROR) + /*if ((l = W_CheckNumForName(dname)) == LUMPERROR) -- we KNOW it exists now { CONS_Alert(CONS_ERROR, M_GetText("Demo lump \"%s\" doesn't exist\n"), dname); F_StartIntro(); return; - } + }*/ titledemo = true; G_DoPlayDemo(dname); diff --git a/src/g_game.c b/src/g_game.c index 54f7c329..56cb1ae7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3312,7 +3312,7 @@ tryagain: || (!dedicated && M_MapLocked(ix+1)) || (!maphell && (mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU)) // this is bad || ((maphell == 2) && !(mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU))) // gasp - isokmap = false; + continue; //isokmap = false; if (!ignorebuffer) { @@ -3328,8 +3328,17 @@ tryagain: } } - if (isokmap) - okmaps[numokmaps++] = ix; + if (!isokmap) + continue; + + if (pprevmap == -2) // title demos + { + lumpnum_t l; + if ((l = W_CheckNumForName(va("%sS01",G_BuildMapName(ix+1)))) == LUMPERROR) + continue; + } + + okmaps[numokmaps++] = ix; } if (numokmaps == 0) // If there's no matches... (Goodbye, incredibly silly function chains :V) @@ -4095,8 +4104,8 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride) } save_p += VERSIONSIZE; -// if (demoplayback) // reset game engine -// G_StopDemo(); + if (demoplayback) // reset game engine + G_StopDemo(); // paused = false; // automapactive = false; @@ -6321,10 +6330,17 @@ void G_StopDemo(void) Z_Free(demobuffer); demobuffer = NULL; demoplayback = false; + if (titledemo) + modeattacking = false; titledemo = false; timingdemo = false; singletics = false; + if (gamestate == GS_LEVEL && rendermode != render_none) + { + V_SetPaletteLump("PLAYPAL"); // Reset the palette + R_ReInitColormaps(0, LUMPERROR); + } if (gamestate == GS_INTERMISSION) Y_EndIntermission(); // cleanup if (gamestate == GS_VOTING) From 0d0eaf5f991464fe68f7e46655b23b322eb002e0 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 5 Nov 2018 14:03:09 +0000 Subject: [PATCH 4/9] Fix "laststaff" setting --- src/f_finale.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index a87dc0b9..b5367bc0 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1034,18 +1034,16 @@ void F_TitleScreenTicker(boolean run) numstaff = 1; while (numstaff < 100 && (l = W_CheckNumForName(va("%sS%02u",mapname,numstaff+1))) != LUMPERROR) numstaff++; - if (laststaff && laststaff <= numstaff) // don't do the same staff member twice in a row, even if they're on different maps + if (laststaff && laststaff <= numstaff && numstaff > 1) // don't do the same staff member twice in a row, even if they're on different maps { numstaff = M_RandomKey(numstaff-1)+1; if (numstaff >= laststaff) numstaff++; - laststaff = numstaff; } else - { numstaff = M_RandomKey(numstaff)+1; - laststaff = 0; - } + + laststaff = numstaff; // Setup demo name snprintf(dname, 9, "%sS%02u", mapname, numstaff); From 7be7c600bf32457e784d2955321606bc56fe84a8 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 5 Nov 2018 14:28:32 +0000 Subject: [PATCH 5/9] Cleaner code logic. Should make no real difference to exe, so not gonna upload another. --- src/f_finale.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index b5367bc0..046a55e5 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1034,14 +1034,17 @@ void F_TitleScreenTicker(boolean run) numstaff = 1; while (numstaff < 100 && (l = W_CheckNumForName(va("%sS%02u",mapname,numstaff+1))) != LUMPERROR) numstaff++; - if (laststaff && laststaff <= numstaff && numstaff > 1) // don't do the same staff member twice in a row, even if they're on different maps + if (numstaff > 1) { - numstaff = M_RandomKey(numstaff-1)+1; - if (numstaff >= laststaff) - numstaff++; + if (laststaff && laststaff <= numstaff) // don't do the same staff member twice in a row, even if they're on different maps + { + numstaff = M_RandomKey(numstaff-1)+1; + if (numstaff >= laststaff) + numstaff++; + } + else + numstaff = M_RandomKey(numstaff)+1; } - else - numstaff = M_RandomKey(numstaff)+1; laststaff = numstaff; From 5ccfc111e8310a84d580ce7091f10aefe330437b Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 5 Nov 2018 23:18:34 +0000 Subject: [PATCH 6/9] Disable attempt at preventing replays with the same staff member back to back, based on Discord discussion. If the RNG does this to you, you're on your own. --- src/f_finale.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/f_finale.c b/src/f_finale.c index 046a55e5..60a4e396 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -49,7 +49,9 @@ static tic_t stoptimer; static boolean keypressed = false; // (no longer) De-Demo'd Title Screen +#if 0 static UINT8 laststaff = 0; +#endif static UINT32 demoDelayLeft; static UINT32 demoIdleLeft; @@ -1034,6 +1036,8 @@ void F_TitleScreenTicker(boolean run) numstaff = 1; while (numstaff < 100 && (l = W_CheckNumForName(va("%sS%02u",mapname,numstaff+1))) != LUMPERROR) numstaff++; + +#if 0 // turns out this isn't how we're gonna organise 'em if (numstaff > 1) { if (laststaff && laststaff <= numstaff) // don't do the same staff member twice in a row, even if they're on different maps @@ -1045,8 +1049,10 @@ void F_TitleScreenTicker(boolean run) else numstaff = M_RandomKey(numstaff)+1; } - laststaff = numstaff; +#else + numstaff = M_RandomKey(numstaff)+1; +#endif // Setup demo name snprintf(dname, 9, "%sS%02u", mapname, numstaff); From 390d2b41145129544558b9721de633d5987ce99a Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 6 Nov 2018 13:38:53 +0000 Subject: [PATCH 7/9] Fix replaying guest demos --- src/m_menu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 21f81555..3121da6e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6851,9 +6851,7 @@ static void M_ReplayTimeAttack(INT32 choice) case 2: // last which = "last"; break; - case 3: // best staff - return; // M_HandleStaffReplay - case 4: // guest + case 3: // guest // srb2/replay/main/map01-guest.lmp G_DoPlayDemo(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value))); return; From cf16959ad52e0063cf1d01c73c8edcfb8681e66d Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 7 Nov 2018 18:01:50 +0000 Subject: [PATCH 8/9] Clean but quick: Rename all user-facing things that say "emblem" to say "medal" instead. Don't touch SOC, don't touch code, otherwise we'll be here all year. --- src/d_netcmd.c | 2 +- src/m_cond.c | 14 +++++++------- src/m_menu.c | 18 +++++++++--------- src/y_inter.c | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 6e598801..cf0a96f9 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4933,7 +4933,7 @@ static void Fishcake_OnChange(void) static void Command_Isgamemodified_f(void) { if (savemoddata) - CONS_Printf(M_GetText("modifiedgame is true, but you can save emblem and time data in this mod.\n")); + CONS_Printf(M_GetText("modifiedgame is true, but you can save medal and time data in this mod.\n")); else if (modifiedgame) CONS_Printf(M_GetText("modifiedgame is true, secrets will not be unlocked\n")); else diff --git a/src/m_cond.c b/src/m_cond.c index 3e2baa1f..2f57a75d 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -117,27 +117,27 @@ void M_SetupDefaultConditionSets(void) { memset(conditionSets, 0, sizeof(conditionSets)); - // -- 1: Collect 5 emblems OR play 10 matches + // -- 1: Collect 5 medals OR play 10 matches M_AddRawCondition(1, 1, UC_TOTALEMBLEMS, 5, 0, 0); M_AddRawCondition(1, 2, UC_MATCHESPLAYED, 10, 0, 0); - // -- 2: Collect 10 emblems OR play 25 matches + // -- 2: Collect 10 medals OR play 25 matches M_AddRawCondition(2, 1, UC_TOTALEMBLEMS, 10, 0, 0); M_AddRawCondition(2, 2, UC_MATCHESPLAYED, 25, 0, 0); - // -- 3: Collect 20 emblems OR play 50 matches + // -- 3: Collect 20 medals OR play 50 matches M_AddRawCondition(3, 1, UC_TOTALEMBLEMS, 20, 0, 0); M_AddRawCondition(3, 2, UC_MATCHESPLAYED, 50, 0, 0); - // -- 4: Collect 30 emblems OR play 100 matches + // -- 4: Collect 30 medals OR play 100 matches M_AddRawCondition(4, 1, UC_TOTALEMBLEMS, 30, 0, 0); M_AddRawCondition(4, 2, UC_MATCHESPLAYED, 100, 0, 0); - // -- 5: Collect 40 emblems OR play 150 matches + // -- 5: Collect 40 medals OR play 150 matches M_AddRawCondition(5, 1, UC_TOTALEMBLEMS, 40, 0, 0); M_AddRawCondition(5, 2, UC_MATCHESPLAYED, 150, 0, 0); - // -- 6: Collect 50 emblems ONLY + // -- 6: Collect 50 medals ONLY M_AddRawCondition(6, 1, UC_TOTALEMBLEMS, 50, 0, 0); // -- 10: Play 300 matches @@ -318,7 +318,7 @@ UINT8 M_UpdateUnlockablesAndExtraEmblems(boolean force) continue; if ((extraemblems[i].collected = M_Achieved(extraemblems[i].conditionset - 1)) != false) { - strcat(cechoText, va(M_GetText("Got \"%s\" emblem!\\"), extraemblems[i].name)); + strcat(cechoText, va(M_GetText("Got \"%s\" medal!\\"), extraemblems[i].name)); ++cechoLines; } } diff --git a/src/m_menu.c b/src/m_menu.c index 3121da6e..d96c8faf 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -593,7 +593,7 @@ static menuitem_t SPauseMenu[] = { // Pandora's Box will be shifted up if both options are available {IT_CALL | IT_STRING, NULL, "Pandora's Box...", M_PandorasBox, 16}, - {IT_CALL | IT_STRING, NULL, "Emblem Hints...", M_EmblemHints, 24}, + {IT_CALL | IT_STRING, NULL, "Medal Hints...", M_EmblemHints, 24}, //{IT_CALL | IT_STRING, NULL, "Level Select...", M_LoadGameLevelSelect, 32}, {IT_CALL | IT_STRING, NULL, "Continue", M_SelectableClearMenus,48}, @@ -739,7 +739,7 @@ static menuitem_t SR_UnlockChecklistMenu[] = static menuitem_t SR_EmblemHintMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Emblem Radar", &cv_itemfinder, 10}, + {IT_STRING|IT_CVAR, NULL, "Medal Radar", &cv_itemfinder, 10}, {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SPauseDef, 20} }; @@ -5141,9 +5141,9 @@ static char *M_GetConditionString(condition_t cond) G_TicsToSeconds(cond.requirement), G_TicsToCentiseconds(cond.requirement)); case UC_TOTALEMBLEMS: - return va("Get %d emblems", cond.requirement); + return va("Get %d medals", cond.requirement); case UC_EXTRAEMBLEM: - return va("Get \"%s\" emblem", extraemblems[cond.requirement-1].name); + return va("Get \"%s\" medal", extraemblems[cond.requirement-1].name); default: return NULL; } @@ -5249,7 +5249,7 @@ static void M_DrawEmblemHints(void) break; } if (!j) - V_DrawCenteredString(160, 48, highlightflags, "No hidden emblems on this map."); + V_DrawCenteredString(160, 48, highlightflags, "No hidden medals on this map."); M_DrawGenericMenu(); } @@ -5547,7 +5547,7 @@ static void M_DrawLoadGameData(void) V_DrawCenteredString(ecks + 68, 144, V_ORANGEMAP, "PLAY WITHOUT SAVING"); V_DrawCenteredString(ecks + 68, 156, 0, "THIS GAME WILL NOT BE"); V_DrawCenteredString(ecks + 68, 164, 0, "SAVED, BUT YOU CAN STILL"); - V_DrawCenteredString(ecks + 68, 172, 0, "GET EMBLEMS AND SECRETS."); + V_DrawCenteredString(ecks + 68, 172, 0, "GET MEDALS AND SECRETS."); } return; } @@ -6207,7 +6207,7 @@ static void M_DrawStatsMaps(int location) else if (dotopname) { V_DrawString(20, y, highlightflags, "LEVEL NAME"); - V_DrawString(248, y, highlightflags, "EMBLEMS"); + V_DrawString(256, y, highlightflags, "MEDALS"); y += 8; dotopname = false; } @@ -6233,7 +6233,7 @@ static void M_DrawStatsMaps(int location) if (dotopname && !location) { V_DrawString(20, y, highlightflags, "LEVEL NAME"); - V_DrawString(248, y, highlightflags, "EMBLEMS"); + V_DrawString(256, y, highlightflags, "MEDALS"); y += 8; } else if (location) @@ -6244,7 +6244,7 @@ static void M_DrawStatsMaps(int location) { if (i == -1) { - V_DrawString(20, y, highlightflags, "EXTRA EMBLEMS"); + V_DrawString(20, y, highlightflags, "EXTRA MEDALS"); if (location) { y += 8; diff --git a/src/y_inter.c b/src/y_inter.c index 6c3226bb..e2403f2f 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -704,7 +704,7 @@ static void Y_UpdateRecordReplays(void) // Check emblems when level data is updated if ((earnedEmblems = M_CheckLevelEmblems())) - CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for Record Attack records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); + CONS_Printf(M_GetText("\x82" "Earned %hu medal%s for Record Attack records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); // Update timeattack menu's replay availability. CV_AddValue(&cv_nextmap, 1); From 8e6ecb5e98b1f9d521c29f7d371f4b3d781c604a Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 7 Nov 2018 21:42:10 +0000 Subject: [PATCH 9/9] * Add numbers to the staff name strings as Sryder requested. * Make the maximum number of staff ghosts 99 instead of 100. It's a minor thing, and insignificant in the grand scheme of things, but it fixes a bugbear I haven't been able to get out of my head since originally starting to maintain this code. (In the case of 100, it'd do S00, which'd have some fucky effects on ordering. If we WANTED to start with S00, we shoulda used that slot in the first place.) --- src/f_finale.c | 2 +- src/m_menu.c | 18 +++++++++++------- src/m_menu.h | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 60a4e396..e3920b46 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1034,7 +1034,7 @@ void F_TitleScreenTicker(boolean run) mapname = G_BuildMapName(G_RandMap(TOL_RACE, -2, false, false, 0, false)+1); numstaff = 1; - while (numstaff < 100 && (l = W_CheckNumForName(va("%sS%02u",mapname,numstaff+1))) != LUMPERROR) + while (numstaff < 99 && (l = W_CheckNumForName(va("%sS%02u",mapname,numstaff+1))) != LUMPERROR) numstaff++; #if 0 // turns out this isn't how we're gonna organise 'em diff --git a/src/m_menu.c b/src/m_menu.c index d96c8faf..64668d72 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2033,7 +2033,6 @@ static void Nextmap_OnChange(void) { char *leveltitle; UINT8 active; - lumpnum_t l; // Update the string in the consvar. Z_Free(cv_nextmap.zstring); @@ -2093,15 +2092,14 @@ static void Nextmap_OnChange(void) SP_GhostMenu[3].status = IT_STRING|IT_CVAR; active |= 3; } - if ((l = W_CheckNumForName(va("%sS01",G_BuildMapName(cv_nextmap.value)))) != LUMPERROR) + + CV_SetValue(&cv_dummystaff, 1); + if (cv_dummystaff.value) { SP_ReplayMenu[4].status = IT_WHITESTRING|IT_KEYHANDLER; SP_GhostMenu[4].status = IT_STRING|IT_CVAR; CV_StealthSetValue(&cv_dummystaff, 1); active |= 1; - - dummystaffname[0] = '\0'; - G_UpdateStaffGhostName(l); } if (active) { @@ -2149,7 +2147,7 @@ static void Dummymenuplayer_OnChange(void) } }*/ -char dummystaffname[17]; +char dummystaffname[22]; static void Dummystaff_OnChange(void) { @@ -2164,8 +2162,9 @@ static void Dummystaff_OnChange(void) } else { + char *temp = dummystaffname; UINT8 numstaff = 1; - while (numstaff < 100 && (l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(cv_nextmap.value),numstaff+1))) != LUMPERROR) + while (numstaff < 99 && (l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(cv_nextmap.value),numstaff+1))) != LUMPERROR) numstaff++; if (cv_dummystaff.value < 1) @@ -2177,6 +2176,11 @@ static void Dummystaff_OnChange(void) return; // shouldn't happen but might as well check... G_UpdateStaffGhostName(l); + + while (*temp) + temp++; + + sprintf(temp, " - %d", cv_dummystaff.value); } } diff --git a/src/m_menu.h b/src/m_menu.h index d9770711..dc99e6bb 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -211,7 +211,7 @@ extern description_t description[32]; extern consvar_t cv_newgametype, cv_nextmap, cv_chooseskin, cv_serversort; extern CV_PossibleValue_t gametype_cons_t[]; -extern char dummystaffname[17]; +extern char dummystaffname[22]; extern INT16 startmap; extern INT32 ultimate_selectable;