mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Several minor fixes & tweaks for character select
This commit is contained in:
parent
dae7dd003a
commit
7d8a512d2a
2 changed files with 44 additions and 21 deletions
|
|
@ -536,7 +536,7 @@ static void M_DrawCharSelectCircle(setup_player_t *p, INT16 x, INT16 y)
|
|||
angle_t ang = ((i+1)/2) * angamt;
|
||||
patch_t *patch = NULL;
|
||||
UINT8 *colormap;
|
||||
fixed_t radius = 24<<FRACBITS;
|
||||
fixed_t radius;
|
||||
INT16 n;
|
||||
|
||||
if (p->mdepth == CSSTEP_ALTS)
|
||||
|
|
@ -553,6 +553,10 @@ static void M_DrawCharSelectCircle(setup_player_t *p, INT16 x, INT16 y)
|
|||
skin = setup_chargrid[p->gridx][p->gridy].skinlist[n];
|
||||
patch = facerankprefix[skin];
|
||||
colormap = R_GetTranslationColormap(skin, skins[skin].prefcolor, GTC_MENUCACHE);
|
||||
radius = 24<<FRACBITS;
|
||||
|
||||
cx -= (SHORT(patch->width) << FRACBITS) >> 1;
|
||||
cy -= (SHORT(patch->height) << FRACBITS) >> 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -580,11 +584,11 @@ static void M_DrawCharSelectCircle(setup_player_t *p, INT16 x, INT16 y)
|
|||
else
|
||||
patch = W_CachePatchName("COLORSP0", PU_CACHE);
|
||||
|
||||
radius -= SHORT(patch->width) << FRACBITS;
|
||||
}
|
||||
radius = 28<<FRACBITS;
|
||||
//radius -= SHORT(patch->width) << FRACBITS;
|
||||
|
||||
cx -= (SHORT(patch->width) << FRACBITS) >> 1;
|
||||
cy -= (SHORT(patch->height) << FRACBITS) >> 1;
|
||||
}
|
||||
|
||||
if (subtract)
|
||||
ang = (signed)(ANGLE_90 - ang);
|
||||
|
|
@ -677,7 +681,7 @@ static void M_DrawCharSelectPreview(UINT8 num)
|
|||
|
||||
if ((setup_animcounter/10) & 1)
|
||||
{
|
||||
if (p->mdepth == CSSTEP_NONE)
|
||||
if (p->mdepth == CSSTEP_NONE && num == setup_numplayers)
|
||||
V_DrawScaledPatch(x+1, y+36, 0, W_CachePatchName("4PSTART", PU_CACHE));
|
||||
//else if (p->mdepth >= CSSTEP_READY)
|
||||
// V_DrawScaledPatch(x+1, y+36, 0, W_CachePatchName("4PREADY", PU_CACHE));
|
||||
|
|
@ -733,10 +737,10 @@ static void M_DrawCharSelectCursors(void)
|
|||
"CHHOV1", "CHHOV1", "CHHOV1", "CHHOV2", "CHHOV1", "CHHOV3", "CHHOV1", "CHHOV2"
|
||||
};
|
||||
static const char *selectframesb[SELECTLEN] = {
|
||||
"CHHOV1", "CHPIKB1", "CHHOV2", "CHPIKB2", "CHHOV3", "CHPIKB3", "CHHOV2", "CHPIKB4",
|
||||
"CHHOV1", "CHHOV1", "CHHOV1", "CHHOV2", "CHHOV1", "CHHOV3", "CHHOV1", "CHHOV2",
|
||||
"CHPIKB5", "CHHOV2", "CHPIKB6", "CHHOV3", "CHPIKB7", "CHHOV2", "CHPIKB8",
|
||||
"CHHOV1", "CHHOV1", "CHHOV1", "CHHOV2", "CHHOV1", "CHHOV3", "CHHOV1", "CHHOV2"
|
||||
NULL, "CHPIKB1", NULL, "CHPIKB2", NULL, "CHPIKB3", NULL, "CHPIKB4",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
"CHPIKB5", NULL, "CHPIKB6", NULL, "CHPIKB7", NULL, "CHPIKB8",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
for (i = 0; i < setup_numplayers; i++)
|
||||
|
|
@ -762,6 +766,7 @@ static void M_DrawCharSelectCursors(void)
|
|||
else if (p->mdepth > CSSTEP_CHARS)
|
||||
{
|
||||
V_DrawMappedPatch(x, y, 0, W_CachePatchName(selectframesa[setup_animcounter % SELECTLEN], PU_CACHE), colormap);
|
||||
if (selectframesb[(setup_animcounter-1) % SELECTLEN] != NULL)
|
||||
V_DrawMappedPatch(x, y, V_TRANSLUCENT, W_CachePatchName(selectframesb[(setup_animcounter-1) % SELECTLEN], PU_CACHE), colormap);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1684,7 +1684,7 @@ void M_CharacterSelectInit(INT32 choice)
|
|||
|
||||
for (j = 0; j < MAXSPLITSCREENPLAYERS; j++)
|
||||
{
|
||||
if (setup_playercvars[j][SPLITCV_SKIN]->value == i)
|
||||
if (!strcmp(setup_playercvars[j][SPLITCV_SKIN]->string, skins[i].name))
|
||||
{
|
||||
setup_player[j].gridx = x;
|
||||
setup_player[j].gridy = y;
|
||||
|
|
@ -1743,7 +1743,7 @@ static void M_SetupReadyExplosions(setup_player_t *p)
|
|||
}
|
||||
}
|
||||
|
||||
static void M_HandleCharacterGrid(INT32 choice, setup_player_t *p)
|
||||
static void M_HandleCharacterGrid(INT32 choice, setup_player_t *p, UINT8 num)
|
||||
{
|
||||
switch (choice)
|
||||
{
|
||||
|
|
@ -1785,8 +1785,15 @@ static void M_HandleCharacterGrid(INT32 choice, setup_player_t *p)
|
|||
}
|
||||
break;
|
||||
case KEY_ESCAPE:
|
||||
if (num == setup_numplayers-1)
|
||||
{
|
||||
p->mdepth = CSSTEP_NONE;
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
}
|
||||
else
|
||||
{
|
||||
S_StartSound(NULL, sfx_s3kb2);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -1838,7 +1845,7 @@ static void M_HandleColorRotate(INT32 choice, setup_player_t *p)
|
|||
p->color = 1;
|
||||
p->rotate = CSROTATETICS;
|
||||
//p->delay = CSROTATETICS;
|
||||
S_StartSound(NULL, sfx_s3kc3s);
|
||||
S_StartSound(NULL, sfx_s3k5b); //sfx_s3kc3s
|
||||
break;
|
||||
case KEY_LEFTARROW:
|
||||
p->color--;
|
||||
|
|
@ -1846,7 +1853,7 @@ static void M_HandleColorRotate(INT32 choice, setup_player_t *p)
|
|||
p->color = MAXSKINCOLORS-1;
|
||||
p->rotate = -CSROTATETICS;
|
||||
//p->delay = CSROTATETICS;
|
||||
S_StartSound(NULL, sfx_s3kc3s);
|
||||
S_StartSound(NULL, sfx_s3k5b); //sfx_s3kc3s
|
||||
break;
|
||||
case KEY_ENTER:
|
||||
p->mdepth = CSSTEP_READY;
|
||||
|
|
@ -1882,11 +1889,14 @@ void M_CharacterSelectHandler(INT32 choice)
|
|||
switch (p->mdepth)
|
||||
{
|
||||
case CSSTEP_NONE: // Enter Game
|
||||
if (choice == KEY_ENTER)
|
||||
if (choice == KEY_ENTER && i == setup_numplayers)
|
||||
{
|
||||
p->mdepth = CSSTEP_CHARS;
|
||||
S_StartSound(NULL, sfx_s3k65);
|
||||
}
|
||||
break;
|
||||
case CSSTEP_CHARS: // Character Select grid
|
||||
M_HandleCharacterGrid(choice, p);
|
||||
M_HandleCharacterGrid(choice, p, i);
|
||||
break;
|
||||
case CSSTEP_ALTS: // Select clone
|
||||
M_HandleCharRotate(choice, p);
|
||||
|
|
@ -1897,7 +1907,10 @@ void M_CharacterSelectHandler(INT32 choice)
|
|||
case CSSTEP_READY:
|
||||
default: // Unready
|
||||
if (choice == KEY_ESCAPE)
|
||||
{
|
||||
p->mdepth = CSSTEP_COLORS;
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1910,8 +1923,12 @@ void M_CharacterSelectHandler(INT32 choice)
|
|||
|
||||
if (p->mdepth < CSSTEP_COLORS)
|
||||
p->color = skins[p->skin].prefcolor;
|
||||
}
|
||||
|
||||
if (p->mdepth == CSSTEP_NONE)
|
||||
// Setup new numplayers
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
if (setup_player[i].mdepth == CSSTEP_NONE)
|
||||
break;
|
||||
else
|
||||
setup_numplayers = i+1;
|
||||
|
|
@ -1964,10 +1981,11 @@ void M_CharacterSelectTick(void)
|
|||
{
|
||||
for (i = 0; i < setup_numplayers; i++)
|
||||
{
|
||||
CV_StealthSetValue(setup_playercvars[i][SPLITCV_SKIN], setup_player[i].skin);
|
||||
CV_StealthSet(setup_playercvars[i][SPLITCV_SKIN], skins[setup_player[i].skin].name);
|
||||
CV_StealthSetValue(setup_playercvars[i][SPLITCV_COLOR], setup_player[i].color);
|
||||
}
|
||||
|
||||
CV_StealthSetValue(&cv_splitplayers, setup_numplayers);
|
||||
M_SetupNextMenu(&PLAY_MainDef, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue