Work on menus

This commit is contained in:
Steel Titanium 2019-08-03 17:30:51 -04:00
parent e8caa8538d
commit 9ea7a6dfca
No known key found for this signature in database
GPG key ID: 924BA411F18DFDBE
5 changed files with 62 additions and 37 deletions

View file

@ -31,6 +31,8 @@ extern char player_names[MAXPLAYERS][MAXPLAYERNAME+1];
extern player_t players[MAXPLAYERS];
extern boolean playeringame[MAXPLAYERS];
extern boolean gameovermus;
// ======================================
// DEMO playback/recording related stuff.
// ======================================

View file

@ -2480,16 +2480,14 @@ static void M_HandleMenuPresState(menu_t *newMenu)
curfadevalue = 16;
curhidepics = hidetitlepics;
curbgcolor = -1;
curbgxspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollxspeed;
curbgyspeed = (gamestate == GS_TIMEATTACK) ? 18 : titlescrollyspeed;
curbgxspeed = titlescrollxspeed;
curbgyspeed = titlescrollyspeed;
curbghide = (gamestate != GS_TIMEATTACK); // show in time attack, hide in other menus
// don't do the below during the in-game menus
if (gamestate != GS_TITLESCREEN && gamestate != GS_TIMEATTACK)
return;
// Find current presentation values
M_SetMenuCurBackground((gamestate == GS_TIMEATTACK) ? "RECATTBG" : "TITLESKY");
M_SetMenuCurFadeValue(16);
M_SetMenuCurHideTitlePics();
@ -4820,31 +4818,33 @@ static void M_HandleLevelPlatter(INT32 choice)
if (!(levellistmode == LLM_CREATESERVER && !lsrow))
{
ifselectvalnextmapnobrace(lscol)
lsoffs[0] = lsoffs[1] = 0;
S_StartSound(NULL,sfx_menu1);
if (gamestate == GS_TIMEATTACK)
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] = lsoffs[1] = 0;
S_StartSound(NULL,sfx_menu1);
if (gamestate == GS_TIMEATTACK)
M_SetupNextMenu(currentMenu->prevMenu);
else if (currentMenu == &MISC_ChangeLevelDef)
{
lsoffs[0] = -8;
S_StartSound(NULL,sfx_s3kb2);
if (currentMenu->prevMenu && currentMenu->prevMenu != &MPauseDef)
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 */
case KEY_RIGHTARROW:
if (levellistmode == LLM_CREATESERVER && !lsrow)
{
@ -4906,7 +4906,6 @@ static void M_HandleLevelPlatter(INT32 choice)
case KEY_ESCAPE:
exitmenu = true;
break;
default:
break;
}
@ -5054,12 +5053,13 @@ static void M_DrawLevelPlatterMenu(void)
INT32 y = lsbasey + lsoffs[0] - getheadingoffset(lsrow);
const INT32 cursorx = (sizeselect ? 0 : (lscol*lshseperation));
if (gamestate == GS_TIMEATTACK)
if (currentMenu->prevMenu == &SP_TimeAttackDef)
{
M_SetMenuCurBackground("RECATTBG");
curbgxspeed = 0;
curbgyspeed = 18;
curbghide = false;
strncpy(curbgname, "RECATTBG", 8);
if (curbgcolor >= 0)
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
else if (!curbghide || !titlemapinaction)
@ -5068,14 +5068,27 @@ static void M_DrawLevelPlatterMenu(void)
V_DrawFadeScreen(0xFF00, curfadevalue);
// 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(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++;
}
}
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
while (y > -8)
{
@ -8082,11 +8095,11 @@ void M_DrawTimeAttackMenu(void)
UINT16 dispstatus;
patch_t *PictureOfUrFace;
M_SetMenuCurBackground("RECATTBG");
curbgxspeed = 0;
curbgyspeed = 18;
curbghide = false;
strncpy(curbgname, "RECATTBG", 8);
M_ChangeMenuMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
if (curbgcolor >= 0)
@ -8097,10 +8110,11 @@ void M_DrawTimeAttackMenu(void)
V_DrawFadeScreen(0xFF00, curfadevalue);
// 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(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++;
}
M_DrawMenuTitle();
@ -8291,6 +8305,8 @@ void M_DrawNightsAttackMenu(void)
INT32 i, x, y, cursory = 0;
UINT16 dispstatus;
M_SetMenuCurBackground("SRB2BACK");
M_ChangeMenuMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
if (curbgcolor >= 0)

View file

@ -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
{
boolean gameovermus = false;
gameovermus = false;
if ((netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value != 1))
{
INT32 i;
@ -2465,8 +2465,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
if (gameovermus)
{
S_StopMusic(); // Stop the Music! Tails 03-14-2000
S_ChangeMusicInternal("_gover", false); // Yousa dead now, Okieday? Tails 03-14-2000
S_FadeOutStopMusic(1000); // Stop the Music! Tails 03-14-2000
}
if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && numgameovers < maxgameovers)

View file

@ -81,6 +81,10 @@
#include "p_slopes.h"
#endif
// Game over stuff
boolean gameovermus;
INT32 fadetogameovermus;
//
// Map MD5, calculated on level load.
// Sent to clients in PT_SERVERINFO.
@ -2619,7 +2623,7 @@ boolean P_SetupLevel(boolean skipprecip)
boolean loadedbm = false;
sector_t *ss;
boolean chase;
gameovermus = false;
levelloading = true;
// This is needed. Don't touch.

View file

@ -24,6 +24,7 @@
// Object place
#include "m_cheat.h"
boolean gameovermus;
tic_t leveltime;
@ -724,6 +725,9 @@ void P_Ticker(boolean run)
P_MapEnd();
if ((leveltime % (TICRATE * 2) == 0) && gameovermus)
S_ChangeMusicInternal("_gover", false); // Yousa dead now, Okieday? Tails 03-14-2000
// Z_CheckMemCleanup();
}