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

Fix up test_weather() method in weather_gen.cpp, attach to debug menu #30207

Merged
merged 2 commits into from
May 4, 2019

Conversation

esotericist
Copy link
Contributor

@esotericist esotericist commented May 3, 2019

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 of 1;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 be 0;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.

@@ -149,7 +150,8 @@ static int info_uilist()
uilist_entry( DEBUG_TRAIT_GROUP, true, 't', _( "Test trait group" ) ),
uilist_entry( DEBUG_SHOW_MSG, true, 'd', _( "Show debug message" ) ),
uilist_entry( DEBUG_CRASH_GAME, true, 'C', _( "Crash game (test crash handling)" ) ),
uilist_entry( DEBUG_DISPLAY_NPC_PATH, true, 'n', _( "Toggle NPC pathfinding on map" ) )
uilist_entry( DEBUG_DISPLAY_NPC_PATH, true, 'n', _( "Toggle NPC pathfinding on map" ) ),
uilist_entry( DEBUG_TEST_WEATHER, true, 'W', _( "Test Weather" ) )
Copy link
Contributor

Choose a reason for hiding this comment

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

Decapitalize "Weather".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@ifreund ifreund added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Weather Rain, snow, portal storms and non-temperature environment labels May 3, 2019
@kevingranade kevingranade merged commit cc3a0d3 into CleverRaven:master May 4, 2019
@esotericist esotericist deleted the test-weather-bits branch August 3, 2019 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Weather Rain, snow, portal storms and non-temperature environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants