else
setsensitivityscale(1);
- if(autocvar_cl_velocityzoom_enabled && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too
+ if(autocvar_cl_velocityzoom_enabled && autocvar_cl_velocityzoom_type && !autocvar_cl_lockview) // _type = 0 disables velocity zoom too
{
if (intermission || (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2))
curspeed = 0;
{
if(hud != HUD_BUMBLEBEE_GUN)
{
- Vehicle info = Vehicles_from(hud);
+ Vehicle info = REGISTRY_GET(Vehicles, hud);
vehicle_viewdist = info.height;
vehicle_viewofs = info.view_ofs;
if(vehicle_viewdist < 0) // when set below 0, this vehicle doesn't use third person view (gunner slots)
{
if(hud != HUD_BUMBLEBEE_GUN)
{
- Vehicle info = Vehicles_from(hud);
+ Vehicle info = REGISTRY_GET(Vehicles, hud);
info.vr_crosshair(info, this);
}
}
void HUD_Crosshair(entity this)
{
+ // reset player's alpha here upon death since forced scoreboard prevents running the crosshair_chase code
+ if(autocvar_chase_active > 0 && autocvar_crosshair_chase && STAT(HEALTH) <= 0 && csqcplayer)
+ csqcplayer.alpha = csqcplayer.m_alpha;
+
float f, i, j;
vector v;
- if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) &&
- spectatee_status != -1 && (!csqcplayer.viewloc || (!spectatee_status && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))) && !MUTATOR_CALLHOOK(DrawCrosshair) &&
- !HUD_MinigameMenu_IsOpened() )
+ if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) && !autocvar_cl_lockview
+ && spectatee_status != -1 && (!csqcplayer.viewloc || (!spectatee_status && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))) && !MUTATOR_CALLHOOK(DrawCrosshair)
+ && !HUD_MinigameMenu_IsOpened())
{
if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering
return;
{
traceline(view_origin, view_origin + max_shot_distance * view_forward, MOVE_NORMAL, NULL);
float myalpha = (!csqcplayer.m_alpha) ? 1 : csqcplayer.m_alpha;
- if(trace_ent == csqcplayer && STAT(HEALTH) > 0)
+ if(trace_ent == csqcplayer)
csqcplayer.alpha = min(autocvar_crosshair_chase_playeralpha, myalpha);
else
csqcplayer.alpha = csqcplayer.m_alpha;
string wcross_name = "";
float wcross_scale, wcross_blur;
- entity e = WEP_Null;
+ entity e = WEP_Null;
if(autocvar_crosshair_per_weapon || (autocvar_crosshair_color_special == 1))
{
entity wepent = viewmodels[0]; // TODO: unhardcode
}
if (autocvar_crosshair_ring_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, wcross_alpha * ring_inner_alpha, DRAWFLAG_ADDITIVE);
+ DrawCircleClippedPic(wcross_origin, wcross_size.x * wcross_resolution * ring_scale, ring_inner_image, ring_inner_value, ring_inner_rgb, wcross_alpha * ring_inner_alpha, DRAWFLAG_ADDITIVE);
if (ring_value)
- DrawCircleClippedPic(wcross_origin, wcross_size.x * ring_scale, ring_image, ring_value, ring_rgb, wcross_alpha * ring_alpha, DRAWFLAG_ADDITIVE);
+ DrawCircleClippedPic(wcross_origin, wcross_size.x * wcross_resolution * ring_scale, ring_image, ring_value, ring_rgb, wcross_alpha * ring_alpha, DRAWFLAG_ADDITIVE);
}
#define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
{
slot.x = bound(0, (random() * vid_conwidth + 1), vid_conwidth);
slot.y = 1; // start it off 0 so we can use it
- slot.z = floor(random() * Weapons_MAX);
+ slot.z = floor(random() * REGISTRY_MAX(Weapons));
sc_spawntime = time + bound(0.4, random(), 0.75); // prevent spawning another one for this amount of time!
vector newcolor = randomvec() * 2;
newcolor.x = bound(0.4, newcolor.x, 1);
vector splash_size = '0 0 0';
splash_size.x = max(vid_conwidth, vid_conheight) * SPECIALCOMMAND_SIZE;
splash_size.y = max(vid_conwidth, vid_conheight) * SPECIALCOMMAND_SIZE;
- entity wep = Weapons_from(slot.z);
+ entity wep = REGISTRY_GET(Weapons, slot.z);
if(wep == WEP_Null)
drawpic(vec2(slot), "gfx/smile", vec2(splash_size), specialcommand_colors[j], 0.95, DRAWFLAG_NORMAL);
else
viewloc_mousepos.y = bound(0, viewloc_mousepos.y, vid_conheight);
//float cursor_alpha = 1 - autocvar__menu_alpha;
+ //cursor_type = CURSOR_NORMAL;
//draw_cursor(viewloc_mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
}
if(!autocvar_hud_cursormode)
update_mousepos();
+ cursor_type = CURSOR_NORMAL;
if(autocvar__hud_configure)
HUD_Panel_Mouse();
else
void View_Lock()
{
- if(autocvar_cl_lockview || (!autocvar_hud_cursormode && (autocvar__hud_configure && spectatee_status <= 0 || intermission > 1 || QuickMenu_IsOpened())))
- {
+ int lock_type = (!autocvar_hud_cursormode && (autocvar__hud_configure && spectatee_status <= 0 || intermission > 1 || QuickMenu_IsOpened()));
+ if (lock_type == 0)
+ lock_type = autocvar_cl_lockview;
+
+ // lock_type 1: lock origin and angles
+ // lock_type 2: lock only origin
+ if(lock_type >= 1)
setproperty(VF_ORIGIN, freeze_org);
- setproperty(VF_ANGLES, freeze_ang);
- }
else
- {
freeze_org = getpropertyvec(VF_ORIGIN);
+ if(lock_type == 1)
+ setproperty(VF_ANGLES, freeze_ang);
+ else
freeze_ang = getpropertyvec(VF_ANGLES);
- }
}
void View_DemoCamera()