]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/monsters
authorMario <mario@smbclan.net>
Mon, 5 Mar 2018 13:32:17 +0000 (23:32 +1000)
committerMario <mario@smbclan.net>
Mon, 5 Mar 2018 13:32:17 +0000 (23:32 +1000)
65 files changed:
.tx/merge-base
bal-wep-xonotic.cfg
effectinfo.txt
languages.txt
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/main.qc
qcsrc/client/view.qc
qcsrc/common/effects/effectinfo.inc
qcsrc/common/net_linked.qh
qcsrc/common/physics/player.qc
qcsrc/common/scores.qh
qcsrc/common/stats.qh
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon/arc.qc
qcsrc/lib/net.qh
qcsrc/lib/string.qh
qcsrc/menu/xonotic/dialog_hudpanel_ammo.qc
qcsrc/menu/xonotic/dialog_hudpanel_ammo.qh
qcsrc/menu/xonotic/dialog_hudpanel_centerprint.qc
qcsrc/menu/xonotic/dialog_hudpanel_centerprint.qh
qcsrc/menu/xonotic/dialog_hudpanel_chat.qc
qcsrc/menu/xonotic/dialog_hudpanel_chat.qh
qcsrc/menu/xonotic/dialog_hudpanel_engineinfo.qc
qcsrc/menu/xonotic/dialog_hudpanel_engineinfo.qh
qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qc
qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qh
qcsrc/menu/xonotic/dialog_hudpanel_infomessages.qc
qcsrc/menu/xonotic/dialog_hudpanel_infomessages.qh
qcsrc/menu/xonotic/dialog_hudpanel_itemstime.qc
qcsrc/menu/xonotic/dialog_hudpanel_itemstime.qh
qcsrc/menu/xonotic/dialog_hudpanel_modicons.qc
qcsrc/menu/xonotic/dialog_hudpanel_modicons.qh
qcsrc/menu/xonotic/dialog_hudpanel_notification.qc
qcsrc/menu/xonotic/dialog_hudpanel_notification.qh
qcsrc/menu/xonotic/dialog_hudpanel_physics.qc
qcsrc/menu/xonotic/dialog_hudpanel_physics.qh
qcsrc/menu/xonotic/dialog_hudpanel_powerups.qc
qcsrc/menu/xonotic/dialog_hudpanel_powerups.qh
qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.qc
qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.qh
qcsrc/menu/xonotic/dialog_hudpanel_quickmenu.qc
qcsrc/menu/xonotic/dialog_hudpanel_quickmenu.qh
qcsrc/menu/xonotic/dialog_hudpanel_racetimer.qc
qcsrc/menu/xonotic/dialog_hudpanel_racetimer.qh
qcsrc/menu/xonotic/dialog_hudpanel_radar.qc
qcsrc/menu/xonotic/dialog_hudpanel_radar.qh
qcsrc/menu/xonotic/dialog_hudpanel_score.qc
qcsrc/menu/xonotic/dialog_hudpanel_score.qh
qcsrc/menu/xonotic/dialog_hudpanel_timer.qc
qcsrc/menu/xonotic/dialog_hudpanel_timer.qh
qcsrc/menu/xonotic/dialog_hudpanel_vote.qc
qcsrc/menu/xonotic/dialog_hudpanel_vote.qh
qcsrc/menu/xonotic/dialog_hudpanel_weapons.qc
qcsrc/menu/xonotic/dialog_hudpanel_weapons.qh
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc
qcsrc/menu/xonotic/statslist.qc
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh
qcsrc/server/autocvars.qh
qcsrc/server/client.qc
qcsrc/server/scores.qc
qcsrc/server/scores.qh
qcsrc/server/scores_rules.qc
xonotic-server.cfg

index 946c98fc60de9289488e12b541a279166d439105..5c25368a0fb130a6bc02dc6a8b23b503520a3077 100644 (file)
@@ -1 +1 @@
-Fri Mar  2 07:24:40 CET 2018
+Sat Mar  3 07:23:44 CET 2018
index ac5be34f3783b822759d7b26922629c1adedd52b..2fb8464099e82c71738711fcd5d834ad7a883058 100644 (file)
@@ -750,11 +750,11 @@ set g_balance_arc_beam_heat 0
 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
index b2544fa0740c89e540773baa6b08dd9cd12483c0..128169c502911d760c7de4707850887c805f6284 100644 (file)
@@ -7581,6 +7581,15 @@ effect arc_lightning
        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
index ecf13d7f2f7bc91fa90df2e26e9aa90ed157f930..03be75cf7729d3fd20f619553aa25e6c63f15ba1 100644 (file)
@@ -1,24 +1,24 @@
-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%
index 200f5b2c55b575ab5b22efa18b2f9c0017ba1f93..f914df7dde266da81b331c964f871183c8e9030c 100644 (file)
@@ -309,6 +309,7 @@ void Cmd_Scoreboard_Help()
        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"));
@@ -359,7 +360,7 @@ void Cmd_Scoreboard_Help()
 // 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" \
@@ -464,6 +465,7 @@ void Cmd_Scoreboard_SetFields(int argc)
                        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, {
@@ -679,6 +681,19 @@ string Scoreboard_GetField(entity pl, PlayerScoreField field)
                        }
                }
 
+               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);
 
index f0b8aac6c9ee3b69d1c4c51abfde9cf98f7c23ca..9c146c09bd9115091c24585fc02c323558b75d19 100644 (file)
@@ -134,6 +134,8 @@ void CSQC_Init()
        registercvar("cl_jumpspeedcap_min", "");
        registercvar("cl_jumpspeedcap_max", "");
 
+       registercvar("cl_shootfromfixedorigin", "");
+
        registercvar("cl_multijump", "1");
 
        registercvar("cl_spawn_near_teammate", "1");
index 9bfa8db9ad0d6e51590150d28896883626528716..dd184bee9bbeb7d8dfcf3f5eb75abf7337d330b5 100644 (file)
@@ -370,6 +370,35 @@ STATIC_INIT(viewmodel) {
        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)
 {
@@ -1866,6 +1895,7 @@ void CSQC_UpdateView(entity this, float w, float h)
 
        TargetMusic_Advance();
        Fog_Force();
+       fpscounter_update();
 
        if(drawtime == 0)
                drawframetime = 0.01666667; // when we don't know fps yet, we assume 60fps
index 56303a44ffa93f36443bf4a3131baa015f361e82..b659e8a8517a83755718d93ea06c03c9a9989db8 100644 (file)
@@ -8529,6 +8529,22 @@ SUB(arc_lightning) {
        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
index 7b69ad5030c9fb9d6ec510612001f2551f37e255..657e761712250cc7aed93ec4f3d93747979588f6 100644 (file)
@@ -55,3 +55,5 @@ REGISTER_NET_LINKED(ENT_CLIENT_SPAWNEVENT)
 REGISTER_NET_LINKED(ENT_CLIENT_WALL)
 
 #include <lib/csqcmodel/net.qh>
+
+REGISTER_NET_C2S(fpsreport)
index 7d3cab007b508fa6dafceb84a14585d0fd68f327..351725bc14698fe92da40c5aa533947e5a7e0381 100644 (file)
@@ -113,8 +113,8 @@ void PM_ClientMovement_UpdateStatus(entity this)
                        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))
index 476d0dbbaa612445241bd1450c48642a7f78f347..377a780770300554275d3685e3e6d53e90122bb8 100644 (file)
@@ -39,6 +39,8 @@ REGISTER_SP(FRAGS);
 
 REGISTER_SP(ELO);
 
+REGISTER_SP(FPS);
+
 // TODO: move to common mutators
 
 REGISTER_SP(RACE_TIME);
index 69d3a4f583326714cc89f44f23fe2d097f3a993d..648ef60e844b8f316662ea633e5c6ac3ca2a12dc 100644 (file)
@@ -121,6 +121,11 @@ REGISTER_STAT(ENTRAP_ORB_ALPHA, float)
 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
@@ -299,6 +304,13 @@ REGISTER_STAT(SLICK_APPLYGRAVITY, bool, autocvar_sv_slick_applygravity)
 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)
index 5c51c2d87b4da7071b8dcde95671038f3618e630..dca20d0cdbf1b627bf920ddee47aeb93c60ce58d 100644 (file)
@@ -293,24 +293,21 @@ vector shotorg_adjustfromclient(vector vecs, float y_is_right, float algn)
 
 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;
@@ -318,7 +315,6 @@ vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn
                vecs.y = v.y;
                vecs.z = v.z;
        }
-#endif
        else  // just do the same as top
        {
                vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
index beaa6cb48a3773e2555b4817177696242b7b7e43..0af47590078a8dde4c44257de429ff240e0dd19e 100644 (file)
@@ -359,6 +359,13 @@ ENUMCLASS_END(WFRAME)
 
 .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
index 21ca117f4c4ec89980bbb60f9e34e3c4b88a549c..e5d4f2eb23253dccbe414e522d0bc5ec84e8c1f0 100644 (file)
@@ -752,6 +752,9 @@ METHOD(Arc, wr_playerdeath, void(entity thiswep, entity actor, .entity weaponent
 #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))
 {
@@ -802,32 +805,37 @@ void Draw_ArcBeam_callback(vector start, vector hit, vector end)
        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:
@@ -884,17 +892,30 @@ void Draw_ArcBeam(entity this)
                // 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,
@@ -911,9 +932,16 @@ void Draw_ArcBeam(entity this)
                        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;
 
@@ -1119,7 +1147,7 @@ void Draw_ArcBeam(entity this)
                        )
                );
        }
-       if(this.beam_muzzleeffect)
+       if(this.beam_muzzleeffect && autocvar_r_drawviewmodel)
        {
                pointparticles(
                        this.beam_muzzleeffect,
@@ -1160,11 +1188,13 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
        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;
@@ -1271,18 +1301,18 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
                                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;
                        }
@@ -1297,18 +1327,18 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
                                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;
                        }
@@ -1323,18 +1353,18 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
                                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;
                        }
@@ -1349,18 +1379,18 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
                                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;
                        }
@@ -1375,18 +1405,18 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
                                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;
                        }
@@ -1401,18 +1431,18 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
                                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;
                        }
@@ -1427,18 +1457,18 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
                                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;
                        }
@@ -1453,18 +1483,18 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
                                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;
                        }
@@ -1481,18 +1511,18 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
                                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;
                        }
index b1f5326a9bb5a441b5094de347cfe973086d5bd6..fe2952e2c4025c3d5f84854627824cc3f4ab3d6f 100644 (file)
@@ -304,6 +304,11 @@ MACRO_END
                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()
        {
@@ -311,6 +316,10 @@ MACRO_END
                ydec_single(g_buf, ret);
                return ret;
        }
+       int ReadShort()
+       {
+               return (ReadByte() << 8) | (ReadByte());
+       }
        void WriteByte(int to, int b);
 #endif
 
index 0a3fb085c1d5fb988298073071745b829578cb3d..812eb72c8424bf2ab19f3d04fc30bf01522f3213 100644 (file)
@@ -161,6 +161,14 @@ string cons(string a, string b)
        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)
 {
index 2e67e7acf861294bb39a6d97bf2a5155e008eaac..611ef4a45e714de1b8292f68904659f3891e9b98 100644 (file)
@@ -10,7 +10,9 @@ void XonoticHUDAmmoDialog_fill(entity me)
        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:")));
index 9113a02794b1b08f810b009dd491c06fd8be7ab6..3af373e4388d30ee7b9c5623c623625f2b789e60 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDAmmoDialog, XonoticRootDialog)
        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);
index 332f6753f76d62273411801ab6cd584f46077a9a..938f69a8c57be823a7d95857e70101d37569c2c2 100644 (file)
@@ -10,7 +10,9 @@ void XonoticHUDCenterprintDialog_fill(entity me)
        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);
index 9fc6846eb9a0d5d044a27ed4c99937190ab3137c..2b952580ecb6e055ae51a1b6bd219d091f73d5de 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDCenterprintDialog, XonoticRootDialog)
        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);
index 1ffa41f68c802d9c1cdb96995f2aa50619db762e..d1612412e66c8d419f0887b002534c070c091c88 100644 (file)
@@ -9,7 +9,9 @@ void XonoticHUDChatDialog_fill(entity me)
        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:")));
index 570c2d616cde334e7402acc4d061ccad7c299d5d..da2f329bbaa57503569d16c8d1ed5630a2d59052 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDChatDialog, XonoticRootDialog)
        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);
index b46d3aa02eff1fbd791331d3ac731c394506f426..ef63756870dd8d587901593ab2511efd65b99395 100644 (file)
@@ -8,7 +8,9 @@ void XonoticHUDEngineInfoDialog_fill(entity me)
        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:")));
index b741465024d78a9917639aedabd61c209ae026ca..706767146c776c621c6304fe618be4f2164eabf0 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDEngineInfoDialog, XonoticRootDialog)
        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);
index ac305b83258638cd4352305a7071d338a5d85b3d..e67f63ffcda27281ceb077c18c979baa3f097700 100644 (file)
@@ -9,7 +9,9 @@ void XonoticHUDHealthArmorDialog_fill(entity me)
        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")));
index b37f41b76ef5f1ecf91a8d2056d2fe8cab68a98e..9342e293306137427ea3d339b34dcf49b749cc85 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDHealthArmorDialog, XonoticRootDialog)
        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);
index d758ad206643dcdba154fbfe48be74eca5726b58..6b11a691513c236689e8395df6f798968abd85ff 100644 (file)
@@ -8,7 +8,9 @@ void XonoticHUDInfoMessagesDialog_fill(entity me)
        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:")));
index 5d9032ffb0fdf3e307190fd5a77353b425b5a099..a6370d33e30e88d9566d3508d8ad49d0f3cabf22 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDInfoMessagesDialog, XonoticRootDialog)
        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);
index aeb8c8c774d639fa11a2073135e343e9d8c78f33..32264c5bcd32789aa21add5f6644a67e8a3d95ff 100644 (file)
@@ -13,12 +13,12 @@ void XonoticHUDItemsTimeDialog_fill(entity me)
 
        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:")));
index 507dedb7c95cc068adc2d478cf4a83795c72e620..0cb74ea6770fd64031c99f00a93ba45c70076327 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDItemsTimeDialog, XonoticRootDialog)
        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)
index 53cad1a930383ca693df2d8c5aa2419255df556b..afc47af30d4570768fb95cc48d12bfd4fb93ef97 100644 (file)
@@ -7,5 +7,7 @@ void XonoticHUDModIconsDialog_fill(entity me)
        entity e;
        string panelname = "modicons";
 
-       DIALOG_HUDPANEL_COMMON();
+       dialog_hudpanel_main_checkbox(me, panelname);
+
+       dialog_hudpanel_main_settings(me, panelname);
 }
index 3a3b72f6c9989df94d4695b135ed30f96f6186e5..a59d09af4b008950114dd03ee860cec51a0e694d 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDModIconsDialog, XonoticRootDialog)
        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);
index 490051846e378fd7835c50d684d9294083ef0ddc..1dc0a15b70617ec0cc42d17a90b93c9bacfca8bb 100644 (file)
@@ -9,7 +9,9 @@ void XonoticHUDNotificationDialog_fill(entity me)
        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:")));
index f816e4ffe042fd9d6f6f6ba84c46cecbdddc97b6..be51051f6c2b9acd138acd192c2677a5e46d606e 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDNotificationDialog, XonoticRootDialog)
        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);
index eabc93dab51021e7c44b1ac2cbe8dab9eda843ec..3a1e0bee1822a42e2fd363323e8f41cec73296f4 100644 (file)
@@ -12,13 +12,13 @@ void XonoticHUDPhysicsDialog_fill(entity me)
 
        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")));
index f6f19135d1f7a257d001d4af567bd01d50d03adc..2a52bef91b8841e8f60e42a6f83e31f476e6363f 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDPhysicsDialog, XonoticRootDialog)
        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);
index 1b490d10272fdb3dc8bb28ee3d337b483afd751b..7e0ffae1a4137a46d20cccd1b96269d56349de6f 100644 (file)
@@ -9,7 +9,9 @@ void XonoticHUDPowerupsDialog_fill(entity me)
        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")));
index 7f67fa6007b6f2423dfd54158ead5a20f038f36d..c82f98278095b5aed91d1501e59657be65aa3b64 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDPowerupsDialog, XonoticRootDialog)
        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);
index 4e24ff998eeb67f2b0351d999056784898dfc7af..30d95721090c17406c900b865d8ccab8d7bac3d6 100644 (file)
@@ -11,12 +11,12 @@ void XonoticHUDPressedKeysDialog_fill(entity me)
 
        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);
index cc82959e6443af3c3ffc594da63504f66cf399dd..46452c696dfa76469fa3fe3b3ccd2b1dec78ed56 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDPressedKeysDialog, XonoticRootDialog)
        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);
index 4012bc61ac13b64975a57ff9c47e8bf356432af6..128951c0c8acfbde8bc5d33e84af28d49ca74776 100644 (file)
@@ -9,7 +9,10 @@ void XonoticHUDQuickMenuDialog_fill(entity me)
        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:")));
index 16f93c13d584579397f754ca3a78ec9dcdba7de4..ac6693a648155fe71a93257c7f7cc42d36ce583c 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDQuickMenuDialog, XonoticRootDialog)
        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)
index 2673e546039a5afc5fb86d72e25e78193f1ce201..d4bbe51f56451c941c4ac312b0384b46f48ab00e 100644 (file)
@@ -7,5 +7,7 @@ void XonoticHUDRaceTimerDialog_fill(entity me)
        entity e;
        string panelname = "racetimer";
 
-       DIALOG_HUDPANEL_COMMON();
+       dialog_hudpanel_main_checkbox(me, panelname);
+
+       dialog_hudpanel_main_settings(me, panelname);
 }
index 7c814e3823e3586d7a2c9d14edb9a2a688f67cd0..81a8f005341aa3c5be0c3b4549ecc39710a6ce56 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDRaceTimerDialog, XonoticRootDialog)
        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);
index de9ed6898b821e7df49781fcb2176c85fcd103a1..3e8db6686c09b79c96b6096eb6d9052a245b65b1 100644 (file)
@@ -12,12 +12,12 @@ void XonoticHUDRadarDialog_fill(entity me)
 
        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:")));
index 04617b677f4c04a7444cf5de08444c1c67532f25..d02f5cd59298fe3b45bba6ca0aefd81f0c8c6d06 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDRadarDialog, XonoticRootDialog)
        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);
index f04ca30da9397f358055366fa8bb726398847078..afb97e5fd42de9a8fed0ce82d6352bb22a9fddd9 100644 (file)
@@ -9,7 +9,9 @@ void XonoticHUDScoreDialog_fill(entity me)
        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:")));
index d97787404e921121ce3453be7f8a42bfd1a940fb..20fa6cf967f86aa1a26a4644f32aaf4ae652e2a3 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDScoreDialog, XonoticRootDialog)
        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);
index dd9a7b8788923f0a5f424e9e76c6655ce248c226..84c6d862dbebb8a4644e2546516a9d9b70a71de1 100644 (file)
@@ -8,7 +8,9 @@ void XonoticHUDTimerDialog_fill(entity me)
        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:")));
index 61955495edd4c7ac985ee989c39fe2d23b27cf3c..dac91cc2a67a57ec9fe1e79f9568a98857179931 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDTimerDialog, XonoticRootDialog)
        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);
index e8afa7ca706b91a71b050c9af2c12de684924bf4..39c9a69f707a0465aee72da99363c2c5123ae72c 100644 (file)
@@ -9,7 +9,9 @@ void XonoticHUDVoteDialog_fill(entity me)
        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:")));
index 061c69e56c4797b3d904739b0adcedfe97d79bba..b07b189e5b81d031ccd8069a053e117eec7271d5 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDVoteDialog, XonoticRootDialog)
        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);
index 61339b6b938cc54800e1326bba256b00d08488a4..116b8ae2f06798a47e1854b5306c6eb58130acf9 100644 (file)
@@ -13,7 +13,9 @@ void XonoticHUDWeaponsDialog_fill(entity me)
        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);
index fad14749e6f4665f00b4c460c238a018811d0f37..4f877d4d3f3419e444f0fbbab65c7bbde913d970 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDWeaponsDialog, XonoticRootDialog)
        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);
index 0ea24a8891931157853a55fe461888271abd5947..f8bf895c2467b55c5ba80c4a84771aa271851826 100644 (file)
@@ -20,7 +20,7 @@ string weaponarenastring_cvar;
 string WeaponArenaString()
 {
        string s;
-       float n, i;
+       float n;
        s = cvar_string("g_weaponarena");
        if(s == "0")
                return "";
@@ -39,14 +39,14 @@ string WeaponArenaString()
 
        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);
 
index 3f9dc410b3c53ceb17b0e931997ab3ca6b30a837..401a6eadda0026b5f7e2b6533c40352c597961ea 100644 (file)
@@ -100,7 +100,7 @@ void XonoticStatsList_getStats(entity me)
                        case "overall/last_seen_dt":
                        {
                                order = 1;
-                               outstr = _("Last seen:");
+                               outstr = _("Last match:");
                                data = XonoticStatsList_convertDate(car(data));
                                break;
                        }
index d72f64b727c9a1c9565aa9121f76885618702ba2..4926791aa7417c3cfcce490268e9ce8db74f6198 100644 (file)
@@ -758,12 +758,21 @@ entity makeXonoticCheckBoxString(string, string, string, string);
 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"), "");
index 96fef2ad4006f553a3bd8a5b22dd594b684df5c3..f5bd636d81f98c1b481b0919776ed2051d5fddaf 100644 (file)
@@ -36,13 +36,8 @@ string GameType_GetIcon(int cnt);
 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);
 
index d887a9ee326e76c15c358b6cd062c07999fd8c1a..12a126fcce37985e8d86ef4922976da51b36e603 100644 (file)
@@ -204,8 +204,6 @@ bool autocvar_g_respawn_ghosts;
 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;
index 01f2b74e0b05c756706089065311b90c92d8af64..238e07fb0f33d8febf4482dda7811e9581e1295d 100644 (file)
@@ -308,6 +308,9 @@ void PutObserverInServer(entity this)
        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;
@@ -340,6 +343,7 @@ void PutObserverInServer(entity this)
        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);
@@ -1094,6 +1098,8 @@ void FixClientCvars(entity e)
        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);
 }
 
@@ -2144,6 +2150,7 @@ bool joinAllowed(entity this)
 }
 
 .int items_added;
+.string shootfromfixedorigin;
 bool PlayerThink(entity this)
 {
        if (game_stopped || intermission_running) {
@@ -2278,6 +2285,11 @@ bool PlayerThink(entity this)
 
        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)
        {
@@ -2825,3 +2837,10 @@ void PM_UpdateButtons(entity this, entity store)
        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;
+}
index c9948660efe1165c7ed8654dac1ba770e6763277..3f1db42903ddd010c209febba24f608cba1c1840 100644 (file)
@@ -353,6 +353,28 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
        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;
index e2a57f43fb4a3ffaf36b6a5d33f1d475d793e9db..ad406196635a55b1ecf60667d653eba8a21c27bc 100644 (file)
@@ -24,6 +24,14 @@ void PlayerScore_Detach(entity player);
  */
 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.
index 8d87407e64ebd3bc165efe3e27b53c6ceef25f0b..64c94001fbc5bcd9ab42caffd6d8c86604368a32 100644 (file)
@@ -55,6 +55,9 @@ void ScoreRules_basics(int teams, float sprio, float stprio, float score_enabled
        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()
 {
index 7b6504d5162875ab34d7c6f61710366352c78605..8f1457a034a07e6d4caf2edfdea024d68d55079a 100644 (file)
@@ -555,3 +555,5 @@ set sv_simple_items 1 "allow or forbid client use of simple items"
 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"