Sakorona / SDVMods

A collection of mods for Stardew Valley
Other
22 stars 21 forks source link

Calculate fog fade in/out using the ShowLighterFog target alpha when enabled #85

Closed floatingatoll closed 4 years ago

floatingatoll commented 4 years ago

When ShowLighterFog is enabled in config.json, the default fog target alpha of 100% opacity is replaced with either 20% (if it's raining) or else 30%.

However, the fog fade in/out still assumes that it's fading to/from 100%, which causes a bright white flash when the fog fades out during the day (as the fade jumps from 20/30% to 100% in order to fade to 0%).

This untested pull request moves the 'target alpha' logic into a central location and then updates the fog fade in/out logic to multiply by the target opacity. (I hesitated to just call GetWeather 3000 times in 3 seconds in the fade loops, but if that's cheap/free/performs-well, that would be a simpler patch.)

I don't know how to recompile all of this to test it myself but I wanted to share the bug report and possible approach to fixing it. There might be a better/simpler/etc. way to do it or a reason not to do it, in which case I defer to your judgement :)

Thanks for the weather mod. Be well.

Sakorona commented 4 years ago

Hm. That makes sense, explains a bit about why I saw a flash every now and then. Merging it.

floatingatoll commented 4 years ago

Cheers! I hope it works :)