This commit is contained in:
katniny 2025-03-16 23:14:11 -06:00 committed by GitHub
commit 16dde834c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 3 deletions

View file

@ -1,8 +1,9 @@
string menu_accesibility_buttons[4] = {"ac_hitm", "ac_text", "ac_apply", "ac_back"};
string menu_accesibility_buttons[5] = {"ac_hitm", "ac_text", "ac_nukefla", "ac_apply", "ac_back"};
float menu_accessibility_init;
float current_hitmarker;
float current_nukeflash;
string(string prev_id) Menu_Accessibility_GetNextButton =
{
@ -47,6 +48,7 @@ string(string next_id) Menu_Accessibility_GetPreviousButton =
void() Menu_Accessibility_StoreCurrentSettings =
{
current_hitmarker = cvar("cl_hitmarkers");
current_nukeflash = cvar("cl_nukeflashcolor");
}
void() Menu_Accessibility_ApplySettings =
@ -68,6 +70,13 @@ void() Menu_Accessibility_UpdateHitmarkers =
cvar_set("cl_hitmarkers", ftos(current_hitmarker));
};
void() Menu_Accessibility_UpdateNukeFlash =
{
Menu_PlaySound(MENU_SND_ENTER);
current_nukeflash = !current_nukeflash;
cvar_set("cl_nukeflashcolor", ftos(current_nukeflash));
};
void() Menu_Accessibility =
{
if (!menu_accessibility_init)
@ -90,6 +99,16 @@ void() Menu_Accessibility =
Menu_Button(2, "ac_text", "TEXT BACKDROP", "Opacity of backdrop for text elements on HUD.") ? 0 : 0;
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;
string nukeflash_string = "";
switch(current_nukeflash) {
case 0: nukeflash_string = "WHITE"; break;
case 1: nukeflash_string = "BLACK"; break;
default: break;
}
Menu_DrawOptionValue(3, nukeflash_string);
Menu_DrawDivider(12.25);
Menu_Button(-2, "ac_apply", "APPLY", "Save & Apply Settings.") ? Menu_Accessibility_ApplySettings() : 0;
Menu_Button(-1, "ac_back", "BACK", "Return to Configuration Menu.") ? current_menu = MENU_OPTIONS : 0;

View file

@ -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"};
float menu_ctrl_init;

View file

@ -336,7 +336,11 @@ void() PU_NukeKill =
void() PU_Nuke =
{
// Flash the screen white
nzp_screenflash(world, SCREENFLASH_COLOR_WHITE, 1, SCREENFLASH_FADE_INANDOUT);
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);
}
// if there's already one active, just increment the point multiplier
if (nuke_powerup_active == true) {