con_notifysize 10\r
con_notifyalign 0\r
\r
+seta hud_contents 1 "an improved version of gl_polyblend for liquids such as water/lava/slime, draw a filler when inside the liquid"\r
+seta hud_contents_factor 1 "factor at which to multiply the current faded value."\r
+seta hud_contents_fadeintime 0.02 "factor of time it takes for the alpha level to reach normal value when entering the liquid"\r
+seta hud_contents_fadeouttime 0.1 "factor of time it takes for the alpha level to reach normal value when leaving the liquid"\r
+seta hud_contents_lava_alpha 0.7 "alpha of the lava color blend when inside it"\r
+seta hud_contents_lava_color "0.8 0.1 0" \r
+seta hud_contents_slime_alpha 0.7 "alpha of the slime color blend when inside it"\r
+seta hud_contents_slime_color "0 0.4 0.1"\r
+seta hud_contents_water_alpha 0.5 "alpha of the water color blend when inside it"\r
+seta hud_contents_water_color "0.4 0.3 0.3"\r
+\r
sbar_info_pos 50\r
seta sbar_alpha_bg 0.8 "alpha value of the HUD background"\r
seta sbar_alpha_fg 1 "alpha value of the HUD foreground items"\r
float chase_active_old;\r
float artwork_fade;\r
float pickup_crosshair_time, pickup_crosshair_size;\r
+float contentavgalpha, liquidalpha_prev;\r
+vector liquidcolor_prev;\r
string artwork_image;\r
string intermission_song;\r
string NextFrameCommand;\r
// next R_RenderScene call\r
drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);\r
\r
+ if(cvar("hud_contents"))\r
+ {\r
+ float contentalpha_temp, incontent, liquidalpha, contentfadetime;\r
+ vector liquidcolor;\r
+ \r
+ switch(pointcontents(view_origin))\r
+ {\r
+ case CONTENT_WATER:\r
+ liquidalpha = cvar("hud_contents_water_alpha");\r
+ liquidcolor = stov(cvar_string("hud_contents_water_color"));\r
+ incontent = 1;\r
+ break;\r
+ \r
+ case CONTENT_LAVA:\r
+ liquidalpha = cvar("hud_contents_lava_alpha");\r
+ liquidcolor = stov(cvar_string("hud_contents_lava_color"));\r
+ incontent = 1;\r
+ break; \r
+ \r
+ case CONTENT_SLIME:\r
+ liquidalpha = cvar("hud_contents_slime_alpha");\r
+ liquidcolor = stov(cvar_string("hud_contents_slime_color"));\r
+ incontent = 1;\r
+ break;\r
+ \r
+ default:\r
+ liquidalpha = 0;\r
+ liquidcolor = '0 0 0';\r
+ incontent = 0;\r
+ break;\r
+ }\r
+ \r
+ if(incontent) // fade in/out at different speeds so you can do e.g. instant fade when entering water and slow when leaving it.\r
+ { // also lets delcare previous values for blending properties, this way it isn't reset until after you have entered a different content\r
+ contentfadetime = cvar("hud_contents_fadeintime");\r
+ liquidalpha_prev = liquidalpha;\r
+ liquidcolor_prev = liquidcolor;\r
+ }\r
+ else\r
+ contentfadetime = cvar("hud_contents_fadeouttime");\r
+ \r
+ contentalpha_temp = bound(0, drawframetime / max(0.0001, contentfadetime), 1);\r
+ contentavgalpha = contentavgalpha * (1 - contentalpha_temp) + incontent * contentalpha_temp;\r
+ \r
+ if(contentavgalpha)\r
+ drawfill('0 0 0', '1 0 0' * vid_conwidth + '0 1 0' * vid_conheight, liquidcolor_prev, contentavgalpha * liquidalpha_prev, DRAWFLAG_NORMAL);\r
+ }\r
+\r
// Draw the mouse cursor\r
// NOTE: drawpic must happen after R_RenderScene for some reason\r
//drawpic(getmousepos(), "gfx/cursor.tga", '11 14 0', '1 1 1', 1, 0);\r