Repository navigation
Move NVG functionality clientside + add support for default flashlight - #374
Conversation
1upD
left a comment
There was a problem hiding this comment.
I left a few comments on this PR but none are blocking per se. I just want to make sure we go over this before I approve it.
This will be huge for mapping! I have a few maps that need this.
| void Flashlight( void ); | ||
| virtual void UpdateFlashlight( void ); | ||
| #ifdef EZ | ||
| virtual int GetFlashlightType() { return 0; } |
There was a problem hiding this comment.
I don't think it's particularly necessary for just 0 in the base class (although that comes down to personal preference)
| UTIL_PrecacheOther( "prop_command_point" ); | ||
| #endif | ||
| #ifdef EZ2 | ||
| PrecacheScriptSound( "EZ2Player.NVGOn" ); |
There was a problem hiding this comment.
The "EmitSound" call in FlashlightTurnOn uses this sound but it is within an #ifdef EZ preprocessor, not #ifdef EZ2. Should this apply for EZ1 too? Or would it only be applicable for EZ2?
There was a problem hiding this comment.
I think I set E:Z1 code to still always use the NVG by default, but I haven't tested that and I don't think the specific implementation details in E:Z1 are too relevant for this PR since we're not maintaining that in this branch. It will need other changes if we ever do use this code in E:Z1 anyway
| C_EZ2_Player *pEZ2Player = ToEZ2Player( pPlayer ); | ||
| if ( pEZ2Player->IsNVGActive() ) | ||
| { | ||
| IMaterial *pOverlayMaterial = materials->FindMaterial( "Ezero/Mask_NvMap", TEXTURE_GROUP_OTHER, true ); |
There was a problem hiding this comment.
Future comment - I wonder if we should make this texture configurable just like how the flashlight texture is
There was a problem hiding this comment.
That could be done with a cvar or networked string (or a protagonist system keyvalue) in the future
| } | ||
|
|
||
| // TODO: Should really put this in the protagonist system | ||
| ConVar sv_flashlight_cc_filename( "sv_flashlight_cc_filename", "ez2_nvg.raw", FCVAR_REPLICATED, "", OnNVGCCFileChange ); |
There was a problem hiding this comment.
Comment: It's funny that this is an sv_ convar but it's literally for the client.
I know we can't change it though because that would be breaking!
1upD
left a comment
There was a problem hiding this comment.
You addressed all the comments, so I'm comfortable moving forward with this
This PR moves NVG functionality clientside and sets up dedicated post-processing effects for it, eliminating the managed
color_correctionentity on the server, fixing conflicts withenv_screenoverlay, and preventing potential issues in multiplayer.This PR also restores support for the default flashlight, which can be controlled through new
Enable/DisableNVGinputs on the player (and onlogic_playerproxy).