Open XJMLN opened 2 weeks ago
Great! We can fix #2598 by checking if the underwater effect is on, maybe after this PR merged?
Currently, getCameraUnderwaterEffect
will return true only if it was enabled by setCameraUnderwaterEffectEnabled
. I don't know if this is valid; maybe I should additionally check the value of CWeather::UnderWaterness(0xC8132C)
, which is used to enable this effect and changing the weather to ID 20 while underwater. Then getCameraUnderwaterEffect
would return true in that case.
Currently,
getCameraUnderwaterEffect
will return true only if it was enabled bysetCameraUnderwaterEffectEnabled
. I don't know if this is valid; maybe I should additionally check the value ofCWeather::UnderWaterness(0xC8132C)
, which is used to enable this effect and changing the weather to ID 20 while underwater. ThengetCameraUnderwaterEffect
would return true in that case.
I think we should be able to check the effect anytime without relying on setCameraUnderwaterEffectEnabled
resetCameraUnderwaterEffect() should not this also reset darkness too
and getCameraUnderwaterEffect() should not also get the darkness level too instead of calling another function to check
Nice job! Reset effects when a player connect to a new server. please
Client functions
setCameraUnderwaterEffectEnabled(bool state)
- Enable or disable the underwater effect. This function does not affect the default diving behavior.setCameraUnderwaterEffectSpeed(float speed, float frequency)
- Change the speed and frequency of the underwater effectsetCameraUnderwaterDarkness(bool state, float maxDarknessDepth)
- Enable or disable the screen getting darker as we dive deeper underwater. We can also set the depth at which the screen goes completely dark.getCameraUnderwaterEffect() -> bool enabled, float speed, float frequency
getCameraUnderwaterDarkness() -> bool enabled, float maxDarknessDepth
resetCameraUnderwaterEffect()
- Reset the underwater effect state, speed and frequency to their default valuesresetCameraUnderwaterDarkness()
- Reset the underwater darkness effect state and maximum darkness depth to their default valuesResolves #1297