Significant work into the play-starting experience

- Take the weird extra mini settings menu out of the Online Host Game sequence
- Make sure to actively use the server variables in Match Race creation
    - Hides the Auto options for Encore and Kartspeed on the Match Race menu specifically...
    - BUT if you leave it at the default it'll secretly set them to Auto!!!
This commit is contained in:
toaster 2022-09-04 20:14:30 +01:00
parent 8d938bef90
commit acd777a77a
6 changed files with 77 additions and 71 deletions

View file

@ -82,6 +82,12 @@ CV_PossibleValue_t kartspeed_cons_t[] = {
{KARTSPEED_HARD, "Hard"}, {KARTSPEED_HARD, "Hard"},
{0, NULL} {0, NULL}
}; };
CV_PossibleValue_t dummykartspeed_cons_t[] = {
{KARTSPEED_EASY, "Easy"},
{KARTSPEED_NORMAL, "Normal"},
{KARTSPEED_HARD, "Hard"},
{0, NULL}
};
CV_PossibleValue_t gpdifficulty_cons_t[] = { CV_PossibleValue_t gpdifficulty_cons_t[] = {
{KARTSPEED_EASY, "Easy"}, {KARTSPEED_EASY, "Easy"},
{KARTSPEED_NORMAL, "Normal"}, {KARTSPEED_NORMAL, "Normal"},
@ -2098,7 +2104,9 @@ void CV_AddValue(consvar_t *var, INT32 increment)
return; return;
} }
} }
else if (var->PossibleValue == kartspeed_cons_t || var->PossibleValue == gpdifficulty_cons_t) else if (var->PossibleValue == kartspeed_cons_t
|| var->PossibleValue == dummykartspeed_cons_t
|| var->PossibleValue == gpdifficulty_cons_t)
{ {
if (!M_SecretUnlocked(SECRET_HARDSPEED)) if (!M_SecretUnlocked(SECRET_HARDSPEED))
{ {

View file

@ -175,7 +175,7 @@ extern CV_PossibleValue_t CV_Natural[];
#define KARTSPEED_NORMAL 1 #define KARTSPEED_NORMAL 1
#define KARTSPEED_HARD 2 #define KARTSPEED_HARD 2
#define KARTGP_MASTER 3 // Not a speed setting, gives the hardest speed with maxed out bots #define KARTGP_MASTER 3 // Not a speed setting, gives the hardest speed with maxed out bots
extern CV_PossibleValue_t kartspeed_cons_t[], gpdifficulty_cons_t[]; extern CV_PossibleValue_t kartspeed_cons_t[], dummykartspeed_cons_t[], gpdifficulty_cons_t[];
extern consvar_t cv_execversion; extern consvar_t cv_execversion;

View file

@ -193,6 +193,19 @@ extern menu_t PLAY_GamemodesDef;
extern menuitem_t PLAY_RaceGamemodesMenu[]; extern menuitem_t PLAY_RaceGamemodesMenu[];
extern menu_t PLAY_RaceGamemodesDef; extern menu_t PLAY_RaceGamemodesDef;
typedef enum
{
drace_gpdifficulty = 0,
drace_mrkartspeed,
drace_mrcpu,
drace_mrracers,
drace_encore,
drace_boxend,
drace_cupselect = drace_boxend,
drace_mapselect,
drace_back
} drace_e;
extern menuitem_t PLAY_RaceDifficulty[]; extern menuitem_t PLAY_RaceDifficulty[];
extern menu_t PLAY_RaceDifficultyDef; extern menu_t PLAY_RaceDifficultyDef;
@ -673,7 +686,6 @@ extern consvar_t cv_dummygpencore;
extern consvar_t cv_dummymatchbots; extern consvar_t cv_dummymatchbots;
void M_SetupDifficultySelect(INT32 choice); void M_SetupDifficultySelect(INT32 choice);
void M_SetupDifficultySelectMP(INT32 choice);
void M_DifficultySelectInputs(INT32 choice); void M_DifficultySelectInputs(INT32 choice);
// Multiplayer menu stuff // Multiplayer menu stuff

View file

@ -119,36 +119,32 @@ menuitem_t PLAY_RaceGamemodesMenu[] =
menu_t PLAY_RaceGamemodesDef = KARTGAMEMODEMENU(PLAY_RaceGamemodesMenu, &PLAY_GamemodesDef); menu_t PLAY_RaceGamemodesDef = KARTGAMEMODEMENU(PLAY_RaceGamemodesMenu, &PLAY_GamemodesDef);
// difficulty selection: // difficulty selection -- see drace_e
menuitem_t PLAY_RaceDifficulty[] = menuitem_t PLAY_RaceDifficulty[] =
{ {
// local play // For GP
{IT_STRING | IT_CVAR, "Difficulty", "Select the game difficulty", {IT_STRING | IT_CVAR, "Difficulty", "Select the game difficulty",
NULL, {.cvar = &cv_dummygpdifficulty}, 0, 0}, NULL, {.cvar = &cv_dummygpdifficulty}, 0, 0},
// netgames // Match Race
{IT_STRING | IT_CVAR, "Difficulty", "Select the game speed", {IT_STRING | IT_CVAR, "Difficulty", "Select the game speed",
NULL, {.cvar = &cv_dummykartspeed}, 0, 0}, NULL, {.cvar = &cv_dummykartspeed}, 0, 0},
// DISABLE THAT OPTION OUTSIDE OF MATCH RACE // DISABLE THAT OPTION OUTSIDE OF MATCH RACE
{IT_STRING2 | IT_CVAR, "CPU", "Set the difficulty of CPU players.", {IT_STRING2 | IT_CVAR, "CPU", "Set the difficulty of CPU players.",
NULL, {.cvar = &cv_dummymatchbots}, 0, 0}, NULL, {.cvar = &cv_dummymatchbots}, 0, 0},
{IT_STRING2 | IT_CVAR, "Racers", "Sets the number of racers, including players and CPU.", {IT_STRING2 | IT_CVAR, "Racers", "Sets the number of racers, including players and CPU.",
NULL, {.cvar = &cv_maxplayers}, 0, 0}, NULL, {.cvar = &cv_maxplayers}, 0, 0},
{IT_STRING2 | IT_CVAR, "Encore", "Enable or disable Encore mode", {IT_STRING2 | IT_CVAR, "Encore", "Enable or disable Encore mode",
NULL, {.cvar = &cv_dummygpencore}, 0, 0}, NULL, {.cvar = &cv_dummygpencore}, 0, 0},
// For GP: // For GP
{IT_STRING | IT_CALL, "Cup Select", "Go on and select a cup!", NULL, {.routine = M_LevelSelectInit}, 2, GT_RACE}, {IT_STRING | IT_CALL, "Cup Select", "Go on and select a cup!", NULL, {.routine = M_LevelSelectInit}, 2, GT_RACE},
// For Match Race: // Match Race
{IT_STRING | IT_CALL, "Map Select", "Go on and select a race track!", NULL, {.routine = M_LevelSelectInit}, 0, GT_RACE}, {IT_STRING | IT_CALL, "Map Select", "Go on and select a race track!", NULL, {.routine = M_LevelSelectInit}, 0, GT_RACE},
// For Match Race in NETGAMES:
{IT_STRING | IT_CALL, "Map Select", "Go on and select a race track!", NULL, {.routine = M_MPSetupNetgameMapSelect}, 0, GT_RACE},
{IT_STRING | IT_CALL, "Back", NULL, NULL, {.routine = M_GoBack}, 0, 0}, {IT_STRING | IT_CALL, "Back", NULL, NULL, {.routine = M_GoBack}, 0, 0},
}; };
@ -348,7 +344,7 @@ menu_t PLAY_MP_OptSelectDef = {
NULL NULL
}; };
// MULTIPLAYER HOST SCREEN // MULTIPLAYER HOST SCREEN -- see mhost_e
menuitem_t PLAY_MP_Host[] = menuitem_t PLAY_MP_Host[] =
{ {
//{IT_NOTHING | IT_KEYHANDLER, NULL, NULL, NULL, M_MPOptSelect, 0, 0}, //{IT_NOTHING | IT_KEYHANDLER, NULL, NULL, NULL, M_MPOptSelect, 0, 0},
@ -366,7 +362,7 @@ menuitem_t PLAY_MP_Host[] =
NULL, {.cvar = &cv_dummygametype}, 0, 0}, NULL, {.cvar = &cv_dummygametype}, 0, 0},
{IT_STRING | IT_CALL, "GO", "Select a map with the currently selected gamemode", {IT_STRING | IT_CALL, "GO", "Select a map with the currently selected gamemode",
NULL, {.routine = M_SetupDifficultySelectMP}, 0, 0}, NULL, {.routine = M_MPSetupNetgameMapSelect}, 0, 0},
}; };

View file

@ -1710,7 +1710,6 @@ void M_DrawCharacterSelect(void)
void M_DrawRaceDifficulty(void) void M_DrawRaceDifficulty(void)
{ {
UINT8 n = currentMenu->numitems-4;
patch_t *box = W_CachePatchName("M_DBOX", PU_CACHE); patch_t *box = W_CachePatchName("M_DBOX", PU_CACHE);
INT32 i; INT32 i;
@ -1729,9 +1728,8 @@ void M_DrawRaceDifficulty(void)
for (i = 0; i < currentMenu->numitems; i++) for (i = 0; i < currentMenu->numitems; i++)
{ {
if (i >= n) if (i >= drace_boxend)
{ {
x = GM_STARTX + (GM_XOFFSET * 5 / 2); x = GM_STARTX + (GM_XOFFSET * 5 / 2);
y = GM_STARTY + (GM_YOFFSET * 5 / 2); y = GM_STARTY + (GM_YOFFSET * 5 / 2);
@ -2276,7 +2274,7 @@ static void M_DrawEggaChannel(void)
{ {
patch_t *background = W_CachePatchName("M_EGGACH", PU_CACHE); patch_t *background = W_CachePatchName("M_EGGACH", PU_CACHE);
V_DrawFill(0, 0, 999, 999, 25); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 25);
V_DrawFixedPatch(160<<FRACBITS, 104<<FRACBITS, FRACUNIT, 0, background, NULL); V_DrawFixedPatch(160<<FRACBITS, 104<<FRACBITS, FRACUNIT, 0, background, NULL);
V_DrawVhsEffect(false); // VHS the background! (...sorry OGL my love) V_DrawVhsEffect(false); // VHS the background! (...sorry OGL my love)
} }
@ -2296,30 +2294,39 @@ void M_DrawMPHost(void)
patch_t *gobutt = W_CachePatchName("M_BUTTGO", PU_CACHE); // I'm very mature patch_t *gobutt = W_CachePatchName("M_BUTTGO", PU_CACHE); // I'm very mature
INT32 xp = 40, yp = 64, i = 0, w = 0; // Starting position for the text drawing. INT32 xp = 40, yp = 64, i = 0, w = 0; // Starting position for the text drawing.
M_DrawMPOptSelect(); // Draw the Multiplayer option select menu first M_DrawMPOptSelect(); // Draw the Multiplayer option select menu first
// Now draw our host options... // Now draw our host options...
for (i = 0; i < currentMenu->numitems; i++) for (i = 0; i < currentMenu->numitems; i++)
{ {
if (i == currentMenu->numitems-1) if (i == currentMenu->numitems-1)
{ {
xp = 202;
yp = 100;
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_MOSS, GTC_CACHE); UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_MOSS, GTC_CACHE);
if (i == itemOn) if (i == itemOn)
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_CACHE); colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_CACHE);
// Ideally we'd calculate this but it's not worth it for a 1-off menu probably..... // Ideally we'd calculate this but it's not worth it for a 1-off menu probably.....
V_DrawFixedPatch(202<<FRACBITS, 100<<FRACBITS, FRACUNIT, 0, gobutt, colormap); V_DrawFixedPatch(xp<<FRACBITS, yp<<FRACBITS, FRACUNIT, 0, gobutt, colormap);
V_DrawCenteredGamemodeString(202 + (gobutt->width/2), 100 -3, V_ALLOWLOWERCASE, colormap, currentMenu->menuitems[i].text); V_DrawCenteredGamemodeString(xp + (gobutt->width/2), yp -3, V_ALLOWLOWERCASE, colormap, currentMenu->menuitems[i].text);
} }
else else
{ {
switch (currentMenu->menuitems[i].status & IT_DISPLAY) switch (currentMenu->menuitems[i].status & IT_DISPLAY)
{ {
case IT_TRANSTEXT2:
{
V_DrawThinString(xp, yp, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_TRANSLUCENT, currentMenu->menuitems[i].text);
xp += 5;
yp += 11;
break;
}
case IT_STRING: case IT_STRING:
{ {
V_DrawString(xp, yp, V_ALLOWLOWERCASE | (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text); V_DrawThinString(xp, yp, V_ALLOWLOWERCASE|V_6WIDTHSPACE | (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text);
// Cvar specific handling // Cvar specific handling
switch (currentMenu->menuitems[i].status & IT_TYPE) switch (currentMenu->menuitems[i].status & IT_TYPE)
@ -2330,15 +2337,15 @@ void M_DrawMPHost(void)
switch (currentMenu->menuitems[i].status & IT_CVARTYPE) switch (currentMenu->menuitems[i].status & IT_CVARTYPE)
{ {
case IT_CV_STRING: case IT_CV_STRING:
V_DrawThinString(xp + 96, yp, V_ALLOWLOWERCASE, cv->string); V_DrawThinString(xp + 96, yp, V_ALLOWLOWERCASE|V_6WIDTHSPACE, cv->string);
if (skullAnimCounter < 4 && i == itemOn) if (skullAnimCounter < 4 && i == itemOn)
V_DrawCharacter(xp + 93 + V_ThinStringWidth(cv->string, 0), yp +1, '_' | 0x80, false); V_DrawString(xp + 94 + V_ThinStringWidth(cv->string, V_6WIDTHSPACE), yp+1, 0, "_");
break; break;
default: default:
w = V_StringWidth(cv->string, 0); w = V_ThinStringWidth(cv->string, V_6WIDTHSPACE);
V_DrawString(xp + 138 - w, yp, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags), cv->string); V_DrawThinString(xp + 138 - w, yp, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags)|V_6WIDTHSPACE, cv->string);
if (i == itemOn) if (i == itemOn)
{ {
V_DrawCharacter(xp + 138 - 10 - w - (skullAnimCounter/5), yp, '\x1C' | highlightflags, false); // left arrow V_DrawCharacter(xp + 138 - 10 - w - (skullAnimCounter/5), yp, '\x1C' | highlightflags, false); // left arrow

View file

@ -202,8 +202,8 @@ consvar_t cv_dummyprofileplayername = CVAR_INIT ("dummyprofileplayername", "", C
consvar_t cv_dummyprofilekickstart = CVAR_INIT ("dummyprofilekickstart", "Off", CV_HIDDEN, CV_OnOff, NULL); consvar_t cv_dummyprofilekickstart = CVAR_INIT ("dummyprofilekickstart", "Off", CV_HIDDEN, CV_OnOff, NULL);
consvar_t cv_dummygpdifficulty = CVAR_INIT ("dummygpdifficulty", "Normal", CV_HIDDEN, gpdifficulty_cons_t, NULL); consvar_t cv_dummygpdifficulty = CVAR_INIT ("dummygpdifficulty", "Normal", CV_HIDDEN, gpdifficulty_cons_t, NULL);
consvar_t cv_dummykartspeed = CVAR_INIT ("dummykartspeed", "Auto", CV_HIDDEN, kartspeed_cons_t, NULL); consvar_t cv_dummykartspeed = CVAR_INIT ("dummykartspeed", "Normal", CV_HIDDEN, dummykartspeed_cons_t, NULL);
consvar_t cv_dummygpencore = CVAR_INIT ("dummygpencore", "No", CV_HIDDEN, CV_YesNo, NULL); consvar_t cv_dummygpencore = CVAR_INIT ("dummygpencore", "Off", CV_HIDDEN, CV_OnOff, NULL);
static void M_UpdateAddonsSearch(void); static void M_UpdateAddonsSearch(void);
consvar_t cv_dummyaddonsearch = CVAR_INIT ("dummyaddonsearch", "", CV_HIDDEN|CV_CALL|CV_NOINIT, NULL, M_UpdateAddonsSearch); consvar_t cv_dummyaddonsearch = CVAR_INIT ("dummyaddonsearch", "", CV_HIDDEN|CV_CALL|CV_NOINIT, NULL, M_UpdateAddonsSearch);
@ -3129,56 +3129,35 @@ void M_SetupDifficultySelect(INT32 choice)
// setup the difficulty menu and then remove choices depending on choice // setup the difficulty menu and then remove choices depending on choice
PLAY_RaceDifficultyDef.prevMenu = currentMenu; PLAY_RaceDifficultyDef.prevMenu = currentMenu;
PLAY_RaceDifficulty[0].status = IT_DISABLED; PLAY_RaceDifficulty[drace_gpdifficulty].status = IT_DISABLED;
PLAY_RaceDifficulty[1].status = IT_DISABLED; PLAY_RaceDifficulty[drace_mrkartspeed].status = IT_DISABLED;
PLAY_RaceDifficulty[2].status = IT_DISABLED; PLAY_RaceDifficulty[drace_mrcpu].status = IT_DISABLED;
PLAY_RaceDifficulty[3].status = IT_DISABLED; PLAY_RaceDifficulty[drace_mrracers].status = IT_DISABLED;
PLAY_RaceDifficulty[4].status = IT_DISABLED; PLAY_RaceDifficulty[drace_encore].status = IT_DISABLED;
PLAY_RaceDifficulty[5].status = IT_DISABLED; PLAY_RaceDifficulty[drace_cupselect].status = IT_DISABLED;
PLAY_RaceDifficulty[6].status = IT_DISABLED; PLAY_RaceDifficulty[drace_mapselect].status = IT_DISABLED;
PLAY_RaceDifficulty[7].status = IT_DISABLED;
if (choice) // Match Race if (choice) // Match Race
{ {
PLAY_RaceDifficulty[1].status = IT_STRING|IT_CVAR; // Kart Speed PLAY_RaceDifficulty[drace_mrkartspeed].status = IT_STRING|IT_CVAR; // Kart Speed
PLAY_RaceDifficulty[2].status = IT_STRING2|IT_CVAR; // CPUs on/off PLAY_RaceDifficulty[drace_mrcpu].status = IT_STRING2|IT_CVAR; // CPUs on/off
PLAY_RaceDifficulty[3].status = IT_STRING2|IT_CVAR; // CPU amount PLAY_RaceDifficulty[drace_mrracers].status = IT_STRING2|IT_CVAR; // CPU amount
PLAY_RaceDifficulty[4].status = IT_STRING2|IT_CVAR; // Encore on/off PLAY_RaceDifficulty[drace_mapselect].status = IT_STRING|IT_CALL; // Level Select (Match Race)
PLAY_RaceDifficulty[6].status = IT_STRING|IT_CALL; // Level Select (Match Race) PLAY_RaceDifficultyDef.lastOn = drace_mapselect; // Select map select by default.
PLAY_RaceDifficultyDef.lastOn = 5; // Select cup select by default.
} }
else // GP else // GP
{ {
PLAY_RaceDifficulty[0].status = IT_STRING|IT_CVAR; // Difficulty PLAY_RaceDifficulty[drace_gpdifficulty].status = IT_STRING|IT_CVAR; // Difficulty
PLAY_RaceDifficulty[4].status = IT_STRING2|IT_CVAR; // Encore on/off PLAY_RaceDifficulty[drace_cupselect].status = IT_STRING|IT_CALL; // Level Select (GP)
PLAY_RaceDifficulty[5].status = IT_STRING|IT_CALL; // Level Select (GP) PLAY_RaceDifficultyDef.lastOn = drace_cupselect; // Select cup select by default.
PLAY_RaceDifficultyDef.lastOn = 4; // Select cup select by default.
} }
M_SetupNextMenu(&PLAY_RaceDifficultyDef, false); if (M_SecretUnlocked(SECRET_ENCORE))
}
// calls the above but changes the cvar we set
void M_SetupDifficultySelectMP(INT32 choice)
{ {
(void) choice; PLAY_RaceDifficulty[drace_encore].status = IT_STRING2|IT_CVAR; // Encore on/off
}
PLAY_RaceDifficultyDef.prevMenu = currentMenu;
M_SetupNextMenu(&PLAY_RaceDifficultyDef, false); M_SetupNextMenu(&PLAY_RaceDifficultyDef, false);
PLAY_RaceDifficulty[0].status = IT_DISABLED;
PLAY_RaceDifficulty[1].status = IT_STRING|IT_CVAR;
PLAY_RaceDifficulty[2].status = IT_STRING2|IT_CVAR; // CPUs on/off use string2 to signify not to use the normal gm font drawer
PLAY_RaceDifficulty[3].status = IT_STRING2|IT_CVAR; // Encore on/off use string2 to signify not to use the normal gm font drawer
PLAY_RaceDifficulty[4].status = IT_DISABLED;
PLAY_RaceDifficulty[5].status = IT_DISABLED;
PLAY_RaceDifficulty[6].status = IT_STRING|IT_CALL;
itemOn = 6; // Select cup select by default.
// okay this is REALLY stupid but this fixes the host menu re-folding on itself when we go back.
mpmenu.modewinextend[0][0] = 1;
} }
// LEVEL SELECT // LEVEL SELECT
@ -3626,9 +3605,10 @@ void M_LevelSelectHandler(INT32 choice)
netgame = levellist.netgame; // ^ ditto. netgame = levellist.netgame; // ^ ditto.
CV_StealthSet(&cv_kartbot, cv_dummymatchbots.string); CV_StealthSet(&cv_kartbot, cv_dummymatchbots.string);
CV_StealthSet(&cv_kartspeed, cv_dummykartspeed.string); CV_StealthSet(&cv_kartencore, (cv_dummygpencore.value == 1) ? "On" : "Auto");
CV_StealthSet(&cv_kartspeed, (cv_dummykartspeed.value == KARTSPEED_NORMAL) ? "Auto" : cv_dummykartspeed.string);
D_MapChange(levellist.choosemap+1, levellist.newgametype, (cv_dummygpencore.value == 1), 1, 1, false, false); D_MapChange(levellist.choosemap+1, levellist.newgametype, (cv_kartencore.value == 1), 1, 1, false, false);
} }
else else
{ {
@ -3830,6 +3810,9 @@ void M_MPSetupNetgameMapSelect(INT32 choice)
} }
} }
// okay this is REALLY stupid but this fixes the host menu re-folding on itself when we go back.
mpmenu.modewinextend[0][0] = 1;
M_LevelListFromGametype(gt); // Setup the level select. M_LevelListFromGametype(gt); // Setup the level select.
// (This will also automatically send us to the apropriate menu) // (This will also automatically send us to the apropriate menu)
} }