#include "hud/panel/scoreboard.qh"
#include "hud/panel/quickmenu.qh"
-#include "mutators/events.qh"
+#include <client/mutators/_mod.qh>
#include <common/animdecide.qh>
#include <common/deathtypes/all.qh>
#include <common/anim.qh>
#include <common/constants.qh>
#include <common/net_linked.qh>
+#include <common/net_notice.qh>
#include <common/debug.qh>
#include <common/mapinfo.qh>
#include <common/gamemodes/_mod.qh>
#include <common/physics/player.qh>
#include <common/stats.qh>
-#include <common/triggers/target/music.qh>
+#include <common/mapobjects/target/music.qh>
#include <common/teams.qh>
#include <common/wepent.qh>
#include <common/vehicles/all.qh>
#include <common/weapons/_all.qh>
#include <common/mutators/mutator/overkill/oknex.qh>
+#include <common/mutators/mutator/waypoints/all.qh>
#include <common/viewloc.qh>
-#include <common/triggers/trigger/viewloc.qh>
+#include <common/mapobjects/trigger/viewloc.qh>
#include <common/minigames/cl_minigames.qh>
#include <common/minigames/cl_minigames_hud.qh>
showfps_prevfps_time = currentTime; // we must initialize it to avoid an instant low frame sending
}
-void Porto_Draw(entity this);
STATIC_INIT(Porto)
{
entity e = new_pure(porto);
if(zoomfactor < 1 || zoomfactor > 30)
zoomfactor = 2.5;
zoomspeed = autocvar_cl_zoomspeed;
- if(zoomspeed >= 0)
- if(zoomspeed < 0.5 || zoomspeed > 16)
- zoomspeed = 3.5;
+ if (zoomspeed >= 0 && (zoomspeed < 0.5 || zoomspeed > 16))
+ zoomspeed = 3.5;
zoomdir = button_zoom;
if(zoomdir) { zoomin_effect = 0; }
- if(camera_active)
+ if (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2)
+ {
+ current_viewzoom = 1;
+ }
+ else if (camera_active)
{
current_viewzoom = min(1, current_viewzoom + drawframetime);
}
if(autocvar_cl_velocityzoom_enabled && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too
{
- if(intermission) { curspeed = 0; }
+ if (intermission || (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2))
+ curspeed = 0;
else
{
-
makevectors(view_angles);
v = pmove_vel;
if(csqcplayer)
return SHOTTYPE_HITWORLD;
}
-void PostInit();
-void CSQC_Demo_Camera();
float camera_mode;
const float CAMERA_FREE = 1;
const float CAMERA_CHASE = 2;
//draw_cursor(viewloc_mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
}
+float mouse_over_panel;
+void HUD_Draw_Mouse()
+{
+ float cursor_alpha = 1 - autocvar__menu_alpha;
+ if(!mouse_over_panel)
+ draw_cursor_normal(mousepos, '1 1 1', cursor_alpha);
+ else if(mouse_over_panel == 1)
+ draw_cursor(mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
+ else if(mouse_over_panel == 2)
+ draw_cursor(mousepos, '0.5 0.5 0', "/cursor_resize", '1 1 1', cursor_alpha);
+ else
+ draw_cursor(mousepos, '0.5 0.5 0', "/cursor_resize2", '1 1 1', cursor_alpha);
+}
+
+void HUD_Mouse(entity player)
+{
+ if(autocvar__menu_alpha == 1)
+ return;
+
+ if(!HUD_WouldShowCursor())
+ {
+ if(player.viewloc && (player.viewloc.spawnflags & VIEWLOC_FREEAIM))
+ ViewLocation_Mouse(); // NOTE: doesn't use cursormode
+ return;
+ }
+
+ if(!autocvar_hud_cursormode)
+ update_mousepos();
+
+ if(autocvar__hud_configure)
+ HUD_Panel_Mouse();
+ else
+ {
+ if (HUD_MinigameMenu_IsOpened() || active_minigame)
+ HUD_Minigame_Mouse();
+ if (QuickMenu_IsOpened())
+ QuickMenu_Mouse();
+ if (HUD_Radar_Clickable())
+ HUD_Radar_Mouse();
+ }
+
+ prevMouseClicked = mouseClicked;
+
+ HUD_Draw_Mouse();
+}
+
bool ov_enabled;
float oldr_nearclip;
float oldr_farclip_base;
float oldr_useportalculling;
float oldr_useinfinitefarclip;
-void cl_notice_run();
-
float prev_myteam;
int lasthud;
float vh_notice_time;
-void WaypointSprite_Load();
void CSQC_UpdateView(entity this, float w, float h)
{
- TC(int, w); TC(int, h);
+ TC(int, w); TC(int, h);
entity e;
float fov;
float f;
IL_EACH(g_drawables, it.draw, it.draw(it));
- addentities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS);
+ addentities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS); // TODO: .health is used in cl_deathfade (a feature we have turned off currently)
renderscene();
// now switch to 2D drawing mode by calling a 2D drawing function
cvar_set("vid_conheight", h0);
}
- if(autocvar__hud_configure)
- HUD_Panel_Mouse();
- else if (HUD_MinigameMenu_IsOpened() || active_minigame)
- HUD_Minigame_Mouse();
- else if(QuickMenu_IsOpened())
- QuickMenu_Mouse();
- else if(local_player.viewloc && (local_player.viewloc.spawnflags & VIEWLOC_FREEAIM))
- ViewLocation_Mouse(); // NOTE: doesn't use cursormode
- else
- HUD_Radar_Mouse();
+ HUD_Mouse(local_player);
cl_notice_run();
unpause_update();