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
Change: Automatic screenshot numbering #9781
Conversation
Invoking the `screenshot` console command with a filename ending in %d will cause it to be numbered automatically.
Invoking the `screenshot` console command with a filename ending in %d will cause it to be numbered automatically.
Hmm. I am a bit torn. On one hand, I fully understand why you did the "has to end with" part. On the other hand, for Maybe we should do something like: when it ends with That all said, for sure this PR misses a change in documentation for the console command, mentioning this. Otherwise only those who have seen this PR know that this is now possible :) Mind updating the docs for this console command? |
I've added a documentation string to the console command - are there other places in the code where the |
What do you think about using an actual date in front of each "screenshot" or "Donnington Transport, 2037-08-20"? I mean something like this: With screenshot numbers like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LC-Zorg's suggestions could be another enhancement PR but shouldn't preclude this one from being merged. Anyone writing a script to automate taking screenshots should be more than capable of sorting their screenshots.
Commits need squashing but that can happen when merging. 🙂
Invoking the
screenshot
console command with a filename ending in %d will cause it to be numbered automatically.Motivation / Problem
As part of running my OpenTTD server I use console scripts to capture a screenshot of the game periodically. I use these screenshots to make time-lapse videos of the game.
However, the default behavior of the console command
screenshot
with a user-provided filename will always save just to that filename, causing it to be overwritten if it exists. The only way to get a 'reel' of screenshots automatically is to omit the filename argument, in which case the screenshots will be saved as e.g.screenshot.png
,screenshot#1.png
,screenshot#2.png
, etc.Description
The proposed change causes the automatic numbering to happen to any user provided filename that ends in
%d
.Limitations
%d
token must be at the end of the user provided filename.screenshot.png
, followed byscreenshot#1.png
.Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.