Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Guillaume.Chanel
XonoticLoggingFiles
Commits
c51e07ac
Commit
c51e07ac
authored
Jan 06, 2020
by
Guillaume.Chanel
Browse files
Merge branch 'updateBase' into 'master'
updated base source files from xonotic official repository See merge request
!1
parents
932f7885
9462b11f
Changes
625
Expand all
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
c51e07ac
...
...
@@ -3,6 +3,11 @@
To use this logging system just replace the original qcsrc folder in:
xonotic
\d
ata
\x
onotic-data.pk3dir
\q
csrc with the one in this repository.
To enable the event logging, edit the file data/xonotic-data.pk3dir/xonotic-server.cfg as follows:
set sv_eventlog 1
qcsrc/server/miscfunctions.qc contains support for LSL, it is commented out by default
# Code Reference For Parsing
This is a reference for the logging codes we obtain from Xonotic just to make sure once analysing the markers everything is correct.
...
...
@@ -106,4 +111,21 @@ Example
3 = Shotgun Ammo
4 = Machine Gun Ammo
5 = Mortar / Devastator Ammo
6 = Electro / Crylink / Vortex (Sniper) Ammo
\ No newline at end of file
6 = Electro / Crylink / Vortex (Sniper) Ammo
# Notes
This code has been edited from https://gitlab.com/xonotic/xonotic-data.pk3dir repository at revision
`d4bf1b512a56e647007f5a35d68613b5b1121dd3`
.
Below are the changes made by UniGe:
Modified files:
server/client.qc
qcsrc/server/g_damage.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/resources.qc
qcsrc/server/weapons/common.qc
qcsrc/server/weapons/weaponsystem.qc
New files:
qcsrc/server/liblsl64.dll
qcsrc/server/lsl_c.qh
\ No newline at end of file
qcsrc/.gitignore
View file @
c51e07ac
/html/
/*.pk3
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
qcsrc/Makefile
View file @
c51e07ac
...
...
@@ -93,8 +93,8 @@ pk3: csprogs-$(VER).pk3
$(
eval
DAT
=
$(PROG)
-
$(VER)
.dat
)
$(
eval
LNO
=
$(PROG)
-
$(VER)
.lno
)
@
echo
"http://xonotic.org"
>
$(TXT)
@
ln
-f
$(PROGS_OUT)
/
$(PROG)
.dat
$(DAT)
@
ln
-f
$(PROGS_OUT)
/
$(PROG)
.lno
$(LNO)
@
cp
-f
$(PROGS_OUT)
/
$(PROG)
.dat
$(DAT)
@
cp
-f
$(PROGS_OUT)
/
$(PROG)
.lno
$(LNO)
@
$(RM)
*
.pk3
$(ZIP)
$(PK3)
$(TXT)
$(DAT)
$(LNO)
@
$(RM)
$(TXT)
$(DAT)
$(LNO)
...
...
qcsrc/client/announcer.qc
View file @
c51e07ac
...
...
@@ -115,7 +115,7 @@ void Announcer_Gamestart()
previous_game_starttime = startTime;
}
#define ANNOUNCER_CHECKMINUTE(minute) MACRO_BEGIN
{
\
#define ANNOUNCER_CHECKMINUTE(minute) MACRO_BEGIN \
if(announcer_##minute##min) { \
if(timeleft > minute * 60) \
announcer_##minute##min = false; \
...
...
@@ -125,7 +125,7 @@ void Announcer_Gamestart()
Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_##minute); \
} \
} \
}
MACRO_END
MACRO_END
void Announcer_Time()
{
...
...
qcsrc/client/autocvars.qh
View file @
c51e07ac
...
...
@@ -25,7 +25,6 @@ float autocvar_cl_announcer_antispam = 2;
float autocvar_cl_announcer_maptime = 3;
bool autocvar_cl_autodemo_delete;
bool autocvar_cl_autodemo_delete_keeprecords;
bool autocvar_cl_casings;
float autocvar_cl_casings_bronze_time;
int autocvar_cl_casings_maxcount = 100;
float autocvar_cl_casings_shell_time;
...
...
@@ -39,13 +38,13 @@ float autocvar_cl_effects_lightningarc_drift_end;
float autocvar_cl_effects_lightningarc_drift_start;
float autocvar_cl_effects_lightningarc_segmentlength;
bool autocvar_cl_effects_lightningarc_simple;
int
autocvar_cl_gentle;
bool
autocvar_cl_gentle;
int autocvar_cl_gentle_damage;
int autocvar_cl_gentle_gibs;
int autocvar_cl_gentle_messages;
float autocvar_cl_gibs_damageforcescale = 3.5;
float autocvar_cl_gibs_lifetime = 14;
floa
t autocvar_cl_gibs_maxcount = 100;
in
t autocvar_cl_gibs_maxcount = 100;
bool autocvar_cl_gibs_sloppy = 1;
float autocvar_cl_gibs_ticrate = 0.1;
float autocvar_cl_gibs_velocity_random = 1;
...
...
@@ -71,13 +70,13 @@ bool autocvar_cl_spawn_event_particles;
bool autocvar_cl_spawn_event_sound = 1;
// float autocvar_cl_spawn_point_model;
bool autocvar_cl_spawn_point_particles;
float autocvar_cl_spawn_point_dist_min =
12
00;
float autocvar_cl_spawn_point_dist_max = 1
6
00;
float autocvar_cl_spawn_point_dist_min =
8
00;
float autocvar_cl_spawn_point_dist_max = 1
2
00;
bool autocvar_cl_spawnzoom = 1;
float autocvar_cl_spawnzoom_speed = 1;
float autocvar_cl_spawnzoom_factor = 2;
bool autocvar_cl_stripcolorcodes;
bool autocvar_cl_vehicles_alarm =
tru
e;
bool autocvar_cl_vehicles_alarm =
fals
e;
bool autocvar_cl_vehicles_hud_tactical = true;
float autocvar_cl_vehicles_hudscale = 0.5;
float autocvar_cl_vehicles_notify_time = 15;
...
...
@@ -151,6 +150,8 @@ bool autocvar_crosshair_ring_reload;
float autocvar_crosshair_ring_reload_alpha;
float autocvar_crosshair_ring_reload_size;
float autocvar_crosshair_size;
bool autocvar_crosshair_chase = true;
float crosshair_chase_playeralpha = 0.25;
int autocvar_ekg;
float autocvar_fov;
bool autocvar_hud_cursormode = true;
...
...
@@ -268,7 +269,6 @@ bool autocvar_hud_panel_infomessages_flip;
float autocvar_hud_panel_mapvote_highlight_border = 1;
bool autocvar_hud_panel_modicons;
int autocvar_hud_panel_modicons_ca_layout;
int autocvar_hud_panel_modicons_dom_layout;
int autocvar_hud_panel_modicons_freezetag_layout;
bool autocvar_hud_panel_notify;
float autocvar_hud_panel_notify_fadetime;
...
...
@@ -351,6 +351,7 @@ float autocvar_hud_panel_weapons_selection_radius = 0;
float autocvar_hud_panel_weapons_selection_speed = 10;
float autocvar_hud_panel_weapons_timeout;
int autocvar_hud_panel_weapons_timeout_effect;
bool autocvar_hud_panel_weapons_orderbyimpulse = true;
float autocvar_hud_panel_weapons_timeout_fadebgmin;
float autocvar_hud_panel_weapons_timeout_fadefgmin;
float autocvar_hud_panel_weapons_timeout_speed_in = 0.25;
...
...
@@ -381,6 +382,7 @@ float autocvar_hud_shownames_crosshairdistance_antioverlap;
bool autocvar_hud_shownames_self;
bool autocvar_hud_shownames_status;
float autocvar_hud_shownames_statusbar_height;
float autocvar_hud_shownames_statusbar_highlight = 1;
float autocvar_hud_shownames_aspect;
float autocvar_hud_shownames_fontsize;
int autocvar_hud_shownames_decolorize;
...
...
@@ -395,12 +397,12 @@ string autocvar_hud_skin;
float autocvar_menu_mouse_speed;
string autocvar_menu_skin;
int autocvar_r_fakelight;
int
autocvar_r_fullbright;
bool
autocvar_r_fullbright;
float autocvar_r_letterbox;
string autocvar_scoreboard_columns;
bool autocvar_v_flipped;
floa
t autocvar_vid_conheight;
floa
t autocvar_vid_conwidth;
in
t autocvar_vid_conheight;
in
t autocvar_vid_conwidth;
float autocvar_vid_pixelheight;
float autocvar_viewsize;
bool autocvar_cl_eventchase_vehicle = 1;
...
...
@@ -411,6 +413,8 @@ float autocvar_cl_hitsound_min_pitch = 0.75;
float autocvar_cl_hitsound_max_pitch = 1.5;
float autocvar_cl_hitsound_nom_damage = 25;
float autocvar_cl_hitsound_antispam_time;
int autocvar_cl_eventchase_spectated_change = 1;
float autocvar_cl_eventchase_spectated_change_time = 1;
int autocvar_cl_eventchase_death = 1;
float autocvar_cl_eventchase_distance = 140;
bool autocvar_cl_eventchase_frozen = false;
...
...
qcsrc/client/commands/cl_cmd.qc
View file @
c51e07ac
...
...
@@ -43,7 +43,7 @@ void DrawDebugModel(entity this)
void LocalCommand_blurtest(int request)
{
TC(int, request);
TC(int, request);
// Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
// Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
...
...
@@ -79,7 +79,7 @@ void LocalCommand_blurtest(int request)
void LocalCommand_boxparticles(int request, int argc)
{
TC(int, request); TC(int, argc);
TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
...
...
@@ -135,7 +135,7 @@ void LocalCommand_boxparticles(int request, int argc)
void LocalCommand_create_scrshot_ent(int request)
{
TC(int, request);
TC(int, request);
switch (request)
{
case CMD_REQUEST_COMMAND:
...
...
@@ -175,7 +175,7 @@ void LocalCommand_create_scrshot_ent(int request)
void LocalCommand_debugmodel(int request, int argc)
{
TC(int, request); TC(int, argc);
TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
...
...
@@ -205,7 +205,7 @@ void LocalCommand_debugmodel(int request, int argc)
void LocalCommand_handlevote(int request, int argc)
{
TC(int, request); TC(int, argc);
TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
...
...
@@ -255,7 +255,7 @@ void LocalCommand_handlevote(int request, int argc)
void LocalCommand_hud(int request, int argc)
{
TC(int, request); TC(int, argc);
TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
...
...
@@ -325,7 +325,8 @@ void LocalCommand_hud(int request, int argc)
case "clickradar":
{
HUD_Radar_Show_Maximized(!hud_panel_radar_mouse, 1);
if(!isdemo())
HUD_Radar_Show_Maximized(!hud_panel_radar_mouse, 1);
return;
}
}
...
...
@@ -350,7 +351,7 @@ void LocalCommand_hud(int request, int argc)
void LocalCommand_localprint(int request, int argc)
{
TC(int, request); TC(int, argc);
TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
...
...
@@ -377,7 +378,7 @@ void LocalCommand_localprint(int request, int argc)
void LocalCommand_mv_download(int request, int argc)
{
TC(int, request); TC(int, argc);
TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
...
...
@@ -404,7 +405,7 @@ void LocalCommand_mv_download(int request, int argc)
void LocalCommand_sendcvar(int request, int argc)
{
TC(int, request); TC(int, argc);
TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
...
...
@@ -433,7 +434,7 @@ void LocalCommand_sendcvar(int request, int argc)
case CMD_REQUEST_USAGE:
{
LOG_INFO("Usage:^3 cl_cmd sendcvar <cvar>");
LOG_INFO(" Where 'cvar' is the cvar
plus arguments
to send to the server.");
LOG_INFO(" Where 'cvar' is the cvar to send to the server.");
return;
}
}
...
...
@@ -476,7 +477,7 @@ CLIENT_COMMAND(handlevote, "System to handle selecting a vote or option") { Loca
CLIENT_COMMAND(hud, "Commands regarding/controlling the HUD system") { LocalCommand_hud(request, arguments); }
CLIENT_COMMAND(localprint, "Create your own centerprint sent to yourself") { LocalCommand_localprint(request, arguments); }
CLIENT_COMMAND(mv_download, "Retrieve mapshot picture from the server") { LocalCommand_mv_download(request, arguments); }
CLIENT_COMMAND(sendcvar, "Send a cvar to the server (like weaponpriority)") { LocalCommand_sendcvar(request, arguments); }
CLIENT_COMMAND(sendcvar, "Send a cvar to the server (like
cl_
weaponpriority)") { LocalCommand_sendcvar(request, arguments); }
void LocalCommand_macro_help()
{
...
...
@@ -564,11 +565,12 @@ void GameCommand(string command)
// These functions are here specifically to add special + - commands to the game, and are not really normal commands.
// Please add client commands to the function above this, as this is only for special reasons.
// NOTE: showaccuracy is kept as legacy command
#define CONSOLE_COMMANDS_NORMAL() \
CONSOLE_COMMAND("+showscores", { scoreboard_showscores = true; }) \
CONSOLE_COMMAND("-showscores", { scoreboard_showscores = false; }) \
CONSOLE_COMMAND("+showaccuracy", {
scoreboard_showaccuracy = true;
}) \
CONSOLE_COMMAND("-showaccuracy", {
scoreboard_showaccuracy = false;
}) \
CONSOLE_COMMAND("+showaccuracy", { }) \
CONSOLE_COMMAND("-showaccuracy", { }) \
/* nothing */
#define CONSOLE_COMMANDS_MOVEMENT() \
...
...
qcsrc/client/csqcmodel_hooks.qc
View file @
c51e07ac
...
...
@@ -18,8 +18,6 @@
.float death_time;
.int modelflags;
.bool isplayermodel;
// FEATURE: LOD
.int lodmodelindex0;
.int lodmodelindex1;
...
...
@@ -343,10 +341,10 @@ void CSQCPlayer_FallbackFrame_PostUpdate(entity this, bool isnew)
// player "pops in"
if(isnew)
{
#define FIX_FRAMETIME(f,ft) MACRO_BEGIN
{
\
if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0)
\
this.ft = this.death_time;
\
}
MACRO_END
#define FIX_FRAMETIME(f,ft) MACRO_BEGIN \
if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0)
\
this.ft = this.death_time;
\
MACRO_END
FIX_FRAMETIME(frame, frame1time);
FIX_FRAMETIME(frame2, frame2time);
#ifdef CSQCMODEL_HAVE_TWO_FRAMES
...
...
@@ -362,7 +360,7 @@ void CSQCPlayer_AnimDecide_PostUpdate(entity this, bool isnew)
}
int CSQCPlayer_FallbackFrame(entity this, int f)
{
TC(int, f);
TC(int, f);
if(frameduration(this.modelindex, f) > 0)
return f; // goooooood
if(frameduration(this.modelindex, 1) <= 0)
...
...
@@ -415,7 +413,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this)
// recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch
if(this.tag_entity.classname == "csqcmodel")
{
CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.
entnum >= 1 && this.tag_entity.entnum <= maxclients
));
CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.
isplayermodel & ISPLAYER_CLIENT
));
}
if(this.tag_entity.modelindex != this.tag_entity_lastmodelindex)
...
...
@@ -443,7 +441,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this)
LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it");
}
}
else if(this.tag_entity.isplayermodel)
else if(
(
this.tag_entity.isplayermodel
& ISPLAYER_MODEL)
)
{
skeleton_loadinfo(this.tag_entity);
this.tag_index = this.tag_entity.bone_weapon;
...
...
@@ -542,6 +540,9 @@ void CSQCModel_Effects_Apply(entity this)
tref = EFFECT_TR_BLOOD.m_id;
if(this.csqcmodel_modelflags & MF_ROTATE)
{
// This will be hard to replace with MAKE_VECTORS because it's called as part of the predraw function
// as documented in csprogs.h in the engine. The globals can then be read in many places in the engine.
// However MF_ROTATE is currently only used in one place - might be possible to get rid of it entirely.
this.renderflags |= RF_USEAXIS;
makevectors(this.angles + '0 100 0' * fmod(time, 3.6));
}
...
...
@@ -600,17 +601,22 @@ void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
return;
this.csqcmodel_predraw_run = framecount;
if(!this.modelindex || this.model == "null")
if(!this.modelindex || this.model == "null"
|| this.alpha < 0
)
{
this.drawmask = 0;
if(this.snd_looping > 0)
{
sound(this, this.snd_looping, SND_Null, VOL_BASE, autocvar_cl_jetpack_attenuation);
this.snd_looping = 0;
}
return;
}
else
this.drawmask = MASK_NORMAL;
if(this.isplayermodel) // this checks if it's a player MODEL!
if(
(
this.isplayermodel
& ISPLAYER_MODEL) && this.drawmask
) // this checks if it's a player MODEL!
{
CSQCPlayer_ModelAppearance_Apply(this, this.
entnum == player_localnum + 1
);
CSQCPlayer_ModelAppearance_Apply(this,
(
this.
isplayermodel & ISPLAYER_LOCAL)
);
CSQCPlayer_LOD_Apply(this);
if(!isplayer)
...
...
@@ -699,7 +705,7 @@ void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool isloc
this.iflags |= IFLAG_V_ANGLE_X;
// revert to values from server
CSQCModel_Effects_PreUpdate(this);
if(this.isplayermodel)
if(
(
this.isplayermodel
& ISPLAYER_MODEL)
)
{
if(!isplayer)
CSQCPlayer_FallbackFrame_PreUpdate(this);
...
...
@@ -710,10 +716,12 @@ void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool isloc
void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
{
// is it a player model? (shared state)
this.isplayermodel = (substring(this.model, 0, 14) == "models/player/" || substring(this.model, 0, 17) == "models/ok_player/" || (substring(this.model, 0, 16) == "models/monsters/" && (this.entnum >= 1 && this.entnum <= maxclients)));
bool is_playermodel = (substring(this.model, 0, 14) == "models/player/" || substring(this.model, 0, 17) == "models/ok_player/" ||
(substring(this.model, 0, 16) == "models/monsters/" && (this.isplayermodel & BIT(1))));
this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_MODEL, is_playermodel);
// save values set by server
if(this.isplayermodel)
if(
(
this.isplayermodel
& ISPLAYER_MODEL)
)
{
CSQCPlayer_ModelAppearance_PostUpdate(this);
if(isplayer)
...
...
qcsrc/client/csqcmodel_hooks.qh
View file @
c51e07ac
...
...
@@ -23,6 +23,8 @@ const int MF_TRACER3 = BIT(7); // purple trail
.int csqcmodel_modelflags;
.int csqcmodel_traileffect;
.int isplayermodel;
void CSQCModel_Effects_Apply(entity this);
void CSQCModel_Hook_PreDraw(entity this, bool isplayer);
qcsrc/client/defs.qh
View file @
c51e07ac
...
...
@@ -3,9 +3,8 @@
// Additional OPTIONAL Fields and Globals
//float intermission;
float scoreboard_showscores;
float scoreboard_showaccuracy;
.string message;
.
in
t renderflags;
.
floa
t renderflags;
// float coop;
// float deathmatch;
...
...
@@ -16,7 +15,6 @@ float dmg_take;
// Darkplaces Render Modifications
#if 0
.float alpha;
.float renderflags;
.vector colormod;
.float scale;
#endif
...
...
@@ -78,6 +76,7 @@ float nb_pb_period;
// 0 - playing
// >0 - id of spectated player
float spectatee_status;
float spectatee_status_changed_time;
// short mapname
string shortmapname;
...
...
@@ -110,10 +109,73 @@ int w_deathtype;
float w_issilent, w_random;
vector w_org, w_backoff;
float autoswitch;
bool cvar_cl_allow_uid2name;
bool cvar_cl_allow_uidranking;
float cvar_cl_autoscreenshot;
float cvar_cl_autotaunt;
float cvar_cl_clippedspectating;
int cvar_cl_gunalign;
float cvar_cl_handicap;
float cvar_cl_jetpack_jump;
float cvar_cl_movement_track_canjump;
float cvar_cl_noantilag;
string cvar_cl_physics;
float cvar_cl_voice_directional;
float cvar_cl_voice_directional_taunt_attenuation;
float cvar_cl_weaponimpulsemode;
string cvar_g_xonoticversion;
float cvar_cl_cts_noautoswitch;
bool cvar_cl_weapon_switch_reload;
bool cvar_cl_weapon_switch_fallback_to_impulse;
REPLICATE(autoswitch, bool, "cl_autoswitch");
REPLICATE(cvar_cl_allow_uid2name, bool, "cl_allow_uid2name");
REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking");
REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt");
REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
REPLICATE(cvar_cl_handicap, float, "cl_handicap");
REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump");
REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump");
REPLICATE(cvar_cl_noantilag, bool, "cl_noantilag");
REPLICATE(cvar_cl_physics, string, "cl_physics");
REPLICATE(cvar_cl_voice_directional, int, "cl_voice_directional");
REPLICATE(cvar_cl_voice_directional_taunt_attenuation, float, "cl_voice_directional_taunt_attenuation");
REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode");
REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion");
REPLICATE(cvar_cl_cts_noautoswitch, bool, "cl_cts_noautoswitch");
REPLICATE(cvar_cl_weapon_switch_reload, bool, "cl_weapon_switch_reload");
REPLICATE(cvar_cl_weapon_switch_fallback_to_impulse, bool, "cl_weapon_switch_fallback_to_impulse");
/*
// cvar cl_newusekeysupported doesn't exist
float cvar_cl_newusekeysupported;
REPLICATE(cvar_cl_newusekeysupported, bool, "cl_newusekeysupported");
*/
string cvar_cl_allow_uidtracking;
REPLICATE(cvar_cl_allow_uidtracking, string, "cl_allow_uidtracking");
string cvar_cl_weaponpriority;
REPLICATE(cvar_cl_weaponpriority, string, "cl_weaponpriority");
string cvar_cl_weaponpriorities[10];
REPLICATE(cvar_cl_weaponpriorities[0], string, "cl_weaponpriority0");
REPLICATE(cvar_cl_weaponpriorities[1], string, "cl_weaponpriority1");
REPLICATE(cvar_cl_weaponpriorities[2], string, "cl_weaponpriority2");
REPLICATE(cvar_cl_weaponpriorities[3], string, "cl_weaponpriority3");
REPLICATE(cvar_cl_weaponpriorities[4], string, "cl_weaponpriority4");
REPLICATE(cvar_cl_weaponpriorities[5], string, "cl_weaponpriority5");
REPLICATE(cvar_cl_weaponpriorities[6], string, "cl_weaponpriority6");
REPLICATE(cvar_cl_weaponpriorities[7], string, "cl_weaponpriority7");
REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8");
REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9");
float bgmtime;
string weaponorder_byimpulse;
string weaponorder_byimpulse;
// NOTE: this is a misnomer, weapon order is not always sorted by impulse
string weaponorder_bypriority;
bool weapons_orderbyimpulse; // update priority list when toggling this
float vortex_charge_movingavg;
...
...
qcsrc/client/hud/hud.qc
View file @
c51e07ac
...
...
@@ -75,14 +75,14 @@ vector HUD_Get_Num_Color (float hp, float maxvalue)
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
{
TC(int, item_count);
TC(int, item_count);
float aspect = size_y / size_x;
return bound(1, floor((sqrt(4 * item_aspect * aspect * item_count + aspect * aspect) + aspect + 0.5) / 2), item_count);
}
vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect)
{
TC(int, item_count);
TC(int, item_count);
float columns, rows;
float ratio, best_ratio = 0;
float best_columns = 1, best_rows = 1;
...
...
@@ -180,7 +180,7 @@ void HUD_Panel_LoadCvars()
//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
{
TC(bool, vertical); TC(int, drawflag);
TC(bool, vertical); TC(int, drawflag);
if(!length_ratio || !theAlpha)
return;
if(length_ratio > 1)
...
...
@@ -287,7 +287,7 @@ void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, flo
void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag)
{
TC(int, drawflag);
TC(int, drawflag);
if(!theAlpha)
return;
...
...
@@ -308,7 +308,7 @@ void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theA
void DrawNumIcon_expanding(vector myPos, vector mySize, float theTime, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp)
{
TC(bool, vertical); TC(int, icon_right_align);
TC(bool, vertical); TC(int, icon_right_align);
vector newPos = '0 0 0', newSize = '0 0 0';
vector picpos, numpos;
...
...
@@ -388,7 +388,7 @@ void DrawNumIcon_expanding(vector myPos, vector mySize, float theTime, string ic
void DrawNumIcon(vector myPos, vector mySize, float theTime, string icon, bool vertical, int icon_right_align, vector color, float theAlpha)
{
TC(bool, vertical); TC(int, icon_right_align);
TC(bool, vertical); TC(int, icon_right_align);
DrawNumIcon_expanding(myPos, mySize, theTime, icon, vertical, icon_right_align, color, theAlpha, 0);
}
...
...
@@ -398,6 +398,8 @@ Main HUD system
==================
*/
float lasthud;
float vh_notice_time;
void HUD_Vehicle()
{
if(autocvar__hud_configure) return;
...
...
@@ -409,6 +411,11 @@ void HUD_Vehicle()
Vehicle info = Vehicles_from(hud);
info.vr_hud(info);
}
if(hud != HUD_NORMAL && lasthud == HUD_NORMAL)
vh_notice_time = time + autocvar_cl_vehicles_notify_time;
lasthud = hud;
}
void HUD_Panel_Draw(entity panent)
...
...
@@ -425,7 +432,11 @@ void HUD_Panel_Draw(entity panent)
}
bool draw_allowed = false;
if (active_minigame && HUD_MinigameMenu_IsOpened())
if (scoreboard_fade_alpha && panel.panel_showflags & PANEL_SHOW_WITH_SB)
{
draw_allowed = true;
}
else if (active_minigame && HUD_MinigameMenu_IsOpened())
{
if (panel.panel_showflags & PANEL_SHOW_MINIGAME)
draw_allowed = true;
...
...
@@ -441,7 +452,12 @@ void HUD_Panel_Draw(entity panent)
if (draw_allowed)
{
if (panel.panel_showflags & PANEL_SHOW_WITH_SB)
panel_fade_alpha = 1;
{
if (scoreboard_fade_alpha && intermission == 2 && !(panel.panel_showflags & PANEL_SHOW_MAPVOTE))
panel_fade_alpha = scoreboard_fade_alpha;
else
panel_fade_alpha = 1;
}
else
{
panel_fade_alpha = 1 - scoreboard_fade_alpha;
...
...
@@ -561,6 +577,25 @@ void Hud_Dynamic_Frame()
HUD_Scale_Disable();
}
bool HUD_WouldShowCursor()
{
if(autocvar__hud_configure)
return true;
if(mv_active)
return true;
//entity local_player = ((csqcplayer) ? csqcplayer : CSQCModel_server2csqc(player_localentnum - 1)); // TODO: doesn't use regular cursor handling
//if(local_player.viewloc && (local_player.viewloc.spawnflags & VIEWLOC_FREEAIM))
//return true;
if(HUD_Radar_Clickable())
return true;
if(HUD_MinigameMenu_IsOpened())
return true;
if(QuickMenu_IsOpened())
return true;
return false;
}
float prev_myteam;
void HUD_Main()
{
int i;
...
...
@@ -569,6 +604,13 @@ void HUD_Main()
else
hud_fade_alpha = 1 - autocvar__menu_alpha;
if(myteam != prev_myteam)
{
myteamcolors = colormapPaletteColor(myteam, 1);
FOREACH(hud_panels, true, it.update_time = time);
prev_myteam = myteam;
}
HUD_Configure_Frame();
if(scoreboard_fade_alpha == 1)
...
...
@@ -676,10 +718,20 @@ void HUD_Main()
HUD_Panel_Draw(HUD_PANEL(RADAR));
if(autocvar__con_chat_maximized)
HUD_Panel_Draw(HUD_PANEL(CHAT));
if
(hud_panel_q
uick
m
enu)
if
(Q
uick
M
enu
_IsOpened()
)
HUD_Panel_Draw(HUD_PANEL(QUICKMENU));
HUD_Panel_Draw(HUD_PANEL(SCOREBOARD));
int cursor_active_prev = cursor_active;
cursor_active = HUD_WouldShowCursor();
if (cursor_active_prev != cursor_active && autocvar_hud_cursormode)
{
setcursormode(cursor_active);
// cursor inactive this frame, will be set to 1 the next frame
if (cursor_active)