-
-
Couldn't load subscription status.
- Fork 496
Add new functions related to underwater effects #3463
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
Conversation
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,
getCameraUnderwaterEffectwill 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. ThengetCameraUnderwaterEffectwould 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
Good job, but please address the requested changed
YSAFE
commented
Jan 20, 2025
Bump?
can you fix the build @XJMLN
D:\a\mtasa-blue\mtasa-blue\Client\multiplayer_sa\CMultiplayerSA.h(260,10): error C3668: 'CMultiplayerSA::SetUnderwaterEffectEnabled': method with override specifier 'override' did not override any base class methods [D:\a\mtasa-blue\mtasa-blue\Build\Multiplayer SA.vcxproj]
D:\a\mtasa-blue\mtasa-blue\Client\multiplayer_sa\CMultiplayerSA.h(261,10): error C3668: 'CMultiplayerSA::SetUnderwaterEffectSpeed': method with override specifier 'override' did not override any base class methods [D:\a\mtasa-blue\mtasa-blue\Build\Multiplayer SA.vcxproj]
"D:\a\mtasa-blue\mtasa-blue\Build\MTASA.sln" (default target) (1) ->
"D:\a\mtasa-blue\mtasa-blue\Build\Client Deathmatch.vcxproj" (default target) (18) ->
D:\a\mtasa-blue\mtasa-blue\Client\mods\deathmatch\logic\luadefs\CLuaCameraDefs.cpp(509,22): error C2511: 'bool CLuaCameraDefs::SetCameraUnderwaterEffectSpeed(float,std::optional<float>)': overloaded member function not found in 'CLuaCameraDefs' [D:\a\mtasa-blue\mtasa-blue\Build\Client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incompatible with the declaration given in the header: static bool SetCameraUnderwaterEffectSpeed(float speed, float frequency);
@XJMLN Please, fix the project build.
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 frequencygetCameraUnderwaterDarkness() -> bool enabled, float maxDarknessDepthresetCameraUnderwaterEffect()- 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