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

Daytime Sleeping & en_us.json Improvements #48

Merged
merged 2 commits into from
Oct 8, 2023

Conversation

Superkat32
Copy link
Contributor

@Superkat32 Superkat32 commented Oct 6, 2023

This PR does 2 main things.

  1. Adds (toggleable) day time sleeping! (Closes Add option to allow sleeping during daytime #21)
  2. Some slight improvements to en_us.json for config tooltips on larger GUI sizes(e.g. GUI size 4)

Daytime Sleeping:
Sleeping through the day to dusk is now possible. It can be optionally toggled in the config, along with some other config options for the seconds until dusk message and the night time message. For the night time message, I decided to make it "The night begins." instead of "The moon rises", as I felt like the second option would have been too obvious. However, this is easily changeable in the config. Additionally, I also renamed the "WAKE_UP_TIME" int to be "SUNRISE_WAKE_UP", as a second private static int needed to be added.

The actual daytime sleeping works by using a FabricApi method, which also works with Quilt in my quick testing. It then checks if the config option is enabled or disabled, then decides what to do from there. If enabled, it allows the user to sleep in the bed(even during the day), otherwise, it returns the vanilla action.

en_us.json Improvements:
Firstly, lots of the longer tooltips have been reduced in length to be more easily readable on larger GUI sizes. I made this its own commit so it should be easy to reverse if you don't like it. Secondly, the config title has changed from "Realistic Sleep mod config" to "Realistic Sleep Config". This helps make it seem more in line with other config titles(e.g. Video Settings, Key Binds, Mouse Settings, Mod Menu Options, etc.)

Video:
A quick video showcase of the PR. Happy Modtoberfest!

daytimeSleeping.mp4

FIX: Added missing config option en_us.json entries
REFACTOR: Updated some tooltips to be easier to read on bigger GUI sizes(notably the longer tooltips)
REFACTOR: Updated the title language entry ever so slightly
FEAT: Added a new config option to enable/disable sleeping through the day! (fixes steves-underwater-paradise#21)
FEAT: Config options to enable/disable time until dusk message
REFACTOR: Some changes on how nighttime is detected, now always using a boolean form SleepMath instead of calculating it each time it is needed
REFACTOR: Some additional changes to en_us.json
@Superkat32
Copy link
Contributor Author

I forgot to mention this earlier, but I also added missing translation keys in en_us.json for some of the config options.

@Steveplays28
Copy link
Member

Steveplays28 commented Oct 6, 2023

Hi Superkat, this PR looks really good!
I'll release this alongside other recent changes sometime this weekend.

Thanks a lot for the contribution, good luck with the rest of Modtoberfest (and beyond)!

@Steveplays28 Steveplays28 added enhancement New feature or request / improvement of existing feature translation Language/translation files modtoberfest Modtoberfest event labels Oct 6, 2023
@Superkat32
Copy link
Contributor Author

Glad you like it! It was a lot of fun to put together. Modtoberfest has challenged me to do things I never would've thought of doing, and it's been really great.

If there's anything that needs changing, I can definitely change it.

@Steveplays28 Steveplays28 merged commit 6cd8241 into steves-underwater-paradise:main Oct 8, 2023
@Steveplays28
Copy link
Member

Thanks for the contribution Superkat! I'll try to get this released today.

@Steveplays28 Steveplays28 added the waiting for release Needs to be released label Oct 8, 2023
@Superkat32
Copy link
Contributor Author

No worries! Don't feel the need to rush a release out if you don't have the time. Thanks for merging!

@Steveplays28 Steveplays28 added this to the v1.9.0 milestone Oct 15, 2023
Steveplays28 pushed a commit that referenced this pull request Oct 15, 2023
@Steveplays28 Steveplays28 removed the waiting for release Needs to be released label Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request / improvement of existing feature modtoberfest Modtoberfest event translation Language/translation files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to allow sleeping during daytime
2 participants