mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-14 13:51:31 +00:00
TITLE SCREEN DEMOS: Pick a random Staff Attack demo!!!
Also: Fix watching a demo replay of a map with a palette not resetting your palette back to normal when you go back to the menu(/titlescreen).
This commit is contained in:
parent
e2f57e5ca0
commit
75d08f2048
2 changed files with 54 additions and 12 deletions
|
@ -49,7 +49,7 @@ static tic_t stoptimer;
|
||||||
static boolean keypressed = false;
|
static boolean keypressed = false;
|
||||||
|
|
||||||
// (no longer) De-Demo'd Title Screen
|
// (no longer) De-Demo'd Title Screen
|
||||||
static UINT8 curDemo = 0;
|
static UINT8 laststaff = 0;
|
||||||
static UINT32 demoDelayLeft;
|
static UINT32 demoDelayLeft;
|
||||||
static UINT32 demoIdleLeft;
|
static UINT32 demoIdleLeft;
|
||||||
|
|
||||||
|
@ -985,8 +985,8 @@ void F_TitleScreenTicker(boolean run)
|
||||||
if (gameaction != ga_nothing || gamestate != GS_TITLESCREEN)
|
if (gameaction != ga_nothing || gamestate != GS_TITLESCREEN)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// no demos to play? or, are they disabled?
|
// are demos disabled?
|
||||||
if (!cv_rollingdemos.value || !numDemos)
|
if (!cv_rollingdemos.value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Wait for a while (for the music to finish, preferably)
|
// Wait for a while (for the music to finish, preferably)
|
||||||
|
@ -1009,27 +1009,53 @@ void F_TitleScreenTicker(boolean run)
|
||||||
{
|
{
|
||||||
char dname[9];
|
char dname[9];
|
||||||
lumpnum_t l;
|
lumpnum_t l;
|
||||||
|
const char *mapname;
|
||||||
|
UINT8 numstaff;
|
||||||
|
|
||||||
// prevent console spam if failed
|
// prevent console spam if failed
|
||||||
demoIdleLeft = demoIdleTime;
|
demoIdleLeft = demoIdleTime;
|
||||||
|
|
||||||
|
if ((l = W_CheckNumForName("MAP01S01")) == LUMPERROR) // gotta have ONE
|
||||||
|
{
|
||||||
|
F_StartIntro();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Replay intro when done cycling through demos
|
// Replay intro when done cycling through demos
|
||||||
if (curDemo == numDemos)
|
/*if (curDemo == numDemos) -- uuuh... we have a LOT of maps AND a big devteam... probably not gonna see a repeat unless you're super unlucky :V
|
||||||
{
|
{
|
||||||
curDemo = 0;
|
curDemo = 0;
|
||||||
F_StartIntro();
|
F_StartIntro();
|
||||||
return;
|
return;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
mapname = G_BuildMapName(G_RandMap(TOL_RACE, -2, false, false, 0, false)+1);
|
||||||
|
|
||||||
|
numstaff = 1;
|
||||||
|
while (numstaff < 100 && (l = W_CheckNumForName(va("%sS%02u",mapname,numstaff+1))) != LUMPERROR)
|
||||||
|
numstaff++;
|
||||||
|
if (laststaff && laststaff <= numstaff) // don't do the same staff member twice in a row, even if they're on different maps
|
||||||
|
{
|
||||||
|
numstaff = M_RandomKey(numstaff-1)+1;
|
||||||
|
if (numstaff >= laststaff)
|
||||||
|
numstaff++;
|
||||||
|
laststaff = numstaff;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
numstaff = M_RandomKey(numstaff)+1;
|
||||||
|
laststaff = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup demo name
|
// Setup demo name
|
||||||
snprintf(dname, 9, "DEMO_%03u", ++curDemo);
|
snprintf(dname, 9, "%sS%02u", mapname, numstaff);
|
||||||
|
|
||||||
if ((l = W_CheckNumForName(dname)) == LUMPERROR)
|
/*if ((l = W_CheckNumForName(dname)) == LUMPERROR) -- we KNOW it exists now
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("Demo lump \"%s\" doesn't exist\n"), dname);
|
CONS_Alert(CONS_ERROR, M_GetText("Demo lump \"%s\" doesn't exist\n"), dname);
|
||||||
F_StartIntro();
|
F_StartIntro();
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
titledemo = true;
|
titledemo = true;
|
||||||
G_DoPlayDemo(dname);
|
G_DoPlayDemo(dname);
|
||||||
|
|
26
src/g_game.c
26
src/g_game.c
|
@ -3312,7 +3312,7 @@ tryagain:
|
||||||
|| (!dedicated && M_MapLocked(ix+1))
|
|| (!dedicated && M_MapLocked(ix+1))
|
||||||
|| (!maphell && (mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU)) // this is bad
|
|| (!maphell && (mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU)) // this is bad
|
||||||
|| ((maphell == 2) && !(mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU))) // gasp
|
|| ((maphell == 2) && !(mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU))) // gasp
|
||||||
isokmap = false;
|
continue; //isokmap = false;
|
||||||
|
|
||||||
if (!ignorebuffer)
|
if (!ignorebuffer)
|
||||||
{
|
{
|
||||||
|
@ -3328,8 +3328,17 @@ tryagain:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isokmap)
|
if (!isokmap)
|
||||||
okmaps[numokmaps++] = ix;
|
continue;
|
||||||
|
|
||||||
|
if (pprevmap == -2) // title demos
|
||||||
|
{
|
||||||
|
lumpnum_t l;
|
||||||
|
if ((l = W_CheckNumForName(va("%sS01",G_BuildMapName(ix+1)))) == LUMPERROR)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
okmaps[numokmaps++] = ix;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numokmaps == 0) // If there's no matches... (Goodbye, incredibly silly function chains :V)
|
if (numokmaps == 0) // If there's no matches... (Goodbye, incredibly silly function chains :V)
|
||||||
|
@ -4095,8 +4104,8 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
||||||
}
|
}
|
||||||
save_p += VERSIONSIZE;
|
save_p += VERSIONSIZE;
|
||||||
|
|
||||||
// if (demoplayback) // reset game engine
|
if (demoplayback) // reset game engine
|
||||||
// G_StopDemo();
|
G_StopDemo();
|
||||||
|
|
||||||
// paused = false;
|
// paused = false;
|
||||||
// automapactive = false;
|
// automapactive = false;
|
||||||
|
@ -6321,10 +6330,17 @@ void G_StopDemo(void)
|
||||||
Z_Free(demobuffer);
|
Z_Free(demobuffer);
|
||||||
demobuffer = NULL;
|
demobuffer = NULL;
|
||||||
demoplayback = false;
|
demoplayback = false;
|
||||||
|
if (titledemo)
|
||||||
|
modeattacking = false;
|
||||||
titledemo = false;
|
titledemo = false;
|
||||||
timingdemo = false;
|
timingdemo = false;
|
||||||
singletics = false;
|
singletics = false;
|
||||||
|
|
||||||
|
if (gamestate == GS_LEVEL && rendermode != render_none)
|
||||||
|
{
|
||||||
|
V_SetPaletteLump("PLAYPAL"); // Reset the palette
|
||||||
|
R_ReInitColormaps(0, LUMPERROR);
|
||||||
|
}
|
||||||
if (gamestate == GS_INTERMISSION)
|
if (gamestate == GS_INTERMISSION)
|
||||||
Y_EndIntermission(); // cleanup
|
Y_EndIntermission(); // cleanup
|
||||||
if (gamestate == GS_VOTING)
|
if (gamestate == GS_VOTING)
|
||||||
|
|
Loading…
Reference in a new issue