mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 19:01:50 +00:00
Work on menus
This commit is contained in:
parent
6ff08671cd
commit
90365ffc52
5 changed files with 62 additions and 37 deletions
|
|
@ -31,6 +31,8 @@ extern char player_names[MAXPLAYERS][MAXPLAYERNAME+1];
|
||||||
extern player_t players[MAXPLAYERS];
|
extern player_t players[MAXPLAYERS];
|
||||||
extern boolean playeringame[MAXPLAYERS];
|
extern boolean playeringame[MAXPLAYERS];
|
||||||
|
|
||||||
|
extern boolean gameovermus;
|
||||||
|
|
||||||
// ======================================
|
// ======================================
|
||||||
// DEMO playback/recording related stuff.
|
// DEMO playback/recording related stuff.
|
||||||
// ======================================
|
// ======================================
|
||||||
|
|
|
||||||
82
src/m_menu.c
82
src/m_menu.c
|
|
@ -2480,16 +2480,14 @@ static void M_HandleMenuPresState(menu_t *newMenu)
|
||||||
curfadevalue = 16;
|
curfadevalue = 16;
|
||||||
curhidepics = hidetitlepics;
|
curhidepics = hidetitlepics;
|
||||||
curbgcolor = -1;
|
curbgcolor = -1;
|
||||||
curbgxspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollxspeed;
|
curbgxspeed = titlescrollxspeed;
|
||||||
curbgyspeed = (gamestate == GS_TIMEATTACK) ? 18 : titlescrollyspeed;
|
curbgyspeed = titlescrollyspeed;
|
||||||
curbghide = (gamestate != GS_TIMEATTACK); // show in time attack, hide in other menus
|
curbghide = (gamestate != GS_TIMEATTACK); // show in time attack, hide in other menus
|
||||||
|
|
||||||
// don't do the below during the in-game menus
|
// don't do the below during the in-game menus
|
||||||
if (gamestate != GS_TITLESCREEN && gamestate != GS_TIMEATTACK)
|
if (gamestate != GS_TITLESCREEN && gamestate != GS_TIMEATTACK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Find current presentation values
|
|
||||||
M_SetMenuCurBackground((gamestate == GS_TIMEATTACK) ? "RECATTBG" : "TITLESKY");
|
|
||||||
M_SetMenuCurFadeValue(16);
|
M_SetMenuCurFadeValue(16);
|
||||||
M_SetMenuCurHideTitlePics();
|
M_SetMenuCurHideTitlePics();
|
||||||
|
|
||||||
|
|
@ -4820,31 +4818,33 @@ static void M_HandleLevelPlatter(INT32 choice)
|
||||||
if (!(levellistmode == LLM_CREATESERVER && !lsrow))
|
if (!(levellistmode == LLM_CREATESERVER && !lsrow))
|
||||||
{
|
{
|
||||||
ifselectvalnextmapnobrace(lscol)
|
ifselectvalnextmapnobrace(lscol)
|
||||||
lsoffs[0] = lsoffs[1] = 0;
|
lsoffs[0] = lsoffs[1] = 0;
|
||||||
S_StartSound(NULL,sfx_menu1);
|
S_StartSound(NULL,sfx_menu1);
|
||||||
if (gamestate == GS_TIMEATTACK)
|
|
||||||
M_SetupNextMenu(currentMenu->prevMenu);
|
if (gamestate == GS_TIMEATTACK)
|
||||||
else if (currentMenu == &MISC_ChangeLevelDef)
|
M_SetupNextMenu(currentMenu->prevMenu);
|
||||||
{
|
else if (currentMenu == &MISC_ChangeLevelDef)
|
||||||
if (currentMenu->prevMenu && currentMenu->prevMenu != &MPauseDef)
|
|
||||||
M_SetupNextMenu(currentMenu->prevMenu);
|
|
||||||
else
|
|
||||||
M_ChangeLevel(0);
|
|
||||||
Z_Free(levelselect.rows);
|
|
||||||
levelselect.rows = NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
M_LevelSelectWarp(0);
|
|
||||||
Nextmap_OnChange();
|
|
||||||
}
|
|
||||||
else if (!lsoffs[0]) // prevent sound spam
|
|
||||||
{
|
{
|
||||||
lsoffs[0] = -8;
|
if (currentMenu->prevMenu && currentMenu->prevMenu != &MPauseDef)
|
||||||
S_StartSound(NULL,sfx_s3kb2);
|
M_SetupNextMenu(currentMenu->prevMenu);
|
||||||
|
else
|
||||||
|
M_ChangeLevel(0);
|
||||||
|
Z_Free(levelselect.rows);
|
||||||
|
levelselect.rows = NULL;
|
||||||
}
|
}
|
||||||
break;
|
else
|
||||||
|
M_LevelSelectWarp(0);
|
||||||
|
Nextmap_OnChange();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (!lsoffs[0])
|
||||||
|
{
|
||||||
|
lsoffs[0] = -8;
|
||||||
|
S_StartSound(NULL,sfx_s3kb2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
/* FALLTHRU */
|
/* FALLTHRU */
|
||||||
|
|
||||||
case KEY_RIGHTARROW:
|
case KEY_RIGHTARROW:
|
||||||
if (levellistmode == LLM_CREATESERVER && !lsrow)
|
if (levellistmode == LLM_CREATESERVER && !lsrow)
|
||||||
{
|
{
|
||||||
|
|
@ -4906,7 +4906,6 @@ static void M_HandleLevelPlatter(INT32 choice)
|
||||||
case KEY_ESCAPE:
|
case KEY_ESCAPE:
|
||||||
exitmenu = true;
|
exitmenu = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -5054,12 +5053,13 @@ static void M_DrawLevelPlatterMenu(void)
|
||||||
INT32 y = lsbasey + lsoffs[0] - getheadingoffset(lsrow);
|
INT32 y = lsbasey + lsoffs[0] - getheadingoffset(lsrow);
|
||||||
const INT32 cursorx = (sizeselect ? 0 : (lscol*lshseperation));
|
const INT32 cursorx = (sizeselect ? 0 : (lscol*lshseperation));
|
||||||
|
|
||||||
if (gamestate == GS_TIMEATTACK)
|
if (currentMenu->prevMenu == &SP_TimeAttackDef)
|
||||||
{
|
{
|
||||||
|
M_SetMenuCurBackground("RECATTBG");
|
||||||
|
|
||||||
curbgxspeed = 0;
|
curbgxspeed = 0;
|
||||||
curbgyspeed = 18;
|
curbgyspeed = 18;
|
||||||
curbghide = false;
|
|
||||||
strncpy(curbgname, "RECATTBG", 8);
|
|
||||||
if (curbgcolor >= 0)
|
if (curbgcolor >= 0)
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||||
else if (!curbghide || !titlemapinaction)
|
else if (!curbghide || !titlemapinaction)
|
||||||
|
|
@ -5068,14 +5068,27 @@ static void M_DrawLevelPlatterMenu(void)
|
||||||
V_DrawFadeScreen(0xFF00, curfadevalue);
|
V_DrawFadeScreen(0xFF00, curfadevalue);
|
||||||
|
|
||||||
// Draw and animate foreground
|
// Draw and animate foreground
|
||||||
if (!curbghide || !titlemapinaction)
|
if ((!curbghide || !titlemapinaction) && !stricmp("RECATTBG", curbgname))
|
||||||
{
|
{
|
||||||
V_DrawSciencePatch(0, -(130<<FRACBITS) + FixedMul(130<<FRACBITS, FixedDiv(recfgtimer%70, 70)), V_SNAPTOTOP|V_SNAPTOLEFT, W_CachePatchName("RECATFG", PU_CACHE), FRACUNIT);
|
V_DrawSciencePatch(0, -(130<<FRACBITS) + FixedMul(130<<FRACBITS, FixedDiv(recfgtimer%70, 70)), V_SNAPTOTOP|V_SNAPTOLEFT, W_CachePatchName("RECATFG", PU_CACHE), FRACUNIT);
|
||||||
V_DrawSciencePatch(320<<FRACBITS, -(130<<FRACBITS) + FixedMul(130<<FRACBITS, FixedDiv(recfgtimer%70, 70)), V_SNAPTOTOP|V_SNAPTORIGHT|V_FLIP, W_CachePatchName("RECATFG", PU_CACHE), FRACUNIT);
|
V_DrawSciencePatch(320<<FRACBITS, -(130<<FRACBITS) + FixedMul(130<<FRACBITS, FixedDiv(recfgtimer%70, 70)), V_SNAPTOTOP|V_SNAPTORIGHT|V_FLIP, W_CachePatchName("RECATFG", PU_CACHE), FRACUNIT);
|
||||||
|
V_DrawSciencePatch(102*FRACUNIT, 40*FINESINE((recfgtimer)*8)*FRACUNIT, 0, W_CachePatchName("RECATFG", PU_CACHE), FRACUNIT);
|
||||||
recfgtimer++;
|
recfgtimer++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentMenu->prevMenu == &SP_NightsAttackDef)
|
||||||
|
{
|
||||||
|
M_SetMenuCurBackground("SRB2BACK");
|
||||||
|
|
||||||
|
if (curbgcolor >= 0)
|
||||||
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||||
|
else if (!curbghide || !titlemapinaction)
|
||||||
|
F_SkyScroll(curbgxspeed, curbgyspeed, curbgname);
|
||||||
|
if (curfadevalue)
|
||||||
|
V_DrawFadeScreen(0xFF00, curfadevalue);
|
||||||
|
}
|
||||||
|
|
||||||
// finds row at top of the screen
|
// finds row at top of the screen
|
||||||
while (y > -8)
|
while (y > -8)
|
||||||
{
|
{
|
||||||
|
|
@ -8082,11 +8095,11 @@ void M_DrawTimeAttackMenu(void)
|
||||||
UINT16 dispstatus;
|
UINT16 dispstatus;
|
||||||
patch_t *PictureOfUrFace;
|
patch_t *PictureOfUrFace;
|
||||||
|
|
||||||
|
M_SetMenuCurBackground("RECATTBG");
|
||||||
|
|
||||||
curbgxspeed = 0;
|
curbgxspeed = 0;
|
||||||
curbgyspeed = 18;
|
curbgyspeed = 18;
|
||||||
curbghide = false;
|
|
||||||
|
|
||||||
strncpy(curbgname, "RECATTBG", 8);
|
|
||||||
M_ChangeMenuMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
|
M_ChangeMenuMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
|
||||||
|
|
||||||
if (curbgcolor >= 0)
|
if (curbgcolor >= 0)
|
||||||
|
|
@ -8097,10 +8110,11 @@ void M_DrawTimeAttackMenu(void)
|
||||||
V_DrawFadeScreen(0xFF00, curfadevalue);
|
V_DrawFadeScreen(0xFF00, curfadevalue);
|
||||||
|
|
||||||
// Draw and animate foreground
|
// Draw and animate foreground
|
||||||
if (!curbghide || !titlemapinaction)
|
if ((!curbghide || !titlemapinaction) && !stricmp("RECATTBG", curbgname))
|
||||||
{
|
{
|
||||||
V_DrawSciencePatch(0, -(130<<FRACBITS) + FixedMul(130<<FRACBITS, FixedDiv(recfgtimer%70, 70)), V_SNAPTOTOP|V_SNAPTOLEFT, W_CachePatchName("RECATFG", PU_CACHE), FRACUNIT);
|
V_DrawSciencePatch(0, -(130<<FRACBITS) + FixedMul(130<<FRACBITS, FixedDiv(recfgtimer%70, 70)), V_SNAPTOTOP|V_SNAPTOLEFT, W_CachePatchName("RECATFG", PU_CACHE), FRACUNIT);
|
||||||
V_DrawSciencePatch(320<<FRACBITS, -(130<<FRACBITS) + FixedMul(130<<FRACBITS, FixedDiv(recfgtimer%70, 70)), V_SNAPTOTOP|V_SNAPTORIGHT|V_FLIP, W_CachePatchName("RECATFG", PU_CACHE), FRACUNIT);
|
V_DrawSciencePatch(320<<FRACBITS, -(130<<FRACBITS) + FixedMul(130<<FRACBITS, FixedDiv(recfgtimer%70, 70)), V_SNAPTOTOP|V_SNAPTORIGHT|V_FLIP, W_CachePatchName("RECATFG", PU_CACHE), FRACUNIT);
|
||||||
|
V_DrawSciencePatch(0, 40*FINESINE((recfgtimer)*8), 0, W_CachePatchName("CLOCK", PU_CACHE), FRACUNIT);
|
||||||
recfgtimer++;
|
recfgtimer++;
|
||||||
}
|
}
|
||||||
M_DrawMenuTitle();
|
M_DrawMenuTitle();
|
||||||
|
|
@ -8291,6 +8305,8 @@ void M_DrawNightsAttackMenu(void)
|
||||||
INT32 i, x, y, cursory = 0;
|
INT32 i, x, y, cursory = 0;
|
||||||
UINT16 dispstatus;
|
UINT16 dispstatus;
|
||||||
|
|
||||||
|
M_SetMenuCurBackground("SRB2BACK");
|
||||||
|
|
||||||
M_ChangeMenuMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
|
M_ChangeMenuMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
|
||||||
|
|
||||||
if (curbgcolor >= 0)
|
if (curbgcolor >= 0)
|
||||||
|
|
|
||||||
|
|
@ -2445,7 +2445,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
|
|
||||||
if (target->player->lives <= 0) // Tails 03-14-2000
|
if (target->player->lives <= 0) // Tails 03-14-2000
|
||||||
{
|
{
|
||||||
boolean gameovermus = false;
|
gameovermus = false;
|
||||||
if ((netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value != 1))
|
if ((netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value != 1))
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
@ -2465,8 +2465,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
|
|
||||||
if (gameovermus)
|
if (gameovermus)
|
||||||
{
|
{
|
||||||
S_StopMusic(); // Stop the Music! Tails 03-14-2000
|
S_FadeOutStopMusic(1000); // Stop the Music! Tails 03-14-2000
|
||||||
S_ChangeMusicInternal("_gover", false); // Yousa dead now, Okieday? Tails 03-14-2000
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && numgameovers < maxgameovers)
|
if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && numgameovers < maxgameovers)
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,10 @@
|
||||||
#include "p_slopes.h"
|
#include "p_slopes.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Game over stuff
|
||||||
|
boolean gameovermus;
|
||||||
|
INT32 fadetogameovermus;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Map MD5, calculated on level load.
|
// Map MD5, calculated on level load.
|
||||||
// Sent to clients in PT_SERVERINFO.
|
// Sent to clients in PT_SERVERINFO.
|
||||||
|
|
@ -2619,7 +2623,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
boolean loadedbm = false;
|
boolean loadedbm = false;
|
||||||
sector_t *ss;
|
sector_t *ss;
|
||||||
boolean chase;
|
boolean chase;
|
||||||
|
gameovermus = false;
|
||||||
levelloading = true;
|
levelloading = true;
|
||||||
|
|
||||||
// This is needed. Don't touch.
|
// This is needed. Don't touch.
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
// Object place
|
// Object place
|
||||||
#include "m_cheat.h"
|
#include "m_cheat.h"
|
||||||
|
boolean gameovermus;
|
||||||
|
|
||||||
tic_t leveltime;
|
tic_t leveltime;
|
||||||
|
|
||||||
|
|
@ -724,6 +725,9 @@ void P_Ticker(boolean run)
|
||||||
|
|
||||||
P_MapEnd();
|
P_MapEnd();
|
||||||
|
|
||||||
|
if ((leveltime % (TICRATE * 2) == 0) && gameovermus)
|
||||||
|
S_ChangeMusicInternal("_gover", false); // Yousa dead now, Okieday? Tails 03-14-2000
|
||||||
|
|
||||||
// Z_CheckMemCleanup();
|
// Z_CheckMemCleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue