SERVER/CLIENT/MENU: Add accessibility setting for screen flashes#117
Conversation
| void() Menu_Accessibility_StoreCurrentSettings = | ||
| { | ||
| current_hitmarker = cvar("cl_hitmarkers"); | ||
| current_nukeflash = cvar("cl_nukeflashcolor"); |
There was a problem hiding this comment.
instead of nukeflash this should be a bit more generic since it will apply to all white flashes.
additionally, please use scr_ instead of cl_ for the cvar
| Menu_CvarSlider(2, [0, 1, 20], "cl_textopacity", false, false); | ||
|
|
||
| // Nuke flash color | ||
| Menu_Button(3, "ac_nukefla", "NUKE FLASH COLOR", "Choose the color of the nuke flash.") ? Menu_Accessibility_UpdateNukeFlash() : 0; |
There was a problem hiding this comment.
WHITE SCREEN FLASHES or something
| @@ -1,4 +1,4 @@ | |||
| string menu_ctrl_buttons[7] = {"cm_adsm", "cm_sens", "cm_invs", "cm_gpad", "cm_bind", "cm_apply", "cm_back"}; | |||
| string menu_ctrl_buttons[8] = {"cm_adsm", "cm_sens", "cm_invs", "cm_gpad", "cm_bind", "cm_apply", "cm_back"}; | |||
There was a problem hiding this comment.
sorry, i was originally working on something else, i guess i forgot to set that back to 7 😅
| { | ||
| // Flash the screen white | ||
| nzp_screenflash(world, SCREENFLASH_COLOR_WHITE, 1, SCREENFLASH_FADE_INANDOUT); | ||
| if (cvar("cl_nukeflashcolor") == 0) { |
There was a problem hiding this comment.
You can't do this on the server. It will only respect the hosts setting. We should be intercepting the type sent on the client side so it respects the users choice and we can do this for all white flashes
| if (cvar("cl_nukeflashcolor") == 0) { | ||
| nzp_screenflash(world, SCREENFLASH_COLOR_WHITE, 1, SCREENFLASH_FADE_INANDOUT); | ||
| } else if (cvar("cl_nukeflashcolor") == 1) { | ||
| nzp_screenflash(world, SCREENFLASH_COLOR_BLACK, 1, SCREENFLASH_FADE_INANDOUT); |
There was a problem hiding this comment.
You said you made it less intense if enabled but the duration seems the same here?
…SER & respect users preference when a white screen flash occurs
|
Finally got back around to this PR: 2025-06-15.03-02-42.mp4(Game instances on the left are both black flashes, game instances on the right are both white flashes based on user's setting). NZ:P will now respect the users screen flash preference ( Also, you should now be able to call |
|
Fixed a couple minor oopsies, but it should be all good now. |
|
To be honest I much preferred the original intent of the setting to change the behavior of white flashes to be black instead, as I commented in the original revision. Adding a new field Can you please go back to the initial idea of an accessibility setting where, when the client receives a request for a white screenflash, it displays a black one instead? |
…h black if applicable, remove SCREENFLASH_COLOR_RESPECT_USER, and make menu options accurate
yep :) sorry, 3am brain definitely make me over-complicate things lol, sorry! i'll try to consult you more on discord for future prs (or this one if needed)! nz:p will now check if the requested flash color is 2025-06-16.00-50-47.mp4(left windows are white flashes, right windows are black flashes) |
MotoLegacy
left a comment
There was a problem hiding this comment.
LGTM! Thank you for contributing this
Description of Changes
Might close nzp-team/nzportable#613, though it doesn't "disable" the nuke, it just makes the flash black and pretty transparent.
This adds a setting to the Accessibility tab to have the standard "White" flash (default), or "Black" which will be black (of course) and be mostly transparent to prevent "being flashbanged".
Visual Sample
8mb.video-09Y-LbdUTm1X.mp4
Checklist