X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fview.qc;h=701eb9f1e7419bb5328bcdd6e0651bd94b86e1c0;hp=cbb662900214abe33a09ce04351f854dbc0be3b4;hb=6cc2d1aa115907d16ae84fb07c3fe6c3329cd9b5;hpb=c24c0ac5d2fb38c25ab33c552bf8959d0976058f diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index cbb662900..701eb9f1e 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1,31 +1,29 @@ -#include "_.qh" +#include "_all.qh" #include "announcer.qh" #include "hook.qh" #include "hud.qh" #include "hud_config.qh" #include "mapvoting.qh" -#include "noise.qh" #include "scoreboard.qh" #include "shownames.qh" -#include "target_music.qh" -#include "vehicles/vehicles.qh" -#include "waypointsprites.qh" + +#include "mutators/events.qh" #include "../common/constants.qh" #include "../common/mapinfo.qh" #include "../common/nades.qh" #include "../common/stats.qh" +#include "../common/triggers/target/music.qh" #include "../common/teams.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/cl_player.qh" #include "../warpzonelib/client.qh" #include "../warpzonelib/common.qh" -#include "../warpzonelib/mathlib.qh" entity porto; vector polyline[16]; @@ -34,7 +32,7 @@ void Porto_Draw() vector p, dir, ang, q, nextdir; float portal_number, portal1_idx; - if(activeweapon != WEP_PORTO || spectatee_status || gametype == MAPINFO_TYPE_NEXBALL) + if(activeweapon != WEP_PORTO.m_id || spectatee_status || gametype == MAPINFO_TYPE_NEXBALL) return; if(g_balance_porto_secondary) return; @@ -124,7 +122,7 @@ vector GetCurrentFov(float fov) zoomsensitivity = autocvar_cl_zoomsensitivity; zoomfactor = autocvar_cl_zoomfactor; - if(zoomfactor < 1 || zoomfactor > 16) + if(zoomfactor < 1 || zoomfactor > 30) zoomfactor = 2.5; zoomspeed = autocvar_cl_zoomspeed; if(zoomspeed >= 0) @@ -133,7 +131,8 @@ vector GetCurrentFov(float fov) zoomdir = button_zoom; if(hud == HUD_NORMAL) - if((activeweapon == WEP_VORTEX && vortex_scope) || (activeweapon == WEP_RIFLE && rifle_scope)) // do NOT use switchweapon here + if(switchweapon == activeweapon) + if((activeweapon == WEP_VORTEX.m_id && vortex_scope) || (activeweapon == WEP_RIFLE.m_id && rifle_scope)) // do NOT use switchweapon here zoomdir += button_attack2; if(spectatee_status > 0 || isdemo()) { @@ -155,7 +154,7 @@ vector GetCurrentFov(float fov) } else if(autocvar_cl_spawnzoom && zoomin_effect) { - float spawnzoomfactor = bound(1, autocvar_cl_spawnzoom_factor, 16); + float spawnzoomfactor = bound(1, autocvar_cl_spawnzoom_factor, 30); current_viewzoom += (autocvar_cl_spawnzoom_speed * (spawnzoomfactor - current_viewzoom) * drawframetime); current_viewzoom = bound(1 / spawnzoomfactor, current_viewzoom, 1); @@ -228,6 +227,15 @@ vector GetCurrentFov(float fov) return '1 0 0' * fovx + '0 1 0' * fovy; } +vector GetViewLocationFOV(float fov) +{ + float frustumy = tan(fov * M_PI / 360.0) * 0.75; + float frustumx = frustumy * vid_width / vid_height / vid_pixelheight; + float fovx = atan2(frustumx, 1) / M_PI * 360.0; + float fovy = atan2(frustumy, 1) / M_PI * 360.0; + return '1 0 0' * fovx + '0 1 0' * fovy; +} + vector GetOrthoviewFOV(vector ov_worldmin, vector ov_worldmax, vector ov_mid, vector ov_org) { float fovx, fovy; @@ -311,16 +319,16 @@ float TrueAimCheck() switch(activeweapon) // WEAPONTODO { - case WEP_TUBA: // no aim - case WEP_PORTO: // shoots from eye - case WEP_HOOK: // no trueaim - case WEP_MORTAR: // toss curve + case WEP_TUBA.m_id: // no aim + case WEP_PORTO.m_id: // shoots from eye + case WEP_HOOK.m_id: // no trueaim + case WEP_MORTAR.m_id: // toss curve return SHOTTYPE_HITWORLD; - case WEP_VORTEX: - case WEP_VAPORIZER: + case WEP_VORTEX.m_id: + case WEP_VAPORIZER.m_id: mv = MOVE_NORMAL; break; - case WEP_RIFLE: + case WEP_RIFLE.m_id: ta = trueaim_rifle; mv = MOVE_NORMAL; if(zoomscript_caught) @@ -329,19 +337,19 @@ float TrueAimCheck() return EnemyHitCheck(); } break; - case WEP_DEVASTATOR: // projectile has a size! + case WEP_DEVASTATOR.m_id: // projectile has a size! mi = '-3 -3 -3'; ma = '3 3 3'; break; - case WEP_FIREBALL: // projectile has a size! + case WEP_FIREBALL.m_id: // projectile has a size! mi = '-16 -16 -16'; ma = '16 16 16'; break; - case WEP_SEEKER: // projectile has a size! + case WEP_SEEKER.m_id: // projectile has a size! mi = '-2 -2 -2'; ma = '2 2 2'; break; - case WEP_ELECTRO: // projectile has a size! + case WEP_ELECTRO.m_id: // projectile has a size! mi = '0 0 -3'; ma = '0 0 -3'; break; @@ -396,8 +404,6 @@ const float CAMERA_CHASE = 2; float reticle_type; string reticle_image; string NextFrameCommand; -void CSQC_SPIDER_HUD(); -void CSQC_RAPTOR_HUD(); vector freeze_org, freeze_ang; entity nightvision_noise, nightvision_noise2; @@ -420,15 +426,21 @@ vector liquidcolor_prev; float eventchase_current_distance; float eventchase_running; -float WantEventchase() +bool WantEventchase() { if(autocvar_cl_orthoview) return false; if(intermission) return true; + if(self.viewloc) + return true; if(spectatee_status >= 0) { - if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_PORTO))) + if(hud != HUD_NORMAL && (autocvar_cl_eventchase_vehicle || spectatee_status > 0)) + return true; + if(MUTATOR_CALLHOOK(WantEventchase, self)) + return true; + if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_PORTO.m_id))) return true; if(autocvar_cl_eventchase_death && (getstati(STAT_HEALTH) <= 0)) { @@ -446,8 +458,6 @@ float WantEventchase() vector damage_blurpostprocess, content_blurpostprocess; -float checkfail[16]; - float unaccounted_damage = 0; void UpdateDamage() { @@ -462,7 +472,7 @@ void UpdateDamage() if (damage_dealt_time != damage_dealt_time_prev) { unaccounted_damage += unaccounted_damage_new; - dprint("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")", "\n"); + LOG_TRACE("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")", "\n"); } damage_dealt_time_prev = damage_dealt_time; @@ -479,7 +489,7 @@ void UpdateHitsound() static float hitsound_time_prev = 0; // HACK: the only way to get the arc to sound consistent with pitch shift is to ignore cl_hitsound_antispam_time - float arc_hack = activeweapon == WEP_ARC && autocvar_cl_hitsound >= 2; + float arc_hack = activeweapon == WEP_ARC.m_id && autocvar_cl_hitsound >= 2; if (arc_hack || COMPARE_INCREASING(time, hitsound_time_prev) > autocvar_cl_hitsound_antispam_time) { if (autocvar_cl_hitsound && unaccounted_damage) @@ -502,7 +512,7 @@ void UpdateHitsound() pitch_shift = mirror_value + (mirror_value - pitch_shift); } - dprint("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift), "\n"); + LOG_TRACE("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift), "\n"); // todo: avoid very long and very short sounds from wave stretching using different sound files? seems unnecessary // todo: normalize sound pressure levels? seems unnecessary @@ -532,7 +542,7 @@ void UpdateCrosshair() if(getstati(STAT_FROZEN)) drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, ((getstatf(STAT_REVIVE_PROGRESS)) ? ('0.25 0.90 1' + ('1 0 0' * getstatf(STAT_REVIVE_PROGRESS)) + ('0 1 1' * getstatf(STAT_REVIVE_PROGRESS) * -1)) : '0.25 0.90 1'), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); else if (getstatf(STAT_HEALING_ORB)>time) - drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, Nade_Color(NADE_TYPE_HEAL), autocvar_hud_colorflash_alpha*getstatf(STAT_HEALING_ORB_ALPHA), DRAWFLAG_ADDITIVE); + drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, NADE_TYPE_HEAL.m_color, autocvar_hud_colorflash_alpha*getstatf(STAT_HEALING_ORB_ALPHA), DRAWFLAG_ADDITIVE); if(!intermission) if(getstatf(STAT_NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death { @@ -550,7 +560,9 @@ void UpdateCrosshair() CSQC_common_hud(); // crosshair goes VERY LAST - if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1 && hud == HUD_NORMAL) + if(!scoreboard_active && !camera_active && intermission != 2 && + spectatee_status != -1 && hud == HUD_NORMAL && !csqcplayer.viewloc && + !HUD_MinigameMenu_IsOpened() ) { if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering return; @@ -791,6 +803,8 @@ void UpdateCrosshair() wcross_alpha_prev = wcross_alpha; wcross_color_prev = wcross_color; + MUTATOR_CALLHOOK(UpdateCrosshair); + wcross_scale *= 1 - autocvar__menu_alpha; wcross_alpha *= 1 - autocvar__menu_alpha; wcross_size = draw_getimagesize(wcross_name) * wcross_scale; @@ -826,7 +840,7 @@ void UpdateCrosshair() // handle the values - if (autocvar_crosshair_ring && activeweapon == WEP_VORTEX && vortex_charge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex + if (autocvar_crosshair_ring && activeweapon == WEP_VORTEX.m_id && vortex_charge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex { if (vortex_chargepool || use_vortex_chargepool) { use_vortex_chargepool = 1; @@ -846,14 +860,14 @@ void UpdateCrosshair() ring_rgb = wcross_color; ring_image = "gfx/crosshair_ring_nexgun.tga"; } - else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer) + else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER.m_id && minelayer_maxmines && autocvar_crosshair_ring_minelayer) { ring_value = bound(0, getstati(STAT_LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to. ring_alpha = autocvar_crosshair_ring_minelayer_alpha; ring_rgb = wcross_color; ring_image = "gfx/crosshair_ring.tga"; } - else if (activeweapon == WEP_HAGAR && getstati(STAT_HAGAR_LOAD) && autocvar_crosshair_ring_hagar) + else if (activeweapon == WEP_HAGAR.m_id && getstati(STAT_HAGAR_LOAD) && autocvar_crosshair_ring_hagar) { ring_value = bound(0, getstati(STAT_HAGAR_LOAD) / hagar_maxrockets, 1); ring_alpha = autocvar_crosshair_ring_hagar_alpha; @@ -876,12 +890,12 @@ void UpdateCrosshair() // 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_RIFLE) && (weapon_clipsize == 80)) + if ((activeweapon == WEP_RIFLE.m_id) && (weapon_clipsize == 80)) ring_image = "gfx/crosshair_ring_rifle.tga"; else ring_image = "gfx/crosshair_ring.tga"; } - else if ( autocvar_crosshair_ring && autocvar_crosshair_ring_arc && arc_heat && activeweapon == WEP_ARC ) + else if ( autocvar_crosshair_ring && autocvar_crosshair_ring_arc && arc_heat && activeweapon == WEP_ARC.m_id ) { ring_value = arc_heat; ring_alpha = (1-arc_heat)*autocvar_crosshair_ring_arc_cold_alpha + @@ -992,10 +1006,21 @@ void UpdateCrosshair() } } +bool ov_enabled; +float oldr_nearclip; +float oldr_farclip_base; +float oldr_farclip_world; +float oldr_novis; +float oldr_useportalculling; +float oldr_useinfinitefarclip; + const int BUTTON_3 = 4; const int BUTTON_4 = 8; float cl_notice_run(); float prev_myteam; +int lasthud; +float vh_notice_time; +void WaypointSprite_Load(); void CSQC_UpdateView(float w, float h) { entity e; @@ -1011,6 +1036,11 @@ void CSQC_UpdateView(float w, float h) hud = getstati(STAT_HUD); + if(hud != HUD_NORMAL && lasthud == HUD_NORMAL) + vh_notice_time = time + autocvar_cl_vehicles_notify_time; + + lasthud = hud; + if(autocvar__hud_showbinds_reload) // menu can set this one { db_close(binddb); @@ -1026,22 +1056,6 @@ void CSQC_UpdateView(float w, float h) button_attack2 = (input_buttons & BUTTON_3); button_zoom = (input_buttons & BUTTON_4); -#define CHECKFAIL_ASSERT(flag,func,parm,val) do { \ - float checkfailv = (func)(parm); \ - if (checkfailv != (val)) { \ - if (!checkfail[(flag)]) \ - localcmd(sprintf("\ncmd checkfail %s %s %d %d\n", #func, parm, val, checkfailv)); \ - checkfail[(flag)] = 1; \ - } \ -} while(0) - CHECKFAIL_ASSERT(0, cvar_type, "\{100}\{105}\{118}\{48}\{95}\{101}\{118}\{97}\{100}\{101}", 0); - CHECKFAIL_ASSERT(1, cvar_type, "\{97}\{97}\{95}\{101}\{110}\{97}\{98}\{108}\{101}", 0); - CHECKFAIL_ASSERT(2, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{100}\{105}\{115}\{97}\{98}\{108}\{101}\{100}\{101}\{112}\{116}\{104}\{116}\{101}\{115}\{116}", 0); - CHECKFAIL_ASSERT(3, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{111}\{118}\{101}\{114}\{100}\{114}\{97}\{119}", 0); - CHECKFAIL_ASSERT(4, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{108}\{105}\{103}\{104}\{116}", 0); - CHECKFAIL_ASSERT(5, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{115}\{104}\{97}\{100}\{111}\{119}\{118}\{111}\{108}\{117}\{109}\{101}\{115}", 0); - CHECKFAIL_ASSERT(6, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{111}\{118}\{101}\{114}\{100}\{114}\{97}\{119}", 0); - vf_size = getpropertyvec(VF_SIZE); vf_min = getpropertyvec(VF_MIN); vid_width = vf_size.x; @@ -1054,7 +1068,11 @@ void CSQC_UpdateView(float w, float h) CSQCPlayer_SetCamera(); - myteam = GetPlayerColor(player_localentnum - 1); + if(player_localentnum <= maxclients) // is it a client? + current_player = player_localentnum - 1; + else // then player_localentnum is the vehicle I'm driving + current_player = player_localnum; + myteam = GetPlayerColor(current_player); if(myteam != prev_myteam) { @@ -1087,18 +1105,41 @@ void CSQC_UpdateView(float w, float h) // event chase camera if(autocvar_chase_active <= 0) // greater than 0 means it's enabled manually, and this code is skipped { - if(WantEventchase()) + float vehicle_chase = (hud != HUD_NORMAL && (autocvar_cl_eventchase_vehicle || spectatee_status > 0)); + float ons_roundlost = (gametype == MAPINFO_TYPE_ONSLAUGHT && getstati(STAT_ROUNDLOST)); + entity gen = world; + + if(ons_roundlost) + { + entity e; + for(e = world; (e = find(e, classname, "onslaught_generator")); ) + { + if(e.health <= 0) + { + gen = e; + break; + } + } + if(!gen) + ons_roundlost = FALSE; // don't enforce the 3rd person camera if there is no dead generator to show + } + if(WantEventchase() || (!autocvar_cl_orthoview && ons_roundlost)) { eventchase_running = true; // make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.) vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org); + if(ons_roundlost) { current_view_origin = gen.origin; } // detect maximum viewoffset and use it - if(autocvar_cl_eventchase_viewoffset) + vector view_offset = autocvar_cl_eventchase_viewoffset; + if(vehicle_chase && autocvar_cl_eventchase_vehicle_viewoffset) { view_offset = autocvar_cl_eventchase_vehicle_viewoffset; } + if(ons_roundlost) { view_offset = autocvar_cl_eventchase_generator_viewoffset; } + + if(view_offset) { - WarpZone_TraceLine(current_view_origin, current_view_origin + autocvar_cl_eventchase_viewoffset + ('0 0 1' * autocvar_cl_eventchase_maxs.z), MOVE_WORLDONLY, self); - if(trace_fraction == 1) { current_view_origin += autocvar_cl_eventchase_viewoffset; } + WarpZone_TraceLine(current_view_origin, current_view_origin + view_offset + ('0 0 1' * autocvar_cl_eventchase_maxs.z), MOVE_WORLDONLY, self); + if(trace_fraction == 1) { current_view_origin += view_offset; } else { current_view_origin.z += max(0, (trace_endpos.z - current_view_origin.z) - autocvar_cl_eventchase_maxs.z); } } @@ -1108,10 +1149,14 @@ void CSQC_UpdateView(float w, float h) if(!autocvar_chase_active) { cvar_set("chase_active", "-1"); } // make the camera smooth back - if(autocvar_cl_eventchase_speed && eventchase_current_distance < autocvar_cl_eventchase_distance) - eventchase_current_distance += autocvar_cl_eventchase_speed * (autocvar_cl_eventchase_distance - eventchase_current_distance) * frametime; // slow down the further we get - else if(eventchase_current_distance != autocvar_cl_eventchase_distance) - eventchase_current_distance = autocvar_cl_eventchase_distance; + float chase_distance = autocvar_cl_eventchase_distance; + if(vehicle_chase && autocvar_cl_eventchase_vehicle_distance) { chase_distance = autocvar_cl_eventchase_vehicle_distance; } + if(ons_roundlost) { chase_distance = autocvar_cl_eventchase_generator_distance; } + + if(autocvar_cl_eventchase_speed && eventchase_current_distance < chase_distance) + eventchase_current_distance += autocvar_cl_eventchase_speed * (chase_distance - eventchase_current_distance) * frametime; // slow down the further we get + else if(eventchase_current_distance != chase_distance) + eventchase_current_distance = chase_distance; makevectors(view_angles); @@ -1119,6 +1164,7 @@ void CSQC_UpdateView(float w, float h) WarpZone_TraceBox(current_view_origin, autocvar_cl_eventchase_mins, autocvar_cl_eventchase_maxs, eventchase_target_origin, MOVE_WORLDONLY, self); // If the boxtrace fails, revert back to line tracing. + if(!self.viewloc) if(trace_startsolid) { eventchase_target_origin = (current_view_origin - (v_forward * eventchase_current_distance)); @@ -1127,7 +1173,8 @@ void CSQC_UpdateView(float w, float h) } else { setproperty(VF_ORIGIN, trace_endpos); } - setproperty(VF_ANGLES, WarpZone_TransformVAngles(WarpZone_trace_transform, view_angles)); + if(!self.viewloc) + setproperty(VF_ANGLES, WarpZone_TransformVAngles(WarpZone_trace_transform, view_angles)); } else if(autocvar_chase_active < 0) // time to disable chase_active if it was set by this code { @@ -1145,7 +1192,7 @@ void CSQC_UpdateView(float w, float h) } // do lockview after event chase camera so that it still applies whenever necessary. - if(autocvar_cl_lockview || (!autocvar_hud_cursormode && (autocvar__hud_configure && spectatee_status <= 0 || intermission > 1))) + if(autocvar_cl_lockview || (!autocvar_hud_cursormode && (autocvar__hud_configure && spectatee_status <= 0 || intermission > 1 || QuickMenu_IsOpened()))) { setproperty(VF_ORIGIN, freeze_org); setproperty(VF_ANGLES, freeze_ang); @@ -1193,6 +1240,16 @@ void CSQC_UpdateView(float w, float h) if((dist = vlen(vec3(ov_worldmax.x, ov_worldmin.y, ov_worldmax.z) - ov_org)) > ov_furthest) { ov_furthest = dist; } if((dist = vlen(vec3(ov_worldmax.x, ov_worldmax.y, ov_worldmax.z) - ov_org)) > ov_furthest) { ov_furthest = dist; } + if(!ov_enabled) + { + oldr_nearclip = cvar("r_nearclip"); + oldr_farclip_base = cvar("r_farclip_base"); + oldr_farclip_world = cvar("r_farclip_world"); + oldr_novis = cvar("r_novis"); + oldr_useportalculling = cvar("r_useportalculling"); + oldr_useinfinitefarclip = cvar("r_useinfinitefarclip"); + } + cvar_settemp("r_nearclip", ftos(ov_nearest)); cvar_settemp("r_farclip_base", ftos(ov_furthest)); cvar_settemp("r_farclip_world", "0"); @@ -1203,8 +1260,10 @@ void CSQC_UpdateView(float w, float h) setproperty(VF_ORIGIN, ov_org); setproperty(VF_ANGLES, '90 0 0'); + ov_enabled = true; + #if 0 - printf("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n", + LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n", vtos(ov_org), vtos(getpropertyvec(VF_ANGLES)), ov_distance, @@ -1212,6 +1271,19 @@ void CSQC_UpdateView(float w, float h) ov_furthest); #endif } + else + { + if(ov_enabled) + { + cvar_set("r_nearclip", ftos(oldr_nearclip)); + cvar_set("r_farclip_base", ftos(oldr_farclip_base)); + cvar_set("r_farclip_world", ftos(oldr_farclip_world)); + cvar_set("r_novis", ftos(oldr_novis)); + cvar_set("r_useportalculling", ftos(oldr_useportalculling)); + cvar_set("r_useinfinitefarclip", ftos(oldr_useinfinitefarclip)); + } + ov_enabled = false; + } // Render the Scene view_origin = getpropertyvec(VF_ORIGIN); @@ -1349,6 +1421,7 @@ void CSQC_UpdateView(float w, float h) vid_pixelheight = autocvar_vid_pixelheight; if(autocvar_cl_orthoview) { setproperty(VF_FOV, GetOrthoviewFOV(ov_worldmin, ov_worldmax, ov_mid, ov_org)); } + else if(csqcplayer.viewloc) { setproperty(VF_FOV, GetViewLocationFOV(110)); } // enforce 110 fov, so things dont look odd else { setproperty(VF_FOV, GetCurrentFov(fov)); } // Camera for demo playback @@ -1780,20 +1853,18 @@ void CSQC_UpdateView(float w, float h) if(autocvar__hud_configure) HUD_Panel_Mouse(); + else if ( HUD_MinigameMenu_IsOpened() || minigame_isactive() ) + HUD_Minigame_Mouse(); + else if(QuickMenu_IsOpened()) + QuickMenu_Mouse(); + else + HUD_Radar_Mouse(); if(hud && !intermission) - { - if(hud == HUD_SPIDERBOT) - CSQC_SPIDER_HUD(); - else if(hud == HUD_WAKIZASHI) - CSQC_WAKIZASHI_HUD(); - else if(hud == HUD_RAPTOR) - CSQC_RAPTOR_HUD(); - else if(hud == HUD_BUMBLEBEE) - CSQC_BUMBLE_HUD(); - else if(hud == HUD_BUMBLEBEE_GUN) - CSQC_BUMBLE_GUN_HUD(); - } + if(hud == HUD_BUMBLEBEE_GUN) + CSQC_BUMBLE_GUN_HUD(); + else + VEH_ACTION(hud, VR_HUD); cl_notice_run(); @@ -1811,13 +1882,9 @@ void CSQC_common_hud(void) HUD_Main(); // always run these functions for alpha checks HUD_DrawScoreboard(); - if (scoreboard_active) // scoreboard/accuracy - HUD_Reset(); - else if (intermission == 2) // map voting screen - { - MapVote_Draw(); + // scoreboard/accuracy, map/gametype voting screen + if (scoreboard_active || intermission == 2) HUD_Reset(); - } }