-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Use system time for holiday menu screens #39897
Conversation
4-17-2020
The two recipes for fruit juice took the same amount of time to craft, even though one was 100% juice, and the other 50% juice and 50% water. This change cuts the 50% water recipe crafting time from 5 minutes to 3 minutes to reflect the reduced amount of effort.
4-18-2020 v1
…ff local system time
4/25/2020
Put |
Fix error calculating thanksgiving. Also make Halloween a week, instead of all month, and add a couple of comments.
Added commentary for formula.
This pull request introduces 1 alert when merging 2018990 into 889f657 - view on LGTM.com new alerts:
|
You need to remove the issue after the fixes too. |
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
4-25-2020 update to tip
…umentation. Linux version not tested - please test!
… and anothersimalcrum.
So... there's a reason I said to have a table of dates you import, because I don't want anyone messing with gross calendar code. |
as suggested Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
as suggested Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
unnecessary
Which gcc version? |
Summary
SUMMARY: Features "Fixes #36628, implementing use of system time for holidays"
Purpose of change
Fixes #36628, automatically setting holiday screens based on the local system date, instead of by manually updating the source code.
Reduces code churn for holiday builds, and makes holiday easter egg screens viewable for users of future stable release versions.
Describe the solution
Change current_holiday from a static const to a member variable
Implement is_easter() as a member function
Implement get_holiday_from_time() as a member function, calling is_easter
note that get_holiday_from_time() had to use preprocessor directives due to differing versions of localtime
Call get_holiday_from_time() when opening the screen
Describe alternatives you've considered
Letting someone else do it.
Testing
Set system date and checked that all holiday screens loaded All did, except that in the process, I found that the ASCII art for independence day is messed up.
Additional context
std::localtime is non-intuitive, and Easter is now least favorite holiday.