From c8bf610874198f6eff943645dc5a47a950dd7893 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Thu, 7 Feb 2013 23:57:44 +0200 Subject: [PATCH] A fix to my last commit. Also set saturation to 0 when dead, for a black & white effect --- data/defaultVT.cfg | 3 ++- data/qcsrc/client/View.qc | 7 ++++++- data/qcsrc/menu/voret/dialog_settings_effects.c | 3 ++- data/qcsrc/server/cl_client.qc | 8 ++++---- docs/TODO.txt | 2 ++ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index d9e9e1c7..10c01db4 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -1189,7 +1189,8 @@ seta hud_damage_pain_threshold_pulsating_period 0.8 "one pulse every X seconds" seta hud_cartoon 0 "cartoon effect, reverses when you own a powerup, default is 1.5" seta hud_cartoon_tolerance 0.15 "where to apply the cartoon effect between bright and dark areas" -seta hud_saturation 0 "saturation changes based on the amount of armor you have" +seta hud_saturation_armor 0 "saturation changes based on the amount of armor you have" +seta hud_saturation_death 0 "black and white vision when dead" seta hud_stomach 0.75 "displays a splash on the screen when inside the stomach, value specifies alpha" seta hud_stomach_color "1 1 0" "color of the stomach screen splash" diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index 2ef46010..d42a90e4 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -970,7 +970,7 @@ void CSQC_UpdateView(float w, float h) // change saturation based on the amount of armor we have // ranges between 0.5 and 1 saturation, over 0 armor and half the armor limit - if(cvar("hud_saturation") && armor_max && spectatee_status != -1 && getstati(STAT_HEALTH) > 0) + if(cvar("hud_saturation_armor") && armor_max && spectatee_status != -1 && getstati(STAT_HEALTH) > 0) { float saturation; saturation = 0.5 + (getstati(STAT_ARMOR) / armor_max); @@ -979,6 +979,11 @@ void CSQC_UpdateView(float w, float h) if(cvar("r_glsl_saturation") != saturation) cvar_set("r_glsl_saturation", ftos(saturation)); } + else if (cvar("hud_saturation_death") && getstati(STAT_HEALTH) <= 0) + { + if(cvar("r_glsl_saturation") != 0) + cvar_set("r_glsl_saturation", "0"); + } else if(cvar("r_glsl_saturation") != 1) cvar_set("r_glsl_saturation", "1"); } diff --git a/data/qcsrc/menu/voret/dialog_settings_effects.c b/data/qcsrc/menu/voret/dialog_settings_effects.c index 1a637229..313f8a1e 100644 --- a/data/qcsrc/menu/voret/dialog_settings_effects.c +++ b/data/qcsrc/menu/voret/dialog_settings_effects.c @@ -164,7 +164,8 @@ void fillVoretEffectsSettingsTab(entity me) me.TR(me); me.TD(me, 1, 1, e = makeVoretCheckBoxEx(1.5, 0, "hud_cartoon", "Cartoon lines")); me.TD(me, 1, 1, e = makeVoretCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", "Content blur")); - me.TD(me, 1, 1, e = makeVoretCheckBox(0, "hud_saturation", "Armor saturation")); + me.TD(me, 1, 1, e = makeVoretCheckBox(0, "hud_saturation_armor", "Saturation")); + makeMulti(e, "hud_saturation_death"); me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, makeVoretCommandButton("Apply immediately", '0 0 0', "vid_restart", COMMANDBUTTON_APPLY)); diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index e996aa8a..ea0cee0d 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -2675,6 +2675,7 @@ void PlayerPreThink (void) if(frametime) { + vector glowcolor = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2; if(self.health <= 0 && cvar("g_deathglow")) { if(self.glowmod_x > 0) @@ -2693,16 +2694,15 @@ void PlayerPreThink (void) else { // set weapon and player glowmod - self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2; + self.glowmod = glowcolor; if(self.armorvalue < cvar("g_power")) self.glowmod = '-1 -1 -1'; // turn glow off when power is down else if(self.armorvalue < cvar("g_armorglow")) - self.glowmod = self.glowmod * (self.armorvalue / cvar("g_armorglow")); // glow intensity reflects armor charge + self.glowmod = glowcolor * (self.armorvalue / cvar("g_armorglow")); // glow intensity reflects armor charge } - self.weaponentity_glowmod = self.glowmod; if(cvar("g_weaponloadglow") && self.clip_size) - self.weaponentity_glowmod = self.weaponentity_glowmod * (self.clip_load / self.clip_size); // glow intensity reflects weapon load + self.weaponentity_glowmod = glowcolor * (self.clip_load / self.clip_size); // glow intensity reflects weapon load player_powerups(); } diff --git a/docs/TODO.txt b/docs/TODO.txt index d3197385..c7401f99 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -275,3 +275,5 @@ - 0.8 BUG: At startup, make a script re-set sound and music volume so they're not the last set by vore status in-game - 0.8 BUG: Normal grabber shoot seems to play melee animation on player models + +- 0.8: Rename "vore delay" to something more appropriate for the sbar rings -- 2.39.2