mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
* Fixed the Mode Attack cv_nextmap issue Salt found.
* Improved the defaulting system to work cross-gametype. * Cleaned up the code. Less hacks!
This commit is contained in:
parent
3aa7573c86
commit
d670189c89
5 changed files with 15 additions and 15 deletions
|
@ -1532,7 +1532,8 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese
|
||||||
// The supplied data are assumed to be good.
|
// The supplied data are assumed to be good.
|
||||||
I_Assert(delay >= 0 && delay <= 2);
|
I_Assert(delay >= 0 && delay <= 2);
|
||||||
|
|
||||||
CV_SetValue(&cv_nextmap, mapnum);
|
if (mapnum != -1)
|
||||||
|
CV_SetValue(&cv_nextmap, mapnum);
|
||||||
|
|
||||||
CONS_Debug(DBG_GAMELOGIC, "Map change: mapnum=%d gametype=%d ultmode=%d resetplayers=%d delay=%d skipprecutscene=%d\n",
|
CONS_Debug(DBG_GAMELOGIC, "Map change: mapnum=%d gametype=%d ultmode=%d resetplayers=%d delay=%d skipprecutscene=%d\n",
|
||||||
mapnum, newgametype, pultmode, resetplayers, delay, skipprecutscene);
|
mapnum, newgametype, pultmode, resetplayers, delay, skipprecutscene);
|
||||||
|
|
|
@ -697,8 +697,7 @@ void G_SetNightsRecords(void)
|
||||||
free(gpath);
|
free(gpath);
|
||||||
|
|
||||||
// If the mare count changed, this will update the score display
|
// If the mare count changed, this will update the score display
|
||||||
CV_AddValue(&cv_nextmap, 1);
|
Nextmap_OnChange();
|
||||||
CV_AddValue(&cv_nextmap, -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// for consistency among messages: this modifies the game and removes savemoddata.
|
// for consistency among messages: this modifies the game and removes savemoddata.
|
||||||
|
|
18
src/m_menu.c
18
src/m_menu.c
|
@ -377,7 +377,6 @@ static void M_HandleFogColor(INT32 choice);
|
||||||
static void M_HandleVideoMode(INT32 choice);
|
static void M_HandleVideoMode(INT32 choice);
|
||||||
|
|
||||||
// Consvar onchange functions
|
// Consvar onchange functions
|
||||||
static void Nextmap_OnChange(void);
|
|
||||||
static void Newgametype_OnChange(void);
|
static void Newgametype_OnChange(void);
|
||||||
static void Dummymares_OnChange(void);
|
static void Dummymares_OnChange(void);
|
||||||
|
|
||||||
|
@ -1850,8 +1849,8 @@ menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOp
|
||||||
// Prototypes
|
// Prototypes
|
||||||
static INT32 M_GetFirstLevelInList(INT32 gt);
|
static INT32 M_GetFirstLevelInList(INT32 gt);
|
||||||
|
|
||||||
// Nextmap. Used for Time Attack.
|
// Nextmap. Used for Level select.
|
||||||
static void Nextmap_OnChange(void)
|
void Nextmap_OnChange(void)
|
||||||
{
|
{
|
||||||
char *leveltitle;
|
char *leveltitle;
|
||||||
char tabase[256];
|
char tabase[256];
|
||||||
|
@ -6303,8 +6302,7 @@ static void M_EraseGuest(INT32 choice)
|
||||||
M_SetupNextMenu(&SP_NightsAttackDef);
|
M_SetupNextMenu(&SP_NightsAttackDef);
|
||||||
else
|
else
|
||||||
M_SetupNextMenu(&SP_TimeAttackDef);
|
M_SetupNextMenu(&SP_TimeAttackDef);
|
||||||
CV_AddValue(&cv_nextmap, -1);
|
Nextmap_OnChange();
|
||||||
CV_AddValue(&cv_nextmap, 1);
|
|
||||||
M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING);
|
M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6330,8 +6328,7 @@ static void M_OverwriteGuest(const char *which, boolean nights)
|
||||||
M_SetupNextMenu(&SP_NightsAttackDef);
|
M_SetupNextMenu(&SP_NightsAttackDef);
|
||||||
else
|
else
|
||||||
M_SetupNextMenu(&SP_TimeAttackDef);
|
M_SetupNextMenu(&SP_TimeAttackDef);
|
||||||
CV_AddValue(&cv_nextmap, -1);
|
Nextmap_OnChange();
|
||||||
CV_AddValue(&cv_nextmap, 1);
|
|
||||||
M_StartMessage(M_GetText("Guest replay data saved.\n"),NULL,MM_NOTHING);
|
M_StartMessage(M_GetText("Guest replay data saved.\n"),NULL,MM_NOTHING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6422,9 +6419,7 @@ static void M_ModeAttackEndGame(INT32 choice)
|
||||||
G_SetGamestate(GS_TIMEATTACK);
|
G_SetGamestate(GS_TIMEATTACK);
|
||||||
modeattacking = ATTACKING_NONE;
|
modeattacking = ATTACKING_NONE;
|
||||||
S_ChangeMusicInternal("_inter", true);
|
S_ChangeMusicInternal("_inter", true);
|
||||||
// Update replay availability.
|
Nextmap_OnChange();
|
||||||
CV_AddValue(&cv_nextmap, 1);
|
|
||||||
CV_AddValue(&cv_nextmap, -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========
|
// ========
|
||||||
|
@ -6897,6 +6892,9 @@ static void M_MapChange(INT32 choice)
|
||||||
|
|
||||||
CV_SetValue(&cv_newgametype, choice);
|
CV_SetValue(&cv_newgametype, choice);
|
||||||
|
|
||||||
|
if (Playing() && !(M_CanShowLevelOnPlatter(cv_nextmap.value-1, choice)) && (M_CanShowLevelOnPlatter(gamemap-1, choice)))
|
||||||
|
CV_SetValue(&cv_nextmap, gamemap);
|
||||||
|
|
||||||
if (!M_PrepareLevelPlatter(choice))
|
if (!M_PrepareLevelPlatter(choice))
|
||||||
{
|
{
|
||||||
M_StartMessage(M_GetText("No selectable levels found.\n"),NULL,MM_NOTHING);
|
M_StartMessage(M_GetText("No selectable levels found.\n"),NULL,MM_NOTHING);
|
||||||
|
|
|
@ -238,6 +238,9 @@ void M_ForceSaveSlotSelected(INT32 sslot);
|
||||||
|
|
||||||
void M_CheatActivationResponder(INT32 ch);
|
void M_CheatActivationResponder(INT32 ch);
|
||||||
|
|
||||||
|
// Level select updating
|
||||||
|
void Nextmap_OnChange(void);
|
||||||
|
|
||||||
// Screenshot menu updating
|
// Screenshot menu updating
|
||||||
void Moviemode_mode_Onchange(void);
|
void Moviemode_mode_Onchange(void);
|
||||||
void Screenshot_option_Onchange(void);
|
void Screenshot_option_Onchange(void);
|
||||||
|
|
|
@ -900,8 +900,7 @@ static void Y_UpdateRecordReplays(void)
|
||||||
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 emblem%s for Record Attack records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : "");
|
||||||
|
|
||||||
// Update timeattack menu's replay availability.
|
// Update timeattack menu's replay availability.
|
||||||
CV_AddValue(&cv_nextmap, 1);
|
Nextmap_OnChange();
|
||||||
CV_AddValue(&cv_nextmap, -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue