Skip to content
Snippets Groups Projects

Send a `quitting` argument to the GameQuit Lua hook.

Merged Golden requested to merge Golden/SRB2:gamequit-argument into next
  • Send quitting argument to determine whether we're quitting the game, or just exiting to the title screen.
  • Call the Lua hook irregardless if we're playing or not.
Edited by Golden

Merge request reports

Checking pipeline status.

Approval is optional

Merged by James R.James R. 4 years ago (Dec 10, 2020 8:25pm UTC)

Merge details

  • Changes merged into with 9ea969b6.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I am fine with 1), but against 2), because that hook was intended to be specifically called when a playing session ends ("game" refers to a game session, not the whole game).

    Edited by LJ Sonic
  • Author Contributor

    How am I supposed to automatically save configs when the game closes consistently then

  • Maybe just add another parameter that tells Lua whether or not the game was in the middle of a play session? That way you can have the functionality of both if you want.

    But I'm curious, if you're removing the if (Playing()) from quitting the game from the title screen, then why not in every other instance that LUAh_GameQuit is called? Seems kinda odd to have an exception for only one version of quitting.

  • Golden marked as a Work In Progress

    marked as a Work In Progress

  • Golden changed the description

    changed the description

  • I have to agree with @SMS_Alfredo that if (Playing) should not only be removed from the code that is called when the quit the game from the title screen, and also, I should expose Playing(), which is a better solution than adding booleans to the GameQuit hook in my opinion, because it can be used for other hooks that don't have a player_t argument as well.

    Edited by ChaoLoveIceMDBoy
  • I think your current solution is fine. There is no need for Playing() because the argument given to the hook fills that role better.

  • Golden unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Golden changed the description

    changed the description

  • Uhhh, you unmarked this as WIP, but nearly all of the if (Playing())s are still intact. Are you sure you want that?

  • Author Contributor

    forgot about that, doing now

  • Golden added 1 commit

    added 1 commit

    • 119d2e9e - Remove the rest of the Playing() checks for GameQuit hook

    Compare with previous version

  • Golden changed the description

    changed the description

  • merged

  • James R. mentioned in commit 9ea969b6

    mentioned in commit 9ea969b6

Please register or sign in to reply
Loading