Some minor things to help draw sonicitems to a close.

* "kartvoices" cvar. Possible values "Never", "Tasteful" (default), and "Meme".
* Added a way to move quickly through the credits, rather than skip them entirely (hold spacebar or down arrow).
* Fix a few mistakes in M_ChangeCvar, some of which I introduced and some of which were weird in the first place.
* Tweak the offset of the arrows that let you know you can modify a cvar by pressing left or right (some via a patch.kart change, but others via tweaking the drawing location).
This commit is contained in:
toaster 2018-07-29 18:35:56 +01:00
parent 62c6bc0a13
commit f125573048
6 changed files with 56 additions and 31 deletions

View file

@ -355,6 +355,8 @@ consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV
consvar_t cv_kartmirror = {"kartmirror", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartMirror_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}};
consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display
static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}};
consvar_t cv_kartvoices = {"kartvoices", "Tasteful", CV_SAVE, kartvoices_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// this might be a debug or it might be an undocumented regular feature
consvar_t cv_karteliminatelast = {"karteliminatelast", "Yes", CV_NETVAR|CV_CHEAT|CV_CALL, CV_OnOff, KartEliminateLast_OnChange, 0, NULL, NULL, 0, 0, NULL};

View file

@ -126,6 +126,7 @@ extern consvar_t cv_kartfrantic;
extern consvar_t cv_kartcomeback;
extern consvar_t cv_kartmirror;
extern consvar_t cv_kartspeedometer;
extern consvar_t cv_kartvoices;
extern consvar_t cv_karteliminatelast;

View file

@ -625,7 +625,7 @@ void F_CreditDrawer(void)
y += 12<<FRACBITS;
break;
}
if (FixedMul(y,vid.dupy) > vid.height)
if (((y>>FRACBITS) * vid.dupy) > vid.height)
break;
}
@ -686,13 +686,20 @@ boolean F_CreditResponder(event_t *event)
break;
}
/*if (!(timesBeaten) && !(netgame || multiplayer))
return false;*/
if (event->type != ev_keydown)
return false;
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_SPACE && key != KEY_BACKSPACE)
if (key == KEY_DOWNARROW || key == KEY_SPACE)
{
if (!timetonext && !finalecount)
animtimer += 7;
return false;
}
/*if (!(timesBeaten) && !(netgame || multiplayer))
return false;*/
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE)
return false;
if (keypressed)

View file

@ -403,6 +403,7 @@ void K_RegisterKartStuff(void)
CV_RegisterVar(&cv_kartcomeback);
CV_RegisterVar(&cv_kartmirror);
CV_RegisterVar(&cv_kartspeedometer);
CV_RegisterVar(&cv_kartvoices);
CV_RegisterVar(&cv_karteliminatelast);
CV_RegisterVar(&cv_votetime);
@ -1338,18 +1339,21 @@ static void K_RegularVoiceTimers(player_t *player)
static void K_PlayTauntSound(mobj_t *source)
{
if (source->player && source->player->kartstuff[k_tauntvoices]) // Prevents taunt sounds from playing every time the button is pressed
return;
sfxenum_t pick = P_RandomKey(4); // Gotta roll the RNG every time this is called for sync reasons
boolean tasteful = (!source->player || !source->player->kartstuff[k_tauntvoices]);
S_StartSound(source, sfx_taunt1+P_RandomKey(4));
if (cv_kartvoices.value && (tasteful || cv_kartvoices.value == 2))
S_StartSound(source, sfx_taunt1+pick);
if (!tasteful)
return;
K_TauntVoiceTimers(source->player);
}
static void K_PlayOvertakeSound(mobj_t *source)
{
if (source->player && source->player->kartstuff[k_voices]) // Prevents taunt sounds from playing every time the button is pressed
return;
boolean tasteful = (!source->player || !source->player->kartstuff[k_voices]);
if (!G_RaceGametype()) // Only in race
return;
@ -1358,14 +1362,19 @@ static void K_PlayOvertakeSound(mobj_t *source)
if (leveltime < starttime+(10*TICRATE))
return;
S_StartSound(source, sfx_slow);
if (cv_kartvoices.value && (tasteful || cv_kartvoices.value == 2))
S_StartSound(source, sfx_slow);
if (!tasteful)
return;
K_RegularVoiceTimers(source->player);
}
static void K_PlayHitEmSound(mobj_t *source)
{
S_StartSound(source, sfx_hitem);
if (cv_kartvoices.value)
S_StartSound(source, sfx_hitem);
K_RegularVoiceTimers(source->player);
}

View file

@ -1337,9 +1337,10 @@ static menuitem_t OP_SoundOptionsMenu[] =
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 70},
{IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 80},
{IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 100},
{IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 100},
{IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 110},
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 120},
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 130},
};
/*static menuitem_t OP_DataOptionsMenu[] =
@ -2203,29 +2204,30 @@ static void M_ChangeCvar(INT32 choice)
if (cv == &cv_playercolor)
{
SINT8 skinno = R_SkinAvailable(cv_chooseskin.string);
if (skinno == -1)
return;
CV_SetValue(cv,skins[skinno].prefcolor);
if (skinno != -1)
CV_SetValue(cv,skins[skinno].prefcolor);
return;
}
return;
CV_Set(cv,cv->defaultvalue);
return;
}
choice = (choice<<1) - 1;
if (((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_SLIDER)
||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_INVISSLIDER)
||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_NOMOD))
{
CV_SetValue(cv,cv->value+(choice*2-1));
CV_SetValue(cv,cv->value+choice);
}
else if (cv->flags & CV_FLOAT)
{
char s[20];
sprintf(s,"%f",FIXED_TO_FLOAT(cv->value)+(choice*2-1)*(1.0f/16.0f));
sprintf(s,"%f",FIXED_TO_FLOAT(cv->value)+(choice)*(1.0f/16.0f));
CV_Set(cv,s);
}
else
CV_AddValue(cv,choice*2-1);
CV_AddValue(cv,choice);
}
static boolean M_ChangeStringCvar(INT32 choice)
@ -2583,7 +2585,7 @@ boolean M_Responder(event_t *ev)
if (routine && ((currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_ARROWS
|| (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_CVAR))
{
if (currentMenu != &OP_SoundOptionsDef)
if (currentMenu != &OP_SoundOptionsDef || itemOn > 3)
S_StartSound(NULL, sfx_menu1);
routine(0);
}
@ -2593,7 +2595,7 @@ boolean M_Responder(event_t *ev)
if (routine && ((currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_ARROWS
|| (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_CVAR))
{
if (currentMenu != &OP_SoundOptionsDef)
if (currentMenu != &OP_SoundOptionsDef || itemOn > 3)
S_StartSound(NULL, sfx_menu1);
routine(1);
}
@ -2680,7 +2682,7 @@ boolean M_Responder(event_t *ev)
|| cv == &cv_newgametype)
return true;
if (currentMenu != &OP_SoundOptionsDef)
if (currentMenu != &OP_SoundOptionsDef || itemOn > 3)
S_StartSound(NULL, sfx_menu1);
routine(-1);
return true;
@ -3127,7 +3129,7 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop)
if (ontop)
{
V_DrawCharacter(x - 15 - (skullAnimCounter/5), y,
V_DrawCharacter(x - 16 - (skullAnimCounter/5), y,
'\x1C' | highlightflags, false); // left arrow
V_DrawCharacter(x+(SLIDER_RANGE*8) + 8 + (skullAnimCounter/5), y,
'\x1D' | highlightflags, false); // right arrow
@ -4566,6 +4568,7 @@ static void M_DrawSkyRoom(void)
break;
}
}
if (y)
{
y += currentMenu->y;
@ -4581,9 +4584,9 @@ static void M_DrawSkyRoom(void)
if (lengthstring)
{
V_DrawCharacter(BASEVIDWIDTH - currentMenu->x - 10 - lengthstring - (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].alphaKey,
'\x1C' | highlightflags, false);
'\x1C' | highlightflags, false); // left arrow
V_DrawCharacter(BASEVIDWIDTH - currentMenu->x + 2 + (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].alphaKey,
'\x1D' | highlightflags, false);
'\x1D' | highlightflags, false); // right arrow
}
}

View file

@ -1708,10 +1708,13 @@ void P_DoPlayerExit(player_t *player)
else if (!countdown)
countdown = cv_countdowntime.value*TICRATE + 1; // Use cv_countdowntime
if (K_IsPlayerLosing(player))
S_StartSound(player->mo, sfx_klose);
else
S_StartSound(player->mo, sfx_kwin);
if (cv_kartvoices.value)
{
if (K_IsPlayerLosing(player))
S_StartSound(player->mo, sfx_klose);
else
S_StartSound(player->mo, sfx_kwin);
}
player->exiting = 3*TICRATE;