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

Expose the "restart on exit" OS functionality #54738

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Nov 7, 2021

master version of #66168.

This can be used to restart a project with specific command line arguments applied. This can work in tandem with OS.get_cmdline_args() to restart with the same command line arguments as used to originally run the project.

Example use cases:

  • Restart to apply an user setting change that requires a restart to work.
  • Restart with a Godot command line argument to change the video driver, audio driver, etc.

This currently only works if the project is not started from the editor. (It can be started from an editor binary via the command-line still.)
I don't know why this happens – help is welcome for troubleshooting this.

This closes godotengine/godot-proposals#3460.

Testing project: test_restart_on_exit.zip

Preview

restart-on-exit.mp4

@reduz
Copy link
Member

reduz commented Jul 31, 2022

Needs rebase

@Calinou
Copy link
Member Author

Calinou commented Jul 31, 2022

Rebased and tested again, it works as expected. I also added a testing project to OP for future reference and example usage.

@akien-mga
Copy link
Member

Needs another rebase after #63624.

This can be used to restart a project with specific command line arguments
applied. This can work in tandem with `OS.get_cmdline_args()` to restart
with the same command line arguments as used to originally run the project.

Example use cases:

- Restart to apply an user setting change that requires a restart to work.
- Restart with a Godot command line argument to change the video driver,
  audio driver, etc.
@akien-mga akien-mga merged commit 5ecd61a into godotengine:master Aug 1, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way to easily restart a project
3 participants