Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Prompt on death quickloads instead of going to main menu #5823

Merged
merged 5 commits into from
Dec 20, 2024

Conversation

Skas8825
Copy link
Contributor

@Skas8825 Skas8825 commented Dec 20, 2024

Checklist

Required

Purpose of change

The option "Prompt on death" gives the player the option to keep it's save when dying instead of deleting it, however the prompt it gives for that it's a bit unclear asking if you want to return to the main menu or abandon your character to their fate, it's also a bit of chore having to load the save again from the main menu.

As for the quickload option that's found in game.cpp this action seems to have been broken for a long time according to searches in the Discord.

Describe the solution

Now on selecting 'No' it uses the game::quickload() function to load the last saved game.

The game::quickload() function was fixed by copying a version of game::setup() and replacing the one used by the quickload, this version is the same except it doesn't load the world mod files since they are already loaded and it's the same world.

To fix the quickload function it was also needed to move code for ui redrawing a few lines below in game::load( const save_t &name ), why this was crashing the game it's black sorcery beyond my comprehension.

Describe alternatives you've considered

Simply edit the prompt to say something like "... press No to keep your save".

Testing

Compiled the game, quicksaved and let my character die, also using the quickload keybind.

Reload_proof.mp4

Additional context

As it can be seen in the video, for some reason when quickloading the player's field of view it's not updated until you move so i guess someone can open an issue if they find it too bothersome.

Also since the crashes were pretty unclear about why game::quickload() was not working i would like if people can test whether it works or not in their distros since i only tested this on Windows.

related: #2590

@github-actions github-actions bot added the src changes related to source code. label Dec 20, 2024
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

looks good but could you fill in the PR template? also added in some nits

src/game.cpp Outdated Show resolved Hide resolved
src/game.cpp Outdated Show resolved Hide resolved
@scarf005 scarf005 changed the title feat: Replace the "Prompt on death" action to quickload instead of going back to the main menu, and fix quickload on the way. feat: Prompt on death now quickloads instead of going to main menu Dec 20, 2024
@scarf005 scarf005 changed the title feat: Prompt on death now quickloads instead of going to main menu feat: Prompt on death quickloads instead of going to main menu Dec 20, 2024
Skas8825 and others added 2 commits December 19, 2024 22:43
Co-authored-by: scarf <[email protected]>
…nk to scarf for the suggestions.

Co-authored-by: scarf <[email protected]>
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

looks alright, only playtest is required.

Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

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

  1. Compiled and load-tested.
  2. Turned death prompt on, started up a world and quicksaved.
  3. Ate a mininuke and refused to die, quickload works as expected.

@scarf005 scarf005 merged commit 35e043e into cataclysmbnteam:main Dec 20, 2024
16 checks passed
karxi pushed a commit to karxi/Cataclysm-BN that referenced this pull request Dec 20, 2024
…aclysmbnteam#5823)

* Initial unclear commit.

* Prompt changes.

* Minor grammar issue

* Typo

Co-authored-by: scarf <[email protected]>

* Cleaned `game::quicksave()` by modifying `game::setup()` instead, thank to scarf for the suggestions.
Co-authored-by: scarf <[email protected]>

---------

Co-authored-by: scarf <[email protected]>
@Ignaramico
Copy link

finally, no more closing the game to avoid a stupid death

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants