mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Merge branch 'matchrace-restore' into 'master'
Match Race menu restoring See merge request KartKrew/Kart!913
This commit is contained in:
		
						commit
						a1cd780a14
					
				
					 6 changed files with 46 additions and 31 deletions
				
			
		| 
						 | 
				
			
			@ -3982,7 +3982,9 @@ static void G_GetNextMap(void)
 | 
			
		|||
 | 
			
		||||
		if (K_CanChangeRules(true))
 | 
			
		||||
		{
 | 
			
		||||
			switch (cv_advancemap.value)
 | 
			
		||||
			if (!netgame) // Match Race.
 | 
			
		||||
				nextmap = NEXTMAP_TITLE;
 | 
			
		||||
			else switch (cv_advancemap.value)
 | 
			
		||||
			{
 | 
			
		||||
				case 0: // Stay on same map.
 | 
			
		||||
					nextmap = prevmap;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -760,6 +760,7 @@ extern consvar_t cv_dummykartspeed;
 | 
			
		|||
extern consvar_t cv_dummygpencore;
 | 
			
		||||
extern consvar_t cv_dummymatchbots;
 | 
			
		||||
 | 
			
		||||
void M_SetupDifficultyOptions(INT32 choice);
 | 
			
		||||
void M_SetupDifficultySelect(INT32 choice);
 | 
			
		||||
void M_DifficultySelectInputs(INT32 choice);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -384,6 +384,7 @@ menu_t *M_SpecificMenuRestore(menu_t *torestore)
 | 
			
		|||
		if (levellist.newgametype == GT_RACE)
 | 
			
		||||
		{
 | 
			
		||||
			M_SetupRaceMenu(-1);
 | 
			
		||||
			M_SetupDifficultyOptions((cupgrid.grandprix == false));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (!M_LevelListFromGametype(-1))
 | 
			
		||||
| 
						 | 
				
			
			@ -409,6 +410,13 @@ menu_t *M_SpecificMenuRestore(menu_t *torestore)
 | 
			
		|||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	else if (torestore == &PLAY_RaceDifficultyDef)
 | 
			
		||||
	{
 | 
			
		||||
		// Handle a much smaller subset of unlock restrictions
 | 
			
		||||
		M_SetupGametypeMenu(-1);
 | 
			
		||||
		M_SetupRaceMenu(-1);
 | 
			
		||||
		M_SetupDifficultyOptions((cupgrid.grandprix == false));
 | 
			
		||||
	}
 | 
			
		||||
	else if (torestore == &EXTRAS_ReplayHutDef)
 | 
			
		||||
	{
 | 
			
		||||
		// Handle modifications to the folder while playing
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,14 +71,8 @@ static CV_PossibleValue_t dummymatchbots_cons_t[] = {
 | 
			
		|||
};
 | 
			
		||||
consvar_t cv_dummymatchbots = CVAR_INIT ("dummymatchbots", "Off", CV_HIDDEN, dummymatchbots_cons_t, NULL);
 | 
			
		||||
 | 
			
		||||
void M_SetupDifficultySelect(INT32 choice)
 | 
			
		||||
void M_SetupDifficultyOptions(INT32 choice)
 | 
			
		||||
{
 | 
			
		||||
	// check what we picked.
 | 
			
		||||
	choice = currentMenu->menuitems[itemOn].mvar1;
 | 
			
		||||
 | 
			
		||||
	// setup the difficulty menu and then remove choices depending on choice
 | 
			
		||||
	PLAY_RaceDifficultyDef.prevMenu = currentMenu;
 | 
			
		||||
 | 
			
		||||
	PLAY_RaceDifficulty[drace_gpdifficulty].status = IT_DISABLED;
 | 
			
		||||
	PLAY_RaceDifficulty[drace_mrkartspeed].status = IT_DISABLED;
 | 
			
		||||
	PLAY_RaceDifficulty[drace_mrcpu].status = IT_DISABLED;
 | 
			
		||||
| 
						 | 
				
			
			@ -94,6 +88,11 @@ void M_SetupDifficultySelect(INT32 choice)
 | 
			
		|||
		PLAY_RaceDifficulty[drace_mrracers].status = IT_STRING2|IT_CVAR;	// CPU amount
 | 
			
		||||
		PLAY_RaceDifficulty[drace_mapselect].status = IT_STRING|IT_CALL;	// Level Select (Match Race)
 | 
			
		||||
		PLAY_RaceDifficultyDef.lastOn = drace_mapselect;	// Select map select by default.
 | 
			
		||||
 | 
			
		||||
		if (M_SecretUnlocked(SECRET_ENCORE, false))
 | 
			
		||||
		{
 | 
			
		||||
			PLAY_RaceDifficulty[drace_encore].status = IT_STRING2|IT_CVAR;	// Encore on/off
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	else			// GP
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			@ -101,11 +100,16 @@ void M_SetupDifficultySelect(INT32 choice)
 | 
			
		|||
		PLAY_RaceDifficulty[drace_cupselect].status = IT_STRING|IT_CALL;	// Level Select (GP)
 | 
			
		||||
		PLAY_RaceDifficultyDef.lastOn = drace_cupselect;	// Select cup select by default.
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
	if (M_SecretUnlocked(SECRET_ENCORE, false))
 | 
			
		||||
	{
 | 
			
		||||
		PLAY_RaceDifficulty[drace_encore].status = IT_STRING2|IT_CVAR;	// Encore on/off
 | 
			
		||||
	}
 | 
			
		||||
void M_SetupDifficultySelect(INT32 choice)
 | 
			
		||||
{
 | 
			
		||||
	(void)choice;
 | 
			
		||||
 | 
			
		||||
	// setup the difficulty menu and then remove choices depending on choice
 | 
			
		||||
	PLAY_RaceDifficultyDef.prevMenu = currentMenu;
 | 
			
		||||
 | 
			
		||||
	M_SetupDifficultyOptions(currentMenu->menuitems[itemOn].mvar1);
 | 
			
		||||
 | 
			
		||||
	M_SetupNextMenu(&PLAY_RaceDifficultyDef, false);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -500,7 +500,7 @@ void M_LevelSelected(INT16 add)
 | 
			
		|||
			}
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				restoreMenu = &PLAY_LevelSelectDef;
 | 
			
		||||
				restoreMenu = &PLAY_RaceDifficultyDef;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -569,19 +569,28 @@ skiptallydrawer:
 | 
			
		|||
	if (!LUA_HudEnabled(hud_intermissionmessages))
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (timer && grandprixinfo.gp == false && !modeattacking)
 | 
			
		||||
	if (timer)
 | 
			
		||||
	{
 | 
			
		||||
		char *string;
 | 
			
		||||
		INT32 tickdown = (timer+1)/TICRATE;
 | 
			
		||||
		if (netgame || demo.netgame)
 | 
			
		||||
		{
 | 
			
		||||
			char *string;
 | 
			
		||||
			INT32 tickdown = (timer+1)/TICRATE;
 | 
			
		||||
 | 
			
		||||
		if (multiplayer && demo.playback)
 | 
			
		||||
			string = va("Replay ends in %d", tickdown);
 | 
			
		||||
		else
 | 
			
		||||
			string = va("%s starts in %d", cv_advancemap.string, tickdown);
 | 
			
		||||
			if (demo.playback)
 | 
			
		||||
				string = va("Replay ends in %d", tickdown);
 | 
			
		||||
			else
 | 
			
		||||
				string = va("%s starts in %d", cv_advancemap.string, tickdown);
 | 
			
		||||
 | 
			
		||||
		V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol, string);
 | 
			
		||||
			V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol, string);
 | 
			
		||||
 | 
			
		||||
		if ((demo.recording || demo.savemode == DSM_SAVED) && !demo.playback)
 | 
			
		||||
			if (speedscramble != -1 && speedscramble != gamespeed)
 | 
			
		||||
			{
 | 
			
		||||
				V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, hilicol|V_ALLOWLOWERCASE|V_SNAPTOBOTTOM,
 | 
			
		||||
					va(M_GetText("Next race will be %s Speed!"), kartspeed_cons_t[1+speedscramble].strvalue));
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if ((modeattacking == ATTACKING_NONE) && (demo.recording || demo.savemode == DSM_SAVED) && !demo.playback)
 | 
			
		||||
		{
 | 
			
		||||
			switch (demo.savemode)
 | 
			
		||||
			{
 | 
			
		||||
| 
						 | 
				
			
			@ -601,15 +610,6 @@ skiptallydrawer:
 | 
			
		|||
					break;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//if ((intertic/TICRATE) & 1) // Make it obvious that scrambling is happening next round. (OR NOT, I GUESS)
 | 
			
		||||
		//{
 | 
			
		||||
			if (speedscramble != -1 && speedscramble != gamespeed)
 | 
			
		||||
			{
 | 
			
		||||
				V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, hilicol|V_ALLOWLOWERCASE|V_SNAPTOBOTTOM,
 | 
			
		||||
					va(M_GetText("Next race will be %s Speed!"), kartspeed_cons_t[1+speedscramble].strvalue));
 | 
			
		||||
			}
 | 
			
		||||
		//}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	M_DrawMenuForeground();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue