Fix up test_weather() method in weather_gen.cpp, attach to debug menu #30207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "Fix up test_weather() method in weather_gen.cpp, attach to debug menu"
Purpose of change
While doing some exploration of possible desirable new default start dates for new worlds, I became aware of
test_weather()
. I also quickly became aware that it wasn't quite usable as I found it.Describe the solution
Adjusted the method to actually output usable cells for indicating date/time, as well as attaching it to the debug menu tree under the Info menu.
Describe alternatives you've considered
It was suggested it could be attached to a test instead, but this was easier and less thinky.
Additional context
Output format is:
|;year;season;day;hour;minute;temperature(F);humidity(%);pressure(mB);weatherdesc;windspeed(mph);winddirection
The
|
was simply to make it easier for me to have a search include start-of-line without needing to insert a newline character or use a regexp (e.g. allowing me to search for|1;0;20
for the 21st day of spring in the second year, without risk of1;0;20
matching some other column subset like "20-ish minutes after midnight on the second day of a season"). If the output gets imported to a spreadsheet or somesuch, it would be trivial to remove that column.year
,season
,day
,hour
,minute
are all integers starting from 0 (so the first day of the first season of the first year would be0;0;0
). The rest of the information should be mostly self-explanatory (and is unmodified from the original output).It still does two years of output starting from the moment of the current turn in-game.