CON: Add command "startscreen" and corresponding EVENT_SCREEN.

Use startscreen to take control away from the game and display content with rotatesprite.

RETURN is set to 1 when any key is pressed, and if it is nonzero when the event ends, the screen ends and the game resumes.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6508 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-11-29 07:29:11 +00:00
parent dbd8b72d10
commit f6678b336a
4 changed files with 33 additions and 0 deletions

View file

@ -127,6 +127,7 @@ enum GameEvent_t {
EVENT_POSTSAVEGAME,
EVENT_PRECUTSCENE,
EVENT_SKIPCUTSCENE,
EVENT_SCREEN,
#ifdef LUNATIC
EVENT_ANIMATEALLSPRITES,
#endif

View file

@ -473,6 +473,7 @@ static tokenmap_t const vm_keywords[] =
{ "ssp", CON_SSP },
{ "startcutscene", CON_STARTCUTSCENE },
{ "startlevel", CON_STARTLEVEL },
{ "startscreen", CON_STARTSCREEN },
{ "starttrack", CON_STARTTRACK },
{ "starttrackslot", CON_STARTTRACKSLOT },
{ "starttrackvar", CON_STARTTRACKVAR },
@ -721,6 +722,7 @@ const char *EventNames[MAXEVENTS] =
"EVENT_POSTSAVEGAME",
"EVENT_PRECUTSCENE",
"EVENT_SKIPCUTSCENE",
"EVENT_SCREEN",
#ifdef LUNATIC
"EVENT_ANIMATEALLSPRITES",
#endif
@ -6034,6 +6036,7 @@ repeatcase:
case CON_INSERTSPRITEQ:
case CON_STOPALLSOUNDS:
case CON_STOPALLMUSIC:
case CON_STARTSCREEN:
continue;
case CON_NULLOP:

View file

@ -1146,6 +1146,7 @@ enum ScriptKeywords_t
CON_STARTTRACKSLOT, // 406
CON_STOPALLMUSIC, // 407
CON_ACTORSOUND, // 408
CON_STARTSCREEN, // 409
CON_END
};
// KEEPINSYNC with the keyword list in lunatic/con_lang.lua

View file

@ -1236,6 +1236,28 @@ LUNATIC_EXTERN void G_ShowView(vec3_t vec, int32_t a, int32_t horiz, int32_t sec
G_UpdateScreenArea();
}
void Screen_Play(void)
{
int32_t running = 1;
I_ClearAllInput();
do
{
G_HandleAsync();
clearallviews(0);
if (VM_OnEventWithReturn(EVENT_SCREEN, -1, myconnectindex, I_CheckAllInput()))
running = 0;
nextpage();
I_ClearAllInput();
ototalclock = totalclock + 1; // pause game like ANMs
} while (running);
}
#if !defined LUNATIC
GAMEEXEC_STATIC void VM_Execute(int loop)
{
@ -2772,6 +2794,12 @@ nullquote:
continue;
}
case CON_STARTSCREEN:
insptr++;
I_ClearAllInput();
Screen_Play();
continue;
case CON_GUNIQHUDID:
insptr++;
{