Flash Dark Mode 1.0.0 (olds.ro)
===============================
An accessibility option for players who are sensitive to bright flashes. A
player who types /darkflash sees flashbang blindness as a black screen
instead of a white one. Only the colour changes: the blind time, the hold
time and the strength stay exactly what the game sent, so a partial flash
from the side is just as partial and a full flash lasts just as long. The
option gives comfort and no advantage. The choice is saved by SteamID.
Requirements
- ReHLDS, ReGameDLL_CS, Metamod-r and ReAPI (with RegisterMessage)
- AMX Mod X 1.10 or newer with the nvault module (it ships with AMX Mod X)
- Tested on ReHLDS 3.15, ReGameDLL_CS 5.30.0.814, ReAPI 5.29.0.358 and
AMX Mod X 1.10.0.5490
Install
1. Compile scripting/olds_darkflash.sma with amxxpc 1.10 and copy
olds_darkflash.amxx to addons/amxmodx/plugins/. The compiler needs
ReAPI's include files (reapi.inc and reapi_*.inc) in
addons/amxmodx/scripting/include/.
2. Copy data/lang/olds_darkflash.txt to addons/amxmodx/data/lang/.
3. Copy configs/plugins/olds_darkflash.cfg to addons/amxmodx/configs/plugins/.
4. Add olds_darkflash.amxx to addons/amxmodx/configs/plugins.ini.
How it works
- A flashbang blinds a player with a white screen fade (colour
255 255 255). For a player with the option on, the plugin rewrites that
colour to black (0 0 0) and leaves the fade's duration, hold time, flags
and alpha untouched.
- The game sends the same fade to every spectator watching the flashed
player in first person, one message per spectator. Each receiver gets
their own colour: a spectator with the option on sees black even when
the flashed player has it off, and the other way round.
- White fades from other plugins (for example "flash" effects) turn black
in the same way, also when a plugin sends one fade to everyone: then each
player gets a copy in their own colour. Fades in any other colour are
left alone.
- The choice is saved in the nvault file olds_darkflash by SteamID and
comes back when the player joins again. Players without a unique SteamID
(STEAM_ID_LAN, bots) keep it until they leave.
Settings (addons/amxmodx/configs/plugins/olds_darkflash.cfg)
olds_darkflash_enable 1 1 = on, 0 = off (fades are left alone)
olds_darkflash_default 0 1 = the option is on for players who never
typed /darkflash, 0 = off
olds_darkflash_announce 300 seconds between chat hints about /darkflash,
sent to the players who have it off; 0 = no
hints
Commands
say /darkflash (also say_team) turns the option on or off
olds_darkflash_status (server console) the settings, then for each player
the choice, how many white fades were turned black
and the exact fade time, hold time and alpha of their
last flash (from ReAPI's PlayerBlind hook)
Files
Texts are in data/lang/olds_darkflash.txt (English). Nothing is downloaded
by players: the plugin only changes the colour of the engine's own screen
fade.
Credits and licence
Written from scratch by alexit (olds.ro workshop) for workshop card
IDEA-FA3831F0BCBA17F4.
Licence: GPL-3.0-or-later.