diff --git a/src/k_menu.h b/src/k_menu.h index 38a7edb07..1fd0e93bf 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1467,6 +1467,8 @@ extern struct challengesmenu_s { UINT8 fade; + UINT8 hornposting; + boolean cache_secondrowlocked; patch_t *tile_category[10][2]; diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 9781b07b1..4e2610fc2 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -7303,23 +7303,50 @@ static void M_DrawChallengePreview(INT32 x, INT32 y) y = (BASEVIDHEIGHT-14); + const char *actiontext = NULL; + if (setup_numplayers <= 1 && cv_lastprofile[0].value != PROFILE_GUEST) { profile_t *pr = PR_GetProfile(cv_lastprofile[0].value); - if (pr) + if (pr && strcmp(pr->follower, followers[fskin].name)) { - K_DrawGameControl( - 4, y, 0, - strcmp(pr->follower, followers[fskin].name) - ? " Set on Profile" - : " Set on Profile", - 0, TINY_FONT, 0 - ); - y -= 14; + actiontext = (followers[fskin].hornsound == sfx_melody) + ? " Set on Profile" + : " Set on Profile"; } } + if (!actiontext) + { + if (followers[fskin].hornsound == sfx_melody) + { + actiontext = " Play Ancient Melody?"; + } + else switch (challengesmenu.hornposting % 4) + { + default: + actiontext = " Say hello"; + break; + case 1: + actiontext = " Express your feelings"; + break; + case 2: + actiontext = " Celebrate victory"; + break; + case 3: + actiontext = " Announce you are pressing horn"; + break; + } + } + + K_DrawGameControl( + 4, y, 0, + actiontext, + 0, TINY_FONT, 0 + ); + y -= 14; + if (followers[fskin].category < numfollowercategories) { V_DrawFixedPatch(4*FRACUNIT, (y - 6)*FRACUNIT, diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index 0af2095cb..60cbc9944 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -393,6 +393,7 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu) challengesmenu.tutorialfound = NEXTMAP_INVALID; challengesmenu.chaokeyhold = 0; challengesmenu.unlockcondition = NULL; + challengesmenu.hornposting = 0; if (firstopen) { @@ -1251,24 +1252,36 @@ boolean M_ChallengesInputs(INT32 ch) } case SECRET_FOLLOWER: { - if (setup_numplayers <= 1 && cv_lastprofile[0].value != PROFILE_GUEST && M_MenuConfirmPressed(pid)) + if (M_MenuConfirmPressed(pid)) { INT32 fskin = M_UnlockableFollowerNum(ref); if (fskin != -1) { - profile_t *pr = PR_GetProfile(cv_lastprofile[0].value); - - if (pr && strcmp(pr->follower, followers[fskin].name)) + if (setup_numplayers <= 1 && cv_lastprofile[0].value != PROFILE_GUEST) { - strcpy(pr->follower, followers[fskin].name); - CV_Set(&cv_follower[0], followers[fskin].name); + profile_t *pr = PR_GetProfile(cv_lastprofile[0].value); - S_StartSound(NULL, sfx_s3k63); - S_StartSound(NULL, followers[fskin].hornsound); - M_SetMenuDelay(pid); + if (pr && strcmp(pr->follower, followers[fskin].name)) + { + strcpy(pr->follower, followers[fskin].name); + CV_Set(&cv_follower[0], followers[fskin].name); - forceflip = true; + challengesmenu.hornposting = 0; + + S_StartSound(NULL, sfx_s3k63); + forceflip = true; + } } + + if (!forceflip) + { + challengesmenu.hornposting++; + } + + S_StartSound(NULL, followers[fskin].hornsound); + M_SetMenuDelay(pid); + + forceflip = true; } } break;