From: FruitieX Date: Mon, 11 Apr 2011 11:58:48 +0000 (+0300) Subject: revive the low health/armor hud effect from fruitiex/goldenhealth, also set both... X-Git-Tag: xonotic-v0.5.0~307^2^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6b87e5c9a3544877aae0dc3b67a2cf39512a9b3e;p=xonotic%2Fxonotic-data.pk3dir.git revive the low health/armor hud effect from fruitiex/goldenhealth, also set both healthmax/armormax at 200 (this determines when the status bars on the hud are full, used to be 250 and 150 so they had different scales...) --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index cd7245068..f7351e2fa 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1420,8 +1420,8 @@ seta hud_panel_weapons_ammo_full_fuel 100 "show 100% of the status bar at this a seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status bar is full" -seta hud_panel_healtharmor_maxhealth "250" "when you have this much health, the health status bar is full" -seta hud_panel_healtharmor_maxarmor "150" "when you have this much armor, the armor status bar is full" +seta hud_panel_healtharmor_maxhealth "200" "when you have this much health, the health status bar is full" +seta hud_panel_healtharmor_maxarmor "200" "when you have this much armor, the armor status bar is full" seta hud_panel_notify_time 10 "time that a new entry stays until it fades out" seta hud_panel_notify_fadetime 3 "fade out time" diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 18c18455c..37f10b884 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -89,11 +89,12 @@ void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector the vector HUD_Get_Num_Color (float x, float maxvalue) { + float blinkingamt; vector color; - if(x > maxvalue) { - color_x = 0; + if(x >= maxvalue) { + color_x = sin(2*M_PI*time); color_y = 1; - color_z = 0; + color_z = sin(2*M_PI*time); } else if(x > maxvalue * 0.75) { color_x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0 @@ -120,6 +121,14 @@ vector HUD_Get_Num_Color (float x, float maxvalue) color_y = 0; color_z = 0; } + + blinkingamt = (1 - x/maxvalue/0.25); + if(blinkingamt > 0) + { + color_x = color_x - color_x * blinkingamt * sin(2*M_PI*time); + color_y = color_y - color_y * blinkingamt * sin(2*M_PI*time); + color_z = color_z - color_z * blinkingamt * sin(2*M_PI*time); + } return color; }