Screenshot is taken 0.2 seconds after game ends instead of 0.8 (server-side 0.1s delay + client-side 0.1s delay)
#include <client/mapvoting.qh>
#include <common/ent_cs.qh>
#include <common/minigames/cl_minigames.qh>
+#include <client/view.qh>
// QuickMenu (#23)
bool HUD_QuickMenu_Forbidden()
{
return (mv_active
+ || intermission_time == time // close upon game over, can still be opened during intermission
|| scoreboard_ui_enabled
|| (hud_configure_prev && hud_configure_prev != -1)
|| HUD_MinigameMenu_IsOpened()
if(IS_REAL_CLIENT(this))
{
string num = strftime_s(); // strftime(false, "%s") isn't reliable, see strftime_s description
- stuffcmd(this, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; "
+ stuffcmd(this, sprintf("\ncl_autoscreenshot_screenshot %s %s; "
"echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), num));
}
return;
{
if(!e.autoscreenshot) // initial call
{
- e.autoscreenshot = time + 0.8; // used for autoscreenshot
+ e.autoscreenshot = time + 0.1;
SetResourceExplicit(e, RES_HEALTH, -2342); // health in the first intermission phase
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such"
+// cl_autoscreenshot_screenshot is called by the server when the game ends with map name and match id as parameters
+// it takes care of hiding all the UI parts that may overlap the scoredoard before taking a screenshot
seta cl_autoscreenshot 1 "Take a screenshot upon the end of a match... 0 = Disable completely, 1 = Allow sv_autoscreenshot to take a screenshot when requested, 2 = Always take an autoscreenshot anyway."
+alias _cl_autoscreenshot_save "set _con_chattime_save $con_chattime; set _hud_panel_scoreboard_fadeinspeed_save $hud_panel_scoreboard_fadeinspeed; set _menu_slowmo_save $menu_slowmo; set _scr_conheight_save $scr_conheight; set _con_textsize_save $con_textsize; set _scr_conalpha_save $scr_conalpha"
+alias _cl_autoscreenshot_set "con_chattime 0.001; hud_panel_scoreboard_fadeinspeed 999; menu_slowmo 999; scr_conheight 0; con_textsize 1; scr_conalpha 0"
+alias _cl_autoscreenshot_restore "set con_chattime $_con_chattime_save; set hud_panel_scoreboard_fadeinspeed $_hud_panel_scoreboard_fadeinspeed_save; set menu_slowmo $_menu_slowmo_save; set scr_conheight $_scr_conheight_save; set con_textsize $_con_textsize_save; set scr_conalpha $_scr_conalpha_save"
+alias cl_autoscreenshot_screenshot "togglemenu 0; -con_chat_maximize; _cl_autoscreenshot_save; _cl_autoscreenshot_set; defer 0.1 \"screenshot screenshots/autoscreenshot/${1}-${2}.jpg\"; defer 0.1 \"_cl_autoscreenshot_restore\""
seta cl_jetpack_jump 1 "Activate jetpack by pressing jump in the air. 0 = Disable, 1 = Stop when touching ground, 2 = Enable"