Skip to content

Commit

Permalink
Heretic & Hexen: demo playback fixes (#1151)
Browse files Browse the repository at this point in the history
* Heretic/Hexen: enable demo fast-forwarding
The button was already assignable, it just didn't do anything.
Additionally, don't pop up the menu during a demo, unless the user
presses the menu key, as in Crispy Doom.

* Hexen: fix usergame being disabled when not in a demo
  • Loading branch information
kitchen-ace authored Jan 31, 2024
1 parent b40436f commit cbd56ec
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/heretic/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,14 @@ boolean G_Responder(event_t * ev)
usearti = true;
}

// [crispy] demo fast-forward
if (ev->type == ev_keydown && ev->data1 == key_demospeed &&
(demoplayback || gamestate == GS_DEMOSCREEN))
{
singletics = !singletics;
return true;
}

// Check for spy mode player cycle
if (gamestate == GS_LEVEL && ev->type == ev_keydown
&& ev->data1 == KEY_F12 && !deathmatch)
Expand Down
3 changes: 2 additions & 1 deletion src/heretic/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2220,7 +2220,8 @@ boolean MN_Responder(event_t * event)

if (!MenuActive)
{
if (key == key_menu_activate || gamestate == GS_DEMOSCREEN || demoplayback)
// [crispy] don't pop up the menu on other keys during a demo
if (key == key_menu_activate) //|| gamestate == GS_DEMOSCREEN || demoplayback)
{
MN_ActivateMenu();
return (true);
Expand Down
12 changes: 11 additions & 1 deletion src/hexen/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,14 @@ boolean G_Responder(event_t * ev)
usearti = true;
}

// [crispy] demo fast-forward
if (ev->type == ev_keydown && ev->data1 == key_demospeed &&
(demoplayback || gamestate == GS_DEMOSCREEN))
{
singletics = !singletics;
return true;
}

// Check for spy mode player cycle
if (gamestate == GS_LEVEL && ev->type == ev_keydown
&& ev->data1 == key_spy && !deathmatch)
Expand Down Expand Up @@ -2049,7 +2057,9 @@ void G_InitNew(skill_t skill, int episode, int map)
}

// Set up a bunch of globals
if (!demoextend)
// [crispy] since demoextend is the default, we also want to check to
// make sure we're not playing a demo
if (!demoextend || (!demorecording && !demoplayback))
{
// This prevents map-loading from interrupting a demo.
// demoextend is set back to false only if starting a new game or
Expand Down
3 changes: 2 additions & 1 deletion src/hexen/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2215,7 +2215,8 @@ boolean MN_Responder(event_t * event)

if (!MenuActive)
{
if (key == key_menu_activate || gamestate == GS_DEMOSCREEN || demoplayback)
// [crispy] don't pop up the menu on other keys during a demo
if (key == key_menu_activate) //|| gamestate == GS_DEMOSCREEN || demoplayback)
{
MN_ActivateMenu();
return (true);
Expand Down

5 comments on commit cbd56ec

@mikeday0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit introduces a small regression. It used to be possible to bring up the menu by pressing any key. Now you have to use key_menu_activate. Crispy Doom brings up the menu when any key is pressed.

@kitchen-ace
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikeday0 Sorry I somehow missed this comment.

Crispy Doom brings up the menu when any key is pressed.

Ah I wasn't checking for other keys when not playing a demo. Will fix soon.

@JNechaevsky
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and this conditions may be handy for more "Doomy" like menu handling. Notably, automap opening will work fine on demo playback.

@mikeday0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault here! I just realized I failed to use the @.

@kitchen-ace
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected it to notify me since it was my commit, but I guess not.

Please sign in to comment.