X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2FView.qc;h=f994645873866646bed118fc93235cb14a1a9d8a;hb=93eaab4d4fff741e5bd15c9b9c31562eafd5896c;hp=eeccc2bf18c0fd12c751f826e67cef2392520a71;hpb=a6e0e3a6df6fcac049b3d3cd2b0c8f7fdb3950d7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index eeccc2bf1..f99464587 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -381,6 +381,7 @@ void CSQC_UpdateView(float w, float h) vid_height = vf_size_y; vector reticle_pos, reticle_size; + vector splash_pos, splash_size; WaypointSprite_Load(); @@ -644,33 +645,36 @@ void CSQC_UpdateView(float w, float h) else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_SNIPERRIFLE && button_attack2) reticle_type = 2; // nex zoom - if(autocvar_cl_reticle_stretch) + if (reticle_type) { - reticle_size_x = vid_conwidth; - reticle_size_y = vid_conheight; - reticle_pos_x = 0; - reticle_pos_y = 0; - } - else - { - reticle_size_x = max(vid_conwidth, vid_conheight); - reticle_size_y = max(vid_conwidth, vid_conheight); - reticle_pos_x = (vid_conwidth - reticle_size_x) / 2; - reticle_pos_y = (vid_conheight - reticle_size_y) / 2; - } + if(autocvar_cl_reticle_stretch) + { + reticle_size_x = vid_conwidth; + reticle_size_y = vid_conheight; + reticle_pos_x = 0; + reticle_pos_y = 0; + } + else + { + reticle_size_x = max(vid_conwidth, vid_conheight); + reticle_size_y = max(vid_conwidth, vid_conheight); + reticle_pos_x = (vid_conwidth - reticle_size_x) / 2; + reticle_pos_y = (vid_conheight - reticle_size_y) / 2; + } - f = current_zoomfraction; - if(zoomscript_caught) - f = 1; - if(autocvar_cl_reticle_item_normal) - { - if(reticle_type == 1 && f) - drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_normal, DRAWFLAG_NORMAL); - } - if(autocvar_cl_reticle_item_nex) - { - if(reticle_type == 2 && f) - drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_nex, DRAWFLAG_NORMAL); + f = current_zoomfraction; + if(zoomscript_caught) + f = 1; + if(autocvar_cl_reticle_item_normal) + { + if(reticle_type == 1 && f) + drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_normal, DRAWFLAG_NORMAL); + } + if(autocvar_cl_reticle_item_nex) + { + if(reticle_type == 2 && f) + drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_nex, DRAWFLAG_NORMAL); + } } @@ -726,6 +730,11 @@ void CSQC_UpdateView(float w, float h) if(autocvar_hud_damage) { + splash_size_x = max(vid_conwidth, vid_conheight); + splash_size_y = max(vid_conwidth, vid_conheight); + splash_pos_x = (vid_conwidth - splash_size_x) / 2; + splash_pos_y = (vid_conheight - splash_size_y) / 2; + float myhealth_flash_temp; myhealth = getstati(STAT_HEALTH); @@ -782,7 +791,7 @@ void CSQC_UpdateView(float w, float h) drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL); } else - drawpic(reticle_pos, "gfx/blood", reticle_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL); + drawpic(splash_pos, "gfx/blood", splash_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL); } // Draw the mouse cursor @@ -1065,7 +1074,7 @@ void CSQC_UpdateView(float w, float h) wcross_size = drawgetimagesize(wcross_name) * wcross_scale; // crosshair rings for weapon stats - if (autocvar_crosshair_ring) + if ((autocvar_crosshair_ring) || (autocvar_crosshair_ring_reload)) { // declarations and stats float ring_value, ring_scale, ring_alpha, ring_inner_value, ring_inner_alpha; @@ -1098,9 +1107,9 @@ void CSQC_UpdateView(float w, float h) } ring_inner_alpha = wcross_alpha * autocvar_crosshair_ring_nex_inner_alpha; - ring_inner_image = "gfx/crosshair_ring_inner.tga"; ring_inner_rgb = eX * autocvar_crosshair_ring_nex_inner_color_red + eY * autocvar_crosshair_ring_nex_inner_color_green + eZ * autocvar_crosshair_ring_nex_inner_color_blue; - + ring_inner_image = "gfx/crosshair_ring_inner.tga"; + // draw the outer ring to show the current charge of the weapon ring_value = nex_charge; ring_alpha = wcross_alpha * autocvar_crosshair_ring_nex_alpha; @@ -1117,20 +1126,32 @@ void CSQC_UpdateView(float w, float h) if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring { - ring_value = bound(0, weapon_clipload / weapon_clipsize, 1); - ring_scale = autocvar_crosshair_ring_reload_size; - ring_alpha = autocvar_crosshair_ring_reload_alpha; - ring_rgb = wcross_color; - - // Note: This is to stop Taoki from complaining that the image doesn't match all potential balances. - // if a new image for another weapon is added, add the code (and its respective file/value) here - if ((activeweapon == WEP_SNIPERRIFLE) && (weapon_clipsize == 8)) - ring_image = "gfx/crosshair_ring_sniperrifle.tga"; + // if the main ring is already used by another weapon, instead use the inner one for ammo. + // inner ring is secondary anyway and doesn't matter as much as main ring, so overriding it is no issue. + if(ring_value && autocvar_crosshair_ring_reload_inner) + { + ring_inner_value = bound(0, weapon_clipload / weapon_clipsize, 1); + ring_inner_alpha = autocvar_crosshair_ring_reload_alpha; + ring_inner_rgb = wcross_color; + ring_inner_image = "gfx/crosshair_ring_inner.tga"; + } else - ring_image = "gfx/crosshair_ring.tga"; + { + ring_value = bound(0, weapon_clipload / weapon_clipsize, 1); + ring_scale = autocvar_crosshair_ring_reload_size; + ring_alpha = autocvar_crosshair_ring_reload_alpha; + ring_rgb = wcross_color; + + // Note: This is to stop Taoki from complaining that the image doesn't match all potential balances. + // if a new image for another weapon is added, add the code (and its respective file/value) here + if ((activeweapon == WEP_SNIPERRIFLE) && (weapon_clipsize == 80)) + ring_image = "gfx/crosshair_ring_sniperrifle.tga"; + else + ring_image = "gfx/crosshair_ring.tga"; + } } - if (autocvar_crosshair_ring_inner && ring_inner_value) // lets draw a ring inside a ring so you can ring while you ring + if ((autocvar_crosshair_ring_inner || autocvar_crosshair_ring_reload_inner) && ring_inner_value) // lets draw a ring inside a ring so you can ring while you ring DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, ring_inner_image, ring_inner_value, ring_inner_rgb, ring_inner_alpha, DRAWFLAG_ADDITIVE); if (ring_value)