-Fri Mar 2 07:24:40 CET 2018
+Sat Mar 3 07:23:44 CET 2018
set g_balance_arc_burst_heat 5
set g_balance_arc_beam_maxangle 10
set g_balance_arc_beam_nonplayerdamage 80
-set g_balance_arc_beam_range 1000
+set g_balance_arc_beam_range 4000
set g_balance_arc_beam_refire 0.25
set g_balance_arc_beam_returnspeed 8
-set g_balance_arc_beam_tightness 0.5
-set g_balance_arc_bolt 0
+set g_balance_arc_beam_tightness 0.95
+set g_balance_arc_bolt 1
set g_balance_arc_bolt_ammo 1
set g_balance_arc_bolt_damage 25
set g_balance_arc_bolt_damageforcescale 0
underwater
velocityjitter 250 250 250
velocitymultiplier 20
+effect arc_lightning
+ type smoke
+ alpha 40 40 350
+ color 0x80C0FF 0x80C0FF
+ countabsolute 1
+ sizeincrease 400
+ size 4 4
+ tex 38 38
+ velocitymultiplier 100
effect arc_beam
type spark
airfriction -10
-ko "Korean" "한국의"
+ko Korean "한국의" 33%
ast Asturian "Asturianu" 73%
-zh_CN "Chinese (China)" "中文"
-de German "Deutsch" 99%
-de_CH German "Deutsch (Schweiz)" 99%
+zh_CN "Chinese (China)" "中文" 49%
+de German "Deutsch"
+de_CH German "Deutsch (Schweiz)"
en English "English"
en_AU English "English (Australia)" 86%
es Spanish "Español" 99%
-fr French "Français" 99%
-ga Irish "Irish"
-it Italian "Italiano" 99%
+fr French "Français"
+ga Irish "Irish" 35%
+it Italian "Italiano"
hu Hungarian "Magyar" 55%
nl Dutch "Nederlands" 70%
pl Polish "Polski" 81%
-pt Portuguese "Português" 99%
+pt Portuguese "Português"
ro Romanian "Romana" 83%
fi Finnish "Suomi" 33%
zh_TW "Chinese (Taiwan)" "國語" 68%
el Greek "Ελληνική" 33%
be Belarusian "Беларуская" 61%
bg Bulgarian "Български" 68%
-ru Russian "Русский" 99%
+ru Russian "Русский"
sr Serbian "Српски" 71%
uk Ukrainian "Українська" 57%
LOG_INFO(_("^3ping^7 Ping time"));
LOG_INFO(_("^3pl^7 Packet loss"));
LOG_INFO(_("^3elo^7 Player ELO"));
+ LOG_INFO(_("^3fps^7 Player FPS"));
LOG_INFO(_("^3kills^7 Number of kills"));
LOG_INFO(_("^3deaths^7 Number of deaths"));
LOG_INFO(_("^3suicides^7 Number of suicides"));
// otherwise the previous exclusive rule warns anyway
// e.g. -teams,rc,cts,lms/kills ?+rc/kills
#define SCOREBOARD_DEFAULT_COLUMNS \
-"ping pl name |" \
+"ping pl fps name |" \
" -teams,rc,cts,inv,lms/kills +ft,tdm/kills ?+rc,inv/kills" \
" -teams,lms/deaths +ft,tdm/deaths" \
" +tdm/sum" \
case "elo": sbt_field[sbt_num_fields] = SP_ELO; break;
case "dmg": case "damage": sbt_field[sbt_num_fields] = SP_DMG; break;
case "dmgtaken": case "damagetaken": sbt_field[sbt_num_fields] = SP_DMGTAKEN; break;
+ case "fps": sbt_field[sbt_num_fields] = SP_FPS; break;
default:
{
FOREACH(Scores, true, {
}
}
+ case SP_FPS:
+ {
+ float fps = pl.(scores(SP_FPS));
+ if(fps == 0)
+ {
+ sbt_field_rgb = '1 1 1';
+ return ((pl.ping == 0) ? _("N/A") : "..."); // if 0 ping, either connecting or bot (either case can't show proper score)
+ }
+ //sbt_field_rgb = HUD_Get_Num_Color(fps, 200);
+ sbt_field_rgb = '1 0 0' + '0 1 1' * (bound(0, fps, 60) / 60);
+ return ftos(fps);
+ }
+
case SP_DMG: case SP_DMGTAKEN:
return sprintf("%.1f k", pl.(scores(field)) / 1000);
registercvar("cl_jumpspeedcap_min", "");
registercvar("cl_jumpspeedcap_max", "");
+ registercvar("cl_shootfromfixedorigin", "");
+
registercvar("cl_multijump", "1");
registercvar("cl_spawn_near_teammate", "1");
viewmodels[slot] = new(viewmodel);
}
+float showfps_prevfps;
+float showfps_prevfps_time;
+int showfps_framecounter;
+
+void fpscounter_update()
+{
+ if(!STAT(SHOWFPS))
+ return;
+
+ float currentTime = gettime(GETTIME_REALTIME);
+ showfps_framecounter += 1;
+ if(currentTime - showfps_prevfps_time > STAT(SHOWFPS))
+ {
+ showfps_prevfps = showfps_framecounter/(currentTime - showfps_prevfps_time);
+ showfps_framecounter = 0;
+ showfps_prevfps_time = currentTime;
+
+ int channel = MSG_C2S;
+ WriteHeader(channel, fpsreport);
+ WriteShort(channel, bound(0, rint(showfps_prevfps), 65535)); // prevent insane fps values
+ }
+}
+
+STATIC_INIT(fpscounter_init)
+{
+ float currentTime = gettime(GETTIME_REALTIME);
+ showfps_prevfps_time = currentTime; // we must initialize it to avoid an instant low frame sending
+}
+
void Porto_Draw(entity this);
STATIC_INIT(Porto)
{
TargetMusic_Advance();
Fog_Force();
+ fpscounter_update();
if(drawtime == 0)
drawframetime = 0.01666667; // when we don't know fps yet, we assume 60fps
MY(velocityjitter) = '250.0 250.0 250.0';
MY(velocitymultiplier) = 20;
}
+// impact smoke
+SUB(arc_lightning) {
+ MY(alpha_min) = 40;
+ MY(alpha_max) = 40;
+ MY(alpha_fade) = 350;
+ MY(color_min) = "0x80C0FF";
+ MY(color_max) = "0x80C0FF";
+ MY(countabsolute) = 1;
+ MY(sizeincrease) = 400;
+ MY(size_min) = 4;
+ MY(size_max) = 4;
+ MY(tex_min) = 38;
+ MY(tex_max) = 38;
+ MY(type) = "smoke";
+ MY(velocitymultiplier) = 100;
+}
DEF(arc_beam);
// sparks on beam
REGISTER_NET_LINKED(ENT_CLIENT_WALL)
#include <lib/csqcmodel/net.qh>
+
+REGISTER_NET_C2S(fpsreport)
break; // don't bother checking the others
}
}
- if(this.waterlevel >= WATERLEVEL_SWIMMING)
- do_crouch = false;
+ //if(this.waterlevel >= WATERLEVEL_SWIMMING)
+ //do_crouch = false;
if(hud != HUD_NORMAL)
do_crouch = false;
if(STAT(FROZEN, this))
REGISTER_SP(ELO);
+REGISTER_SP(FPS);
+
// TODO: move to common mutators
REGISTER_SP(RACE_TIME);
REGISTER_STAT(ITEMSTIME, int, autocvar_sv_itemstime)
REGISTER_STAT(KILL_TIME, float)
+#ifdef SVQC
+float autocvar_sv_showfps = 5;
+#endif
+REGISTER_STAT(SHOWFPS, float, autocvar_sv_showfps)
+
#ifdef SVQC
bool autocvar_g_ctf_leaderboard;
#endif
float warmup_limit;
#endif
+#ifdef SVQC
+bool autocvar_g_shootfromcenter;
+bool autocvar_g_shootfromeye;
+#endif
+REGISTER_STAT(SHOOTFROMEYE, bool, autocvar_g_shootfromeye)
+REGISTER_STAT(SHOOTFROMCENTER, bool, autocvar_g_shootfromcenter)
+
REGISTER_STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, float)
REGISTER_STAT(MOVEVARS_AIRCONTROL_PENALTY, float)
REGISTER_STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, float)
vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn)
{
-#ifdef SVQC
string s;
-#endif
if (visual)
{
vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
}
-#ifdef SVQC
- else if (autocvar_g_shootfromeye)
+ else if (STAT(SHOOTFROMEYE))
{
vecs.y = vecs.z = 0;
}
- else if (autocvar_g_shootfromcenter)
+ else if (STAT(SHOOTFROMCENTER))
{
vecs.y = 0;
vecs.z -= 2;
}
- else if ((s = autocvar_g_shootfromfixedorigin) != "")
+ else if ((s = G_SHOOTFROMFIXEDORIGIN) != "")
{
vector v = stov(s);
if (y_is_right) v.y = -v.y;
vecs.y = v.y;
vecs.z = v.z;
}
-#endif
else // just do the same as top
{
vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
.WFRAME wframe;
+#ifdef SVQC
+ #define G_SHOOTFROMFIXEDORIGIN autocvar_g_shootfromfixedorigin
+#elif defined(CSQC)
+ string autocvar_cl_shootfromfixedorigin;
+ #define G_SHOOTFROMFIXEDORIGIN autocvar_cl_shootfromfixedorigin
+#endif
+
vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn);
void CL_WeaponEntity_SetModel(entity this, string name, bool _anim);
#endif
#endif
#ifdef CSQC
bool autocvar_cl_arcbeam_teamcolor = true;
+bool autocvar_cl_arcbeam_simple = true;
+
+.int beam_slot;
METHOD(Arc, wr_impacteffect, void(entity thiswep, entity actor))
{
vector last_top = WarpZone_TransformOrigin(WarpZone_trace_transform, Draw_ArcBeam_callback_last_top);
vector last_bottom = WarpZone_TransformOrigin(WarpZone_trace_transform, Draw_ArcBeam_callback_last_bottom);
- R_BeginPolygon(beam.beam_image, DRAWFLAG_NORMAL); // DRAWFLAG_ADDITIVE
- R_PolygonVertex(
- top,
- '0 0.5 0' + ('0 0.5 0' * (thickness / beam.beam_thickness)),
- beam.beam_color,
- beam.beam_alpha
- );
- R_PolygonVertex(
- last_top,
- '0 0.5 0' + ('0 0.5 0' * (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
- beam.beam_color,
- beam.beam_alpha
- );
- R_PolygonVertex(
- last_bottom,
- '0 0.5 0' * (1 - (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
- beam.beam_color,
- beam.beam_alpha
- );
- R_PolygonVertex(
- bottom,
- '0 0.5 0' * (1 - (thickness / beam.beam_thickness)),
- beam.beam_color,
- beam.beam_alpha
- );
- R_EndPolygon();
+ if(autocvar_cl_arcbeam_simple)
+ Draw_CylindricLine(start, end, thickness, beam.beam_image, 0.25, -time * 3, beam.beam_color, beam.beam_alpha, DRAWFLAG_NORMAL, transformed_view_org);
+ else
+ {
+ R_BeginPolygon(beam.beam_image, DRAWFLAG_NORMAL); // DRAWFLAG_ADDITIVE
+ R_PolygonVertex(
+ top,
+ '0 0.5 0' + ('0 0.5 0' * (thickness / beam.beam_thickness)),
+ beam.beam_color,
+ beam.beam_alpha
+ );
+ R_PolygonVertex(
+ last_top,
+ '0 0.5 0' + ('0 0.5 0' * (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
+ beam.beam_color,
+ beam.beam_alpha
+ );
+ R_PolygonVertex(
+ last_bottom,
+ '0 0.5 0' * (1 - (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
+ beam.beam_color,
+ beam.beam_alpha
+ );
+ R_PolygonVertex(
+ bottom,
+ '0 0.5 0' * (1 - (thickness / beam.beam_thickness)),
+ beam.beam_color,
+ beam.beam_alpha
+ );
+ R_EndPolygon();
+ }
// draw trailing particles
// NOTES:
// into a weapon system for client code.
// find where we are aiming
- makevectors(warpzone_save_view_angles);
+ makevectors(((autocvar_chase_active) ? warpzone_save_view_angles : view_angles));
vector forward = v_forward;
vector right = v_right;
vector up = v_up;
+ entity wepent = viewmodels[this.beam_slot];
+
+ if(autocvar_chase_active)
+ this.beam_usevieworigin = 1;
+ else
+ this.beam_usevieworigin = 2;
// decide upon start position
if(this.beam_usevieworigin == 2)
{ start_pos = warpzone_save_view_origin; }
+ else if(csqcplayer)
+ { start_pos = csqcplayer.origin + csqcplayer.view_ofs; }
else
{ start_pos = this.origin; }
+ int v_shot_idx; // used later
+ (v_shot_idx = gettagindex(wepent, "shot")) || (v_shot_idx = gettagindex(wepent, "tag_shot"));
+ if(v_shot_idx && this.beam_usevieworigin == 2)
+ start_pos = gettaginfo(wepent, v_shot_idx) - '0 0 2';
+
// trace forward with an estimation
WarpZone_TraceLine(
start_pos,
end_pos = start_pos + (forward * g_trueaim_minrange);
// move shot origin to the actual gun muzzle origin
- vector origin_offset =
- right * -this.beam_shotorigin.y
- + up * this.beam_shotorigin.z;
+ vector origin_offset = '0 0 0';
+ if(!v_shot_idx || this.beam_usevieworigin != 2)
+ {
+ this.beam_shotorigin = wepent.movedir;
+ origin_offset =
+ right * -this.beam_shotorigin.y
+ + up * this.beam_shotorigin.z;
+ }
+ else
+ this.beam_shotorigin = '0 0 0';
start_pos = start_pos + origin_offset;
)
);
}
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
pointparticles(
this.beam_muzzleeffect,
int slot = ReadByte();
entity flash;
+ this.beam_slot = slot;
+
if(isnew)
{
int gunalign = W_GunAlign(viewmodels[slot], STAT(GUNALIGN)) - 1;
- this.beam_shotorigin = arc_shotorigin[gunalign];
+ this.beam_shotorigin = arc_shotorigin[gunalign]; // get a starting point
// set other main attributes of the beam
this.draw = Draw_ArcBeam;
this.beam_hitlight[1] = 1;
this.beam_hitlight[2] = 1;
this.beam_hitlight[3] = 1;
- this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzleeffect = EFFECT_Null;
this.beam_muzzlelight[0] = 0;
this.beam_muzzlelight[1] = 1;
this.beam_muzzlelight[2] = 1;
this.beam_muzzlelight[3] = 1;
this.beam_image = "particles/lgbeam";
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = this.beam_alpha;
flash.colormod = this.beam_color;
- flash.scale = 0.5;
+ flash.scale = 0.35;
}
break;
}
this.beam_hitlight[1] = 1;
this.beam_hitlight[2] = 1;
this.beam_hitlight[3] = 1;
- this.beam_muzzleeffect = NULL; // (EFFECT_GRENADE_MUZZLEFLASH);
+ this.beam_muzzleeffect = EFFECT_Null; // (EFFECT_GRENADE_MUZZLEFLASH);
this.beam_muzzlelight[0] = 0;
this.beam_muzzlelight[1] = 1;
this.beam_muzzlelight[2] = 1;
this.beam_muzzlelight[3] = 1;
this.beam_image = "particles/lgbeam";
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = this.beam_alpha;
flash.colormod = this.beam_color;
- flash.scale = 0.5;
+ flash.scale = 0.35;
}
break;
}
this.beam_hitlight[1] = 1;
this.beam_hitlight[2] = 1;
this.beam_hitlight[3] = 1;
- this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzleeffect = EFFECT_Null;
this.beam_muzzlelight[0] = 0;
this.beam_muzzlelight[1] = 1;
this.beam_muzzlelight[2] = 1;
this.beam_muzzlelight[3] = 1;
this.beam_image = "particles/lgbeam";
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = this.beam_alpha;
flash.colormod = this.beam_color;
- flash.scale = 0.5;
+ flash.scale = 0.35;
}
break;
}
this.beam_hitlight[1] = 1;
this.beam_hitlight[2] = 0;
this.beam_hitlight[3] = 0;
- this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzleeffect = EFFECT_Null;
this.beam_muzzlelight[0] = 50;
this.beam_muzzlelight[1] = 1;
this.beam_muzzlelight[2] = 0;
this.beam_muzzlelight[3] = 0;
this.beam_image = "particles/lgbeam";
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = this.beam_alpha;
flash.colormod = this.beam_color;
- flash.scale = 0.5;
+ flash.scale = 0.35;
}
break;
}
this.beam_hitlight[1] = 1;
this.beam_hitlight[2] = 1;
this.beam_hitlight[3] = 1;
- this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzleeffect = EFFECT_Null;
this.beam_muzzlelight[0] = 0;
this.beam_muzzlelight[1] = 1;
this.beam_muzzlelight[2] = 1;
this.beam_muzzlelight[3] = 1;
this.beam_image = "particles/lgbeam";
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = this.beam_alpha;
flash.colormod = this.beam_color;
- flash.scale = 0.5;
+ flash.scale = 0.35;
}
break;
}
this.beam_hitlight[1] = 1;
this.beam_hitlight[2] = 1;
this.beam_hitlight[3] = 1;
- this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzleeffect = EFFECT_Null;
this.beam_muzzlelight[0] = 0;
this.beam_muzzlelight[1] = 1;
this.beam_muzzlelight[2] = 1;
this.beam_muzzlelight[3] = 1;
this.beam_image = "particles/lgbeam";
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = this.beam_alpha;
flash.colormod = this.beam_color;
- flash.scale = 0.5;
+ flash.scale = 0.35;
}
break;
}
this.beam_hitlight[1] = 1;
this.beam_hitlight[2] = 1;
this.beam_hitlight[3] = 1;
- this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzleeffect = EFFECT_Null;
this.beam_muzzlelight[0] = 0;
this.beam_muzzlelight[1] = 1;
this.beam_muzzlelight[2] = 1;
this.beam_muzzlelight[3] = 1;
this.beam_image = "particles/lgbeam";
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = this.beam_alpha;
flash.colormod = this.beam_color;
- flash.scale = 0.5;
+ flash.scale = 0.35;
}
break;
}
this.beam_hitlight[1] = 1;
this.beam_hitlight[2] = 1;
this.beam_hitlight[3] = 1;
- this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzleeffect = EFFECT_Null;
this.beam_muzzlelight[0] = 0;
this.beam_muzzlelight[1] = 1;
this.beam_muzzlelight[2] = 1;
this.beam_muzzlelight[3] = 1;
this.beam_image = "particles/lgbeam";
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = this.beam_alpha;
flash.colormod = this.beam_color;
- flash.scale = 0.5;
+ flash.scale = 0.35;
}
break;
}
this.beam_hitlight[1] = 1;
this.beam_hitlight[2] = 1;
this.beam_hitlight[3] = 1;
- this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzleeffect = EFFECT_Null;
this.beam_muzzlelight[0] = 0;
this.beam_muzzlelight[1] = 1;
this.beam_muzzlelight[2] = 1;
this.beam_muzzlelight[3] = 1;
this.beam_image = "particles/lgbeam";
- if(this.beam_muzzleeffect)
+ if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = this.beam_alpha;
flash.colormod = this.beam_color;
- flash.scale = 0.5;
+ flash.scale = 0.35;
}
break;
}
if (g_buf) strunzone(g_buf);
g_buf = strzone(tmp);
}
+ void WriteShort(int to, int b)
+ {
+ WriteByte(to, (b >> 8) & 0xFF);
+ WriteByte(to, b & 0xFF);
+ }
#elif defined(SVQC)
int ReadByte()
{
ydec_single(g_buf, ret);
return ret;
}
+ int ReadShort()
+ {
+ return (ReadByte() << 8) | (ReadByte());
+ }
void WriteByte(int to, int b);
#endif
return strcat(a, " ", b);
}
+ERASEABLE
+string cons_mid(string a, string mid, string b)
+{
+ if (a == "") return b;
+ if (b == "") return a;
+ return strcat(a, mid, b);
+}
+
ERASEABLE
string substring_range(string s, float b, float e)
{
entity e;
string panelname = "ammo";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Ammunition display:")));
ATTRIB(XonoticHUDAmmoDialog, title, string, _("Ammo Panel"));
ATTRIB(XonoticHUDAmmoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDAmmoDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDAmmoDialog, rows, float, 15);
+ ATTRIB(XonoticHUDAmmoDialog, rows, float, 15.5);
ATTRIB(XonoticHUDAmmoDialog, columns, float, 4);
ATTRIB(XonoticHUDAmmoDialog, name, string, "HUDammo");
ATTRIB(XonoticHUDAmmoDialog, requiresConnection, float, true);
entity e;
string panelname = "centerprint";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TDempty(me, 0.2);
ATTRIB(XonoticHUDCenterprintDialog, title, string, _("Centerprint Panel"));
ATTRIB(XonoticHUDCenterprintDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDCenterprintDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDCenterprintDialog, rows, float, 15);
+ ATTRIB(XonoticHUDCenterprintDialog, rows, float, 15.5);
ATTRIB(XonoticHUDCenterprintDialog, columns, float, 4);
ATTRIB(XonoticHUDCenterprintDialog, name, string, "HUDcenterprint");
ATTRIB(XonoticHUDCenterprintDialog, requiresConnection, float, true);
entity e;
string panelname = "chat";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Chat entries:")));
ATTRIB(XonoticHUDChatDialog, title, string, _("Chat Panel"));
ATTRIB(XonoticHUDChatDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDChatDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDChatDialog, rows, float, 15);
+ ATTRIB(XonoticHUDChatDialog, rows, float, 15.5);
ATTRIB(XonoticHUDChatDialog, columns, float, 4);
ATTRIB(XonoticHUDChatDialog, name, string, "HUDchat");
ATTRIB(XonoticHUDChatDialog, requiresConnection, float, true);
entity e;
string panelname = "engineinfo";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Engine info:")));
ATTRIB(XonoticHUDEngineInfoDialog, title, string, _("Engine Info Panel"));
ATTRIB(XonoticHUDEngineInfoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDEngineInfoDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDEngineInfoDialog, rows, float, 15);
+ ATTRIB(XonoticHUDEngineInfoDialog, rows, float, 15.5);
ATTRIB(XonoticHUDEngineInfoDialog, columns, float, 4);
ATTRIB(XonoticHUDEngineInfoDialog, name, string, "HUDengineinfo");
ATTRIB(XonoticHUDEngineInfoDialog, requiresConnection, float, true);
entity e;
string panelname = "healtharmor";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_combined", _("Combine health and armor")));
ATTRIB(XonoticHUDHealthArmorDialog, title, string, _("Health/Armor Panel"));
ATTRIB(XonoticHUDHealthArmorDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDHealthArmorDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 16);
+ ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 16.5);
ATTRIB(XonoticHUDHealthArmorDialog, columns, float, 4);
ATTRIB(XonoticHUDHealthArmorDialog, name, string, "HUDhealtharmor");
ATTRIB(XonoticHUDHealthArmorDialog, requiresConnection, float, true);
entity e;
string panelname = "infomessages";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Info messages:")));
ATTRIB(XonoticHUDInfoMessagesDialog, title, string, _("Info Messages Panel"));
ATTRIB(XonoticHUDInfoMessagesDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDInfoMessagesDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDInfoMessagesDialog, rows, float, 15);
+ ATTRIB(XonoticHUDInfoMessagesDialog, rows, float, 15.5);
ATTRIB(XonoticHUDInfoMessagesDialog, columns, float, 4);
ATTRIB(XonoticHUDInfoMessagesDialog, name, string, "HUDinfomessages");
ATTRIB(XonoticHUDInfoMessagesDialog, requiresConnection, float, true);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextSlider("hud_panel_itemstime"));
- e.addValue(e, ZCTX(_("PNL^Disabled")), "0");
- e.addValue(e, ZCTX(_("PNL^Enabled spectating")), "1");
- e.addValue(e, ZCTX(_("PNL^Enabled even playing in warmup")), "2");
+ e.addValue(e, _("Disable"), "0");
+ e.addValue(e, _("Enable spectating"), "1");
+ e.addValue(e, _("Enable even playing in warmup"), "2");
e.configureXonoticTextSliderValues(e);
- DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Align icon:")));
ATTRIB(XonoticHUDItemsTimeDialog, title, string, _("Items Time Panel"));
ATTRIB(XonoticHUDItemsTimeDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDItemsTimeDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDItemsTimeDialog, rows, float, 15);
+ ATTRIB(XonoticHUDItemsTimeDialog, rows, float, 15.5);
ATTRIB(XonoticHUDItemsTimeDialog, columns, float, 4);
ATTRIB(XonoticHUDItemsTimeDialog, name, string, "HUDitemstime");
ENDCLASS(XonoticHUDItemsTimeDialog)
entity e;
string panelname = "modicons";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
}
ATTRIB(XonoticHUDModIconsDialog, title, string, _("Mod Icons Panel"));
ATTRIB(XonoticHUDModIconsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDModIconsDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDModIconsDialog, rows, float, 15);
+ ATTRIB(XonoticHUDModIconsDialog, rows, float, 15.5);
ATTRIB(XonoticHUDModIconsDialog, columns, float, 4);
ATTRIB(XonoticHUDModIconsDialog, name, string, "HUDmodicons");
ATTRIB(XonoticHUDModIconsDialog, requiresConnection, float, true);
entity e;
string panelname = "notify";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Notifications:")));
ATTRIB(XonoticHUDNotificationDialog, title, string, _("Notification Panel"));
ATTRIB(XonoticHUDNotificationDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDNotificationDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDNotificationDialog, rows, float, 15);
+ ATTRIB(XonoticHUDNotificationDialog, rows, float, 15.5);
ATTRIB(XonoticHUDNotificationDialog, columns, float, 4);
ATTRIB(XonoticHUDNotificationDialog, name, string, "HUDnotify");
ATTRIB(XonoticHUDNotificationDialog, requiresConnection, float, true);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextSlider("hud_panel_physics"));
- e.addValue(e, _("Panel disabled"), "0");
- e.addValue(e, _("Panel enabled"), "1");
- e.addValue(e, _("Panel enabled even observing"), "2");
- e.addValue(e, _("Panel enabled only in Race/CTS"), "3");
+ e.addValue(e, _("Disable"), "0");
+ e.addValue(e, _("Enable"), "1");
+ e.addValue(e, _("Enable even observing"), "2");
+ e.addValue(e, _("Enable only in Race/CTS"), "3");
e.configureXonoticTextSliderValues(e);
- DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 1.4, e = makeXonoticCheckBox(0, "hud_panel_physics_progressbar", _("Status bar")));
ATTRIB(XonoticHUDPhysicsDialog, title, string, _("Physics Panel"));
ATTRIB(XonoticHUDPhysicsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDPhysicsDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDPhysicsDialog, rows, float, 15);
+ ATTRIB(XonoticHUDPhysicsDialog, rows, float, 15.5);
ATTRIB(XonoticHUDPhysicsDialog, columns, float, 4);
ATTRIB(XonoticHUDPhysicsDialog, name, string, "HUDphysics");
ATTRIB(XonoticHUDPhysicsDialog, sliderTopspeedTime, entity);
entity e;
string panelname = "powerups";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_powerups_progressbar", _("Enable status bar")));
ATTRIB(XonoticHUDPowerupsDialog, title, string, _("Powerups Panel"));
ATTRIB(XonoticHUDPowerupsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDPowerupsDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDPowerupsDialog, rows, float, 14);
+ ATTRIB(XonoticHUDPowerupsDialog, rows, float, 15.5);
ATTRIB(XonoticHUDPowerupsDialog, columns, float, 4);
ATTRIB(XonoticHUDPowerupsDialog, name, string, "HUDpowerups");
ATTRIB(XonoticHUDPowerupsDialog, requiresConnection, float, true);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextSlider("hud_panel_pressedkeys"));
- e.addValue(e, _("Panel disabled"), "0");
- e.addValue(e, _("Panel enabled when spectating"), "1");
- e.addValue(e, _("Panel always enabled"), "2");
+ e.addValue(e, ("Disable"), "0");
+ e.addValue(e, ("Enable when spectating"), "1");
+ e.addValue(e, ("Always enable"), "2");
e.configureXonoticTextSliderValues(e);
- DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TDempty(me, 0.2);
ATTRIB(XonoticHUDPressedKeysDialog, title, string, _("Pressed Keys Panel"));
ATTRIB(XonoticHUDPressedKeysDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDPressedKeysDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDPressedKeysDialog, rows, float, 15);
+ ATTRIB(XonoticHUDPressedKeysDialog, rows, float, 15.5);
ATTRIB(XonoticHUDPressedKeysDialog, columns, float, 4);
ATTRIB(XonoticHUDPressedKeysDialog, name, string, "HUDpressedkeys");
ATTRIB(XonoticHUDPressedKeysDialog, requiresConnection, float, true);
entity e;
string panelname = "quickmenu";
- DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+ // this panel has no main cvar
+ //dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Text alignment:")));
ATTRIB(XonoticHUDQuickMenuDialog, title, string, _("Quick Menu Panel"));
ATTRIB(XonoticHUDQuickMenuDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDQuickMenuDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDQuickMenuDialog, rows, float, 15);
+ ATTRIB(XonoticHUDQuickMenuDialog, rows, float, 15.5);
ATTRIB(XonoticHUDQuickMenuDialog, columns, float, 4);
ATTRIB(XonoticHUDQuickMenuDialog, name, string, "HUDquickmenu");
ENDCLASS(XonoticHUDQuickMenuDialog)
entity e;
string panelname = "racetimer";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
}
ATTRIB(XonoticHUDRaceTimerDialog, title, string, _("Race Timer Panel"));
ATTRIB(XonoticHUDRaceTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDRaceTimerDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDRaceTimerDialog, rows, float, 15);
+ ATTRIB(XonoticHUDRaceTimerDialog, rows, float, 15.5);
ATTRIB(XonoticHUDRaceTimerDialog, columns, float, 4);
ATTRIB(XonoticHUDRaceTimerDialog, name, string, "HUDracetimer");
ATTRIB(XonoticHUDRaceTimerDialog, requiresConnection, float, true);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextSlider("hud_panel_radar"));
- e.addValue(e, _("Panel disabled"), "0");
- e.addValue(e, _("Panel enabled in teamgames"), "1");
- e.addValue(e, _("Panel always enabled"), "2");
+ e.addValue(e, _("Disable"), "0");
+ e.addValue(e, _("Enable in team games"), "1");
+ e.addValue(e, _("Always enable"), "2");
e.configureXonoticTextSliderValues(e);
- DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Radar:")));
ATTRIB(XonoticHUDRadarDialog, title, string, _("Radar Panel"));
ATTRIB(XonoticHUDRadarDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDRadarDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDRadarDialog, rows, float, 15);
+ ATTRIB(XonoticHUDRadarDialog, rows, float, 15.5);
ATTRIB(XonoticHUDRadarDialog, columns, float, 4);
ATTRIB(XonoticHUDRadarDialog, name, string, "HUDradar");
ATTRIB(XonoticHUDRadarDialog, requiresConnection, float, true);
entity e;
string panelname = "score";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Score:")));
ATTRIB(XonoticHUDScoreDialog, title, string, _("Score Panel"));
ATTRIB(XonoticHUDScoreDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDScoreDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDScoreDialog, rows, float, 15);
+ ATTRIB(XonoticHUDScoreDialog, rows, float, 15.5);
ATTRIB(XonoticHUDScoreDialog, columns, float, 4);
ATTRIB(XonoticHUDScoreDialog, name, string, "HUDscore");
ATTRIB(XonoticHUDScoreDialog, requiresConnection, float, true);
entity e;
string panelname = "timer";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Timer:")));
ATTRIB(XonoticHUDTimerDialog, title, string, _("Timer Panel"));
ATTRIB(XonoticHUDTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDTimerDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDTimerDialog, rows, float, 15);
+ ATTRIB(XonoticHUDTimerDialog, rows, float, 15.5);
ATTRIB(XonoticHUDTimerDialog, columns, float, 4);
ATTRIB(XonoticHUDTimerDialog, name, string, "HUDtimer");
ATTRIB(XonoticHUDTimerDialog, requiresConnection, float, true);
entity e;
string panelname = "vote";
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Alpha after voting:")));
ATTRIB(XonoticHUDVoteDialog, title, string, _("Vote Panel"));
ATTRIB(XonoticHUDVoteDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDVoteDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDVoteDialog, rows, float, 15);
+ ATTRIB(XonoticHUDVoteDialog, rows, float, 15.5);
ATTRIB(XonoticHUDVoteDialog, columns, float, 4);
ATTRIB(XonoticHUDVoteDialog, name, string, "HUDvote");
ATTRIB(XonoticHUDVoteDialog, requiresConnection, float, true);
string panelname = "weapons";
float i;
- DIALOG_HUDPANEL_COMMON();
+ dialog_hudpanel_main_checkbox(me, panelname);
+
+ dialog_hudpanel_main_settings(me, panelname);
me.TR(me);
me.TDempty(me, 0.2);
ATTRIB(XonoticHUDWeaponsDialog, title, string, _("Weapons Panel"));
ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
ATTRIB(XonoticHUDWeaponsDialog, intendedWidth, float, 0.4);
- ATTRIB(XonoticHUDWeaponsDialog, rows, float, 21);
+ ATTRIB(XonoticHUDWeaponsDialog, rows, float, 21.5);
ATTRIB(XonoticHUDWeaponsDialog, columns, float, 4);
ATTRIB(XonoticHUDWeaponsDialog, name, string, "HUDweapons");
ATTRIB(XonoticHUDWeaponsDialog, requiresConnection, float, true);
string WeaponArenaString()
{
string s;
- float n, i;
+ float n;
s = cvar_string("g_weaponarena");
if(s == "0")
return "";
n = tokenize_console(s);
s = "";
- for(i = 0; i < n; ++i)
+ for(int j = 0; j < n; ++j)
{
FOREACH(Weapons, it != WEP_Null, {
- if(argv(i) == it.netname)
- s = strcat(s, " & ", it.m_name);
+ if(argv(j) == it.netname)
+ s = cons_mid(s, " & ", it.m_name);
});
}
- s = sprintf(_("%s Arena"), substring(s, 3, strlen(s) - 3));
+ s = sprintf(_("%s Arena"), s);
weaponarenastring = strzone(s);
case "overall/last_seen_dt":
{
order = 1;
- outstr = _("Last seen:");
+ outstr = _("Last match:");
data = XonoticStatsList_convertDate(car(data));
break;
}
entity makeXonoticCheckBox(float, string, string);
.bool sendCvars;
-void dialog_hudpanel_common_notoggle(entity me, string panelname)
+void dialog_hudpanel_main_checkbox(entity me, string panelname)
{
- float i;
entity e;
me.TR(me);
+ me.TDempty(me, 1.5);
+ me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, strzone(strcat("hud_panel_", panelname)), _("Enable")));
+}
+
+void dialog_hudpanel_main_settings(entity me, string panelname)
+{
+ float i;
+ entity e;
+
+ me.gotoRC(me, me.currentRow + 1.5, 0);
me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Background:")));
me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
e.addValue(e, _("Default"), "");
int GameType_GetCount();
int GameType_GetTotalCount();
-void dialog_hudpanel_common_notoggle(entity me, string panelname);
-#define DIALOG_HUDPANEL_COMMON_NOTOGGLE() \
- dialog_hudpanel_common_notoggle(me, panelname)
-#define DIALOG_HUDPANEL_COMMON() \
- me.TR(me); \
- me.TD(me, 1, 4, e = makeXonoticCheckBox(0, strzone(strcat("hud_panel_", panelname)), _("Enable panel"))); \
- DIALOG_HUDPANEL_COMMON_NOTOGGLE()
+void dialog_hudpanel_main_checkbox(entity me, string panelname);
+void dialog_hudpanel_main_settings(entity me, string panelname);
float getFadedAlpha(float currentAlpha, float startAlpha, float targetAlpha);
float autocvar_g_respawn_ghosts_maxtime;
float autocvar_g_respawn_ghosts_speed;
int autocvar_g_respawn_waves;
-bool autocvar_g_shootfromcenter;
-bool autocvar_g_shootfromeye;
string autocvar_g_shootfromfixedorigin;
int autocvar_g_showweaponspawns;
bool autocvar_g_spawn_alloweffects;
if(this.bot_attack)
IL_REMOVE(g_bot_targets, this);
this.bot_attack = false;
+ if(this.monster_attack)
+ IL_REMOVE(g_monster_targets, this);
+ this.monster_attack = false;
STAT(HUD, this) = HUD_NORMAL;
TRANSMUTE(Observer, this);
this.iscreature = false;
this.strength_finished = 0;
this.invincible_finished = 0;
this.superweapons_finished = 0;
+ this.dphitcontentsmask = 0;
this.pushltime = 0;
this.istypefrag = 0;
setthink(this, func_null);
stuffcmd(e, sprintf("\ncl_jumpspeedcap_min \"%s\"\n", autocvar_sv_jumpspeedcap_min));
stuffcmd(e, sprintf("\ncl_jumpspeedcap_max \"%s\"\n", autocvar_sv_jumpspeedcap_max));
+ stuffcmd(e, sprintf("\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
+
MUTATOR_CALLHOOK(FixClientCvars, e);
}
}
.int items_added;
+.string shootfromfixedorigin;
bool PlayerThink(entity this)
{
if (game_stopped || intermission_running) {
FixPlayermodel(this);
+ if (this.shootfromfixedorigin != autocvar_g_shootfromfixedorigin) {
+ this.shootfromfixedorigin = autocvar_g_shootfromfixedorigin;
+ stuffcmd(this, sprintf("\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
+ }
+
// LordHavoc: allow firing on move frames (sub-ticrate), this gives better timing on slow servers
//if(frametime)
{
store.v_angle = this.v_angle;
store.movement = this.movement;
}
+
+NET_HANDLE(fpsreport, bool)
+{
+ int fps = ReadShort();
+ PlayerScore_Set(sender, SP_FPS, fps);
+ return true;
+}
return s.(scores(scorefield));
}
+float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score)
+{
+ if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
+ entity s = CS(player).scorekeeper;
+ if(!s)
+ {
+ if(game_stopped)
+ return 0;
+ LOG_WARN("Setting score of unknown player!");
+ return 0;
+ }
+
+ float oldscore = s.(scores(scorefield));
+ if(oldscore == score)
+ return oldscore;
+
+ if(scores_label(scorefield) != "")
+ s.SendFlags |= (2 ** (scorefield.m_id % 16));
+ s.(scores(scorefield)) = score;
+ return s.(scores(scorefield));
+}
+
float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score)
{
float r;
*/
float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score);
+/**
+ * Sets the player's score to the score parameter.
+ * NEVER call this if PlayerScore_Attach has not been called yet!
+ * Means: FIXME make players unable to join the game when not called ClientConnect yet.
+ * Returns the new (or old if unchanged) score.
+ */
+float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score);
+
/**
* \brief Returns the player's score.
* \param[in] player Player to inspect.
ScoreInfo_SetLabel_PlayerScore(SP_DMG, "dmg", 0);
ScoreInfo_SetLabel_PlayerScore(SP_DMGTAKEN, "dmgtaken", SFL_LOWER_IS_BETTER);
ScoreInfo_SetLabel_PlayerScore(SP_ELO, "elo", 0);
+
+ if(STAT(SHOWFPS))
+ ScoreInfo_SetLabel_PlayerScore(SP_FPS, "fps", 0);
}
void ScoreRules_basics_end()
{
set sv_showspectators 1 "Show who's spectating who in the player info panel when client has cl_showspectators on. Shouldn't be used on competitive servers, also disable when watching a suspected cheater"
set sv_damagetext 2 "<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage"
+
+set sv_showfps 5 "Show player's FPS counters in the scoreboard. This setting acts as a delay in seconds between updates"