mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Various fixes in charsel / charswitch menus
This commit is contained in:
parent
4f919f883d
commit
66c62b38da
5 changed files with 62 additions and 12 deletions
|
|
@ -300,6 +300,18 @@ consvar_t cv_followercolor[MAXSPLITSCREENPLAYERS] = {
|
||||||
CVAR_INIT ("followercolor4", "1", CV_SAVE|CV_CALL|CV_NOINIT, Followercolor_cons_t, Followercolor4_OnChange)
|
CVAR_INIT ("followercolor4", "1", CV_SAVE|CV_CALL|CV_NOINIT, Followercolor_cons_t, Followercolor4_OnChange)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// last selected profile, unaccessible cvar only set internally but is saved.
|
||||||
|
// It's used to know what profile to autoload you to when you get into the character setup.
|
||||||
|
|
||||||
|
static CV_PossibleValue_t lastprofile_cons_t[] = {{0, "MIN"}, {MAXPROFILES, "MAX"}, {0, NULL}};
|
||||||
|
|
||||||
|
consvar_t cv_lastprofile[MAXSPLITSCREENPLAYERS] = {
|
||||||
|
CVAR_INIT ("lastprofile", "1", CV_SAVE|CV_HIDDEN, lastprofile_cons_t, NULL),
|
||||||
|
CVAR_INIT ("lastprofile2", "1", CV_SAVE|CV_HIDDEN, lastprofile_cons_t, NULL),
|
||||||
|
CVAR_INIT ("lastprofile3", "1", CV_SAVE|CV_HIDDEN, lastprofile_cons_t, NULL),
|
||||||
|
CVAR_INIT ("lastprofile4", "1", CV_SAVE|CV_HIDDEN, lastprofile_cons_t, NULL),
|
||||||
|
};
|
||||||
|
|
||||||
consvar_t cv_skipmapcheck = CVAR_INIT ("skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL);
|
consvar_t cv_skipmapcheck = CVAR_INIT ("skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL);
|
||||||
|
|
||||||
INT32 cv_debug;
|
INT32 cv_debug;
|
||||||
|
|
@ -861,6 +873,7 @@ void D_RegisterClientCommands(void)
|
||||||
CV_RegisterVar(&cv_skin[i]);
|
CV_RegisterVar(&cv_skin[i]);
|
||||||
CV_RegisterVar(&cv_follower[i]);
|
CV_RegisterVar(&cv_follower[i]);
|
||||||
CV_RegisterVar(&cv_followercolor[i]);
|
CV_RegisterVar(&cv_followercolor[i]);
|
||||||
|
CV_RegisterVar(&cv_lastprofile[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// preferred number of players
|
// preferred number of players
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ extern consvar_t cv_playercolor[MAXSPLITSCREENPLAYERS];
|
||||||
extern consvar_t cv_skin[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_skin[MAXSPLITSCREENPLAYERS];
|
||||||
extern consvar_t cv_follower[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_follower[MAXSPLITSCREENPLAYERS];
|
||||||
extern consvar_t cv_followercolor[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_followercolor[MAXSPLITSCREENPLAYERS];
|
||||||
|
extern consvar_t cv_lastprofile[MAXSPLITSCREENPLAYERS];
|
||||||
|
|
||||||
// preferred number of players
|
// preferred number of players
|
||||||
extern consvar_t cv_splitplayers;
|
extern consvar_t cv_splitplayers;
|
||||||
|
|
|
||||||
|
|
@ -1171,7 +1171,8 @@ static void M_DrawCharSelectSprite(UINT8 num, INT16 x, INT16 y)
|
||||||
if (!(num & 1))
|
if (!(num & 1))
|
||||||
flags ^= V_FLIP;
|
flags ^= V_FLIP;
|
||||||
|
|
||||||
M_DrawCharacterSprite(x, y, skin, flags, colormap);
|
if (skin >= 0)
|
||||||
|
M_DrawCharacterSprite(x, y, skin, flags, colormap);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_DrawCharSelectPreview(UINT8 num)
|
static void M_DrawCharSelectPreview(UINT8 num)
|
||||||
|
|
@ -1206,7 +1207,7 @@ static void M_DrawCharSelectPreview(UINT8 num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((setup_animcounter/10) & 1)
|
if ((setup_animcounter/10) & 1 && gamestate == GS_MENU) // Not drawn outside of GS_MENU.
|
||||||
{
|
{
|
||||||
if (p->mdepth == CSSTEP_NONE && num == setup_numplayers)
|
if (p->mdepth == CSSTEP_NONE && num == setup_numplayers)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2104,11 +2104,15 @@ void M_CharacterSelectInit(void)
|
||||||
memset(setup_explosions, 0, sizeof(setup_explosions));
|
memset(setup_explosions, 0, sizeof(setup_explosions));
|
||||||
setup_animcounter = 0;
|
setup_animcounter = 0;
|
||||||
|
|
||||||
// Default to no follower / Match
|
|
||||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
// Default to no follower / match colour.
|
||||||
setup_player[i].followern = -1;
|
setup_player[i].followern = -1;
|
||||||
setup_player[i].followercolor = -1;
|
setup_player[i].followercolor = -1;
|
||||||
|
|
||||||
|
// Set default selected profile to the last used profile for each player:
|
||||||
|
// (Make sure we don't overshoot it somehow if we deleted profiles or whatnot)
|
||||||
|
setup_player[i].profilen = min(cv_lastprofile[i].value, PR_GetNumProfiles());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < numskins; i++)
|
for (i = 0; i < numskins; i++)
|
||||||
|
|
@ -2133,10 +2137,18 @@ void M_CharacterSelectInit(void)
|
||||||
setup_player[j].color = skins[i].prefcolor;
|
setup_player[j].color = skins[i].prefcolor;
|
||||||
|
|
||||||
// If we're on prpfile select, skip straight to CSSTEP_CHARS
|
// If we're on prpfile select, skip straight to CSSTEP_CHARS
|
||||||
if (optionsmenu.profile && j == 0)
|
if ((optionsmenu.profile || gamestate != GS_MENU) && j == 0)
|
||||||
{
|
{
|
||||||
setup_player[j].profilen = optionsmenu.profilen;
|
if (optionsmenu.profile) // In menu, setting up profile character/follower
|
||||||
PR_ApplyProfile(setup_player[j].profilen, 0);
|
{
|
||||||
|
setup_player[j].profilen = optionsmenu.profilen;
|
||||||
|
PR_ApplyProfile(setup_player[j].profilen, 0);
|
||||||
|
}
|
||||||
|
else // gamestate != GS_MENU, in that case, assume this is whatever profile we chose to play with.
|
||||||
|
setup_player[j].profilen = cv_lastprofile[j].value;
|
||||||
|
// Don't reapply the profile here, it was already applied.
|
||||||
|
|
||||||
|
|
||||||
M_SetupProfileGridPos(&setup_player[j]);
|
M_SetupProfileGridPos(&setup_player[j]);
|
||||||
setup_player[j].mdepth = CSSTEP_CHARS;
|
setup_player[j].mdepth = CSSTEP_CHARS;
|
||||||
}
|
}
|
||||||
|
|
@ -2428,9 +2440,9 @@ static boolean M_HandleCharacterGrid(setup_player_t *p, UINT8 num)
|
||||||
{
|
{
|
||||||
if (num == setup_numplayers-1)
|
if (num == setup_numplayers-1)
|
||||||
{
|
{
|
||||||
// for profiles, exit out of the menu instantly,
|
// for profiles / gameplay, exit out of the menu instantly,
|
||||||
// we don't want to go to the input detection menu.
|
// we don't want to go to the input detection menu.
|
||||||
if (optionsmenu.profile)
|
if (optionsmenu.profile || gamestate != GS_MENU)
|
||||||
{
|
{
|
||||||
memset(setup_player, 0, sizeof(setup_player)); // Reset setup_player otherwise it does some VERY funky things.
|
memset(setup_player, 0, sizeof(setup_player)); // Reset setup_player otherwise it does some VERY funky things.
|
||||||
M_SetMenuDelay(0);
|
M_SetMenuDelay(0);
|
||||||
|
|
@ -2701,7 +2713,9 @@ boolean M_CharacterSelectHandler(INT32 choice)
|
||||||
switch (p->mdepth)
|
switch (p->mdepth)
|
||||||
{
|
{
|
||||||
case CSSTEP_NONE: // Enter Game
|
case CSSTEP_NONE: // Enter Game
|
||||||
playersChanged = M_HandlePressStart(p, i);
|
if (gamestate == GS_MENU) // do NOT handle that outside of GS_MENU.
|
||||||
|
playersChanged = M_HandlePressStart(p, i);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case CSSTEP_PROFILE:
|
case CSSTEP_PROFILE:
|
||||||
playersChanged = M_HandleCSelectProfile(p, i);
|
playersChanged = M_HandleCSelectProfile(p, i);
|
||||||
|
|
@ -2770,10 +2784,10 @@ static void M_MPConfirmCharacterSelection(void)
|
||||||
INT16 col;
|
INT16 col;
|
||||||
|
|
||||||
char colstr[8];
|
char colstr[8];
|
||||||
char commandnames[][4][MAXSTRINGLENGTH] = { {"skin ", "color ", "follower ", "followercolor "}, {"skin2 ", "color2 ", "follower2 ", "followercolor2 "}, {"skin3 ", "color3 " "follower3 ", "followercolor3 "}, {"skin4 ", "color4 ", "follower4 ", "followercolor4 "}};
|
char commandnames[][4][MAXSTRINGLENGTH] = { {"skin ", "color ", "follower ", "followercolor "}, {"skin2 ", "color2 ", "follower2 ", "followercolor2 "}, {"skin3 ", "color3 ", "follower3 ", "followercolor3 "}, {"skin4 ", "color4 ", "follower4 ", "followercolor4 "}};
|
||||||
// ^ laziness 100 (we append a space directly so that we don't have to do it later too!!!!)
|
// ^ laziness 100 (we append a space directly so that we don't have to do it later too!!!!)
|
||||||
|
|
||||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
for (i = 0; i < splitscreen +1; i++)
|
||||||
{
|
{
|
||||||
char cmd[MAXSTRINGLENGTH];
|
char cmd[MAXSTRINGLENGTH];
|
||||||
|
|
||||||
|
|
@ -4264,7 +4278,22 @@ boolean M_ProfileControlsInputs(INT32 ch)
|
||||||
}
|
}
|
||||||
else if (M_MenuBackPressed(pid))
|
else if (M_MenuBackPressed(pid))
|
||||||
{
|
{
|
||||||
|
UINT8 i;
|
||||||
|
UINT8 pnum;
|
||||||
|
|
||||||
optionsmenu.profile->kickstartaccel = cv_dummyprofilekickstart.value; // Make sure to save kickstart accel.
|
optionsmenu.profile->kickstartaccel = cv_dummyprofilekickstart.value; // Make sure to save kickstart accel.
|
||||||
|
pnum = PR_GetProfileNum(optionsmenu.profile);
|
||||||
|
|
||||||
|
// Check if this profile is one we have last used on any player:
|
||||||
|
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (cv_lastprofile[i].value == pnum)
|
||||||
|
{
|
||||||
|
PR_ApplyProfile(pnum, i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -150,13 +150,19 @@ void PR_ApplyProfile(UINT8 profilenum, UINT8 playernum)
|
||||||
CV_StealthSet(&cv_skin[playernum], p->skinname);
|
CV_StealthSet(&cv_skin[playernum], p->skinname);
|
||||||
CV_StealthSetValue(&cv_playercolor[playernum], p->color);
|
CV_StealthSetValue(&cv_playercolor[playernum], p->color);
|
||||||
CV_StealthSet(&cv_playername[playernum], p->playername);
|
CV_StealthSet(&cv_playername[playernum], p->playername);
|
||||||
// @TODO followers
|
|
||||||
|
// Followers
|
||||||
|
CV_StealthSet(&cv_follower[playernum], p->follower);
|
||||||
|
CV_StealthSetValue(&cv_followercolor[playernum], p->followercolor);
|
||||||
|
|
||||||
// toggles
|
// toggles
|
||||||
CV_StealthSetValue(&cv_kickstartaccel[playernum], p->kickstartaccel);
|
CV_StealthSetValue(&cv_kickstartaccel[playernum], p->kickstartaccel);
|
||||||
|
|
||||||
// set controls...
|
// set controls...
|
||||||
memcpy(&gamecontrol[playernum], p->controls, sizeof(gamecontroldefault));
|
memcpy(&gamecontrol[playernum], p->controls, sizeof(gamecontroldefault));
|
||||||
|
|
||||||
|
// set memory cvar
|
||||||
|
CV_StealthSetValue(&cv_lastprofile[playernum], profilenum);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 PR_GetProfileNum(profile_t *p)
|
UINT8 PR_GetProfileNum(profile_t *p)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue