]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/updatecommands
authorSamual <samual@xonotic.org>
Sun, 25 Dec 2011 16:21:20 +0000 (11:21 -0500)
committerSamual <samual@xonotic.org>
Sun, 25 Dec 2011 16:21:20 +0000 (11:21 -0500)
15 files changed:
gfx/menu/luminos/icon_aeslevel0.tga [deleted file]
gfx/menu/luminos/icon_pure0.tga [deleted file]
gfx/menu/luminos/icon_stats1.tga [new file with mode: 0644]
gfx/menu/wickedx/icon_aeslevel0.tga [deleted file]
gfx/menu/wickedx/icon_pure0.tga [deleted file]
gfx/menu/wickedx/icon_stats1.tga [new file with mode: 0644]
gfx/menu/xaw/icon_aeslevel0.tga [deleted file]
gfx/menu/xaw/icon_pure0.tga [deleted file]
gfx/menu/xaw/icon_stats1.tga [new file with mode: 0644]
qcsrc/client/hud.qc
qcsrc/dpdefs/csprogsdefs.qc
qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/server/g_world.qc
qcsrc/server/scores.qc

diff --git a/gfx/menu/luminos/icon_aeslevel0.tga b/gfx/menu/luminos/icon_aeslevel0.tga
deleted file mode 100644 (file)
index 5c9e66a..0000000
Binary files a/gfx/menu/luminos/icon_aeslevel0.tga and /dev/null differ
diff --git a/gfx/menu/luminos/icon_pure0.tga b/gfx/menu/luminos/icon_pure0.tga
deleted file mode 100644 (file)
index 5c9e66a..0000000
Binary files a/gfx/menu/luminos/icon_pure0.tga and /dev/null differ
diff --git a/gfx/menu/luminos/icon_stats1.tga b/gfx/menu/luminos/icon_stats1.tga
new file mode 100644 (file)
index 0000000..4d8688d
Binary files /dev/null and b/gfx/menu/luminos/icon_stats1.tga differ
diff --git a/gfx/menu/wickedx/icon_aeslevel0.tga b/gfx/menu/wickedx/icon_aeslevel0.tga
deleted file mode 100644 (file)
index 5c9e66a..0000000
Binary files a/gfx/menu/wickedx/icon_aeslevel0.tga and /dev/null differ
diff --git a/gfx/menu/wickedx/icon_pure0.tga b/gfx/menu/wickedx/icon_pure0.tga
deleted file mode 100644 (file)
index 5c9e66a..0000000
Binary files a/gfx/menu/wickedx/icon_pure0.tga and /dev/null differ
diff --git a/gfx/menu/wickedx/icon_stats1.tga b/gfx/menu/wickedx/icon_stats1.tga
new file mode 100644 (file)
index 0000000..4d8688d
Binary files /dev/null and b/gfx/menu/wickedx/icon_stats1.tga differ
diff --git a/gfx/menu/xaw/icon_aeslevel0.tga b/gfx/menu/xaw/icon_aeslevel0.tga
deleted file mode 100644 (file)
index 5c9e66a..0000000
Binary files a/gfx/menu/xaw/icon_aeslevel0.tga and /dev/null differ
diff --git a/gfx/menu/xaw/icon_pure0.tga b/gfx/menu/xaw/icon_pure0.tga
deleted file mode 100644 (file)
index 5c9e66a..0000000
Binary files a/gfx/menu/xaw/icon_pure0.tga and /dev/null differ
diff --git a/gfx/menu/xaw/icon_stats1.tga b/gfx/menu/xaw/icon_stats1.tga
new file mode 100644 (file)
index 0000000..4d8688d
Binary files /dev/null and b/gfx/menu/xaw/icon_stats1.tga differ
index 86b49761e5ca59cd34e978073f82e79ad9ddf395..fcdd73601793a940136dd9c117c1fc9bad023a30 100644 (file)
@@ -959,7 +959,7 @@ void HUD_Ammo(void)
                        DrawAmmoItem(pos, ammo_size, 2, true, FALSE); //show rockets
                        return;
                }
-               stat_items = getstati(STAT_ITEMS);
+               stat_items = getstati(STAT_ITEMS, 0, 24);
                if (stat_items & IT_UNLIMITED_WEAPON_AMMO)
                        infinite_ammo = TRUE;
                for (i = 0; i < AMMO_COUNT; ++i) {
@@ -973,7 +973,7 @@ void HUD_Ammo(void)
                return; // nothing to display
        }
 
-       stat_items = getstati(STAT_ITEMS);
+       stat_items = getstati(STAT_ITEMS, 0, 24);
        if (stat_items & IT_UNLIMITED_WEAPON_AMMO)
                infinite_ammo = TRUE;
        for (i = 0; i < AMMO_COUNT; ++i) {
@@ -1082,7 +1082,7 @@ void HUD_Powerups(void)
        {
                if(!autocvar_hud_panel_powerups) return;
                if(spectatee_status == -1) return;
-               if not(getstati(STAT_ITEMS) & (IT_STRENGTH | IT_INVINCIBLE)) return;
+               if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE)) return;
                if (getstati(STAT_HEALTH) <= 0) return;
 
                strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
@@ -3204,7 +3204,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
        float redflag_statuschange_elapsedtime, blueflag_statuschange_elapsedtime; // time since the status changed
        float stat_items;
 
-       stat_items = getstati(STAT_ITEMS);
+       stat_items = getstati(STAT_ITEMS, 0, 24);
        redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3;
        blueflag = (stat_items/IT_BLUE_FLAG_TAKEN) & 3;
        
@@ -3496,7 +3496,7 @@ void HUD_Mod_Keepaway(vector pos, vector mySize)
        float BLINK_FREQ = 5; 
        float kaball_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
        
-       float stat_items = getstati(STAT_ITEMS);
+       float stat_items = getstati(STAT_ITEMS, 0, 24);
        float kaball = (stat_items/IT_KEY1) & 1;
        
        if(kaball != kaball_prevstatus)
@@ -3531,7 +3531,7 @@ void HUD_Mod_NexBall(vector pos, vector mySize)
 {
        float stat_items, nb_pb_starttime, dt, p;
 
-       stat_items = getstati(STAT_ITEMS);
+       stat_items = getstati(STAT_ITEMS, 0, 24);
        nb_pb_starttime = getstatf(STAT_NB_METERSTART);
 
        if (stat_items & IT_KEY1)
index a53c612a7428261e2e3cd391653d2e61b24c6b69..189a9a96b4e05b42107473897d01db2659fbabe5 100644 (file)
@@ -484,7 +484,7 @@ float(vector position, string text, vector scale, float alpha, float flag) drawc
 vector(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawcolorcodedstring2 = #326;
 
 float(float stnum) getstatf = #330;
-float(float stnum) getstati = #331;
+float(float stnum, ...) getstati = #331; // can optionally take first bit and count
 string(float firststnum) getstats = #332;
 void(entity e, float mdlindex) setmodelindex = #333;
 string(float mdlindex) modelnameforindex = #334;
index d396e7bbcc747a449a2cd482c743ca5564b0d582..8bf090fe4b7320062c97628fff5427d8651f6f62 100644 (file)
@@ -56,7 +56,7 @@ void Join_Click(entity btn, entity me);
 #ifdef IMPLEMENTATION
 void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
 {
-       float m, pure, freeslots, j, numh, maxp, numb;
+       float m, pure, freeslots, j, numh, maxp, numb, sflags;
        string s, typestr, versionstr, k, v;
 
        if(me.currentServerName)
@@ -124,6 +124,7 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
                versionstr = argv(1);
        }
        freeslots = -1;
+       sflags = -1;
        for(j = 2; j < m; ++j)
        {
                if(argv(j) == "")
@@ -134,6 +135,8 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
                        pure = stof(v);
                else if(k == "S")
                        freeslots = stof(v);
+               else if(k == "F")
+                       sflags = stof(v);
        }
 
        me.currentServerType = strzone(typestr);
index 3e89b70b5c23bd1a01ee4b28206cbd0371b9e6c4..b7757f2996ce7b0149d0e62438cb3313ced39fab 100644 (file)
@@ -533,7 +533,7 @@ void XonoticServerList_resizeNotify(entity me, vector relOrigin, vector relSize,
        me.realUpperMargin = 0.5 * (1 - me.realFontSize_y);
 
        me.columnIconsOrigin = 0;
-       me.columnIconsSize = me.realFontSize_x * 3 * me.iconsSizeFactor;
+       me.columnIconsSize = me.realFontSize_x * 4 * me.iconsSizeFactor;
        me.columnPingSize = me.realFontSize_x * 3;
        me.columnMapSize = me.realFontSize_x * 10;
        me.columnTypeSize = me.realFontSize_x * 4;
@@ -595,18 +595,42 @@ void XonoticServerList_clickListBoxItem(entity me, float i, vector where)
 void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
 {
        // layout: Ping, Server name, Map name, NP, TP, MP
-       string s;
        float p, q;
        float isv4, isv6;
        vector theColor;
        float theAlpha;
+       float m, pure, freeslots, j, sflags;
+       string s, typestr, versionstr, k, v;
 
        if(isSelected)
                draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
 
+       s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
+       m = tokenizebyseparator(s, ":");
+       if(m >= 2)
+       {
+               typestr = argv(0);
+               versionstr = argv(1);
+       }
+       freeslots = -1;
+       sflags = -1;
+       for(j = 2; j < m; ++j)
+       {
+               if(argv(j) == "")
+                       break;
+               k = substring(argv(j), 0, 1);
+               v = substring(argv(j), 1, -1);
+               if(k == "P")
+                       pure = stof(v);
+               else if(k == "S")
+                       freeslots = stof(v);
+               else if(k == "F")
+                       sflags = stof(v);
+       }
+
        if(gethostcachenumber(SLIST_FIELD_FREESLOTS, i) <= 0)
                theAlpha = SKINALPHA_SERVERLIST_FULL;
-       else if(strstrofs(gethostcachestring(SLIST_FIELD_QCSTATUS, i), ":S0:", 0) >= 0)
+       else if(freeslots == 0)
                theAlpha = SKINALPHA_SERVERLIST_FULL; // g_maxplayers support
        else if not(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i))
                theAlpha = SKINALPHA_SERVERLIST_EMPTY;
@@ -681,7 +705,6 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
        // 4: AES recommended and will be used
        // 5: AES required
 
-       s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
        {
                vector iconSize;
                iconSize_y = me.realFontSize_y * me.iconsSizeFactor;
@@ -704,10 +727,16 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
                        iconPos_x += iconSize_x;
                }
 
-               draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), iconSize, '1 1 1', 1);
+               if(q > 0)
+                       draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), iconSize, '1 1 1', 1);
+               iconPos_x += iconSize_x;
+
+               if(pure == 0)
+                       draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), iconSize, '1 1 1', 1);
                iconPos_x += iconSize_x;
 
-               draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_pure", ftos(strstrofs(s, ":P0:", 0) >= 0)), iconSize, '1 1 1', 1);
+               if(sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS))
+                               draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_stats1"), iconSize, '1 1 1', 1);
                iconPos_x += iconSize_x;
        }
 
@@ -717,13 +746,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
        draw_Text(me.realUpperMargin * eY + me.columnNameOrigin * eX, s, me.realFontSize, theColor, theAlpha, 0);
        s = draw_TextShortenToWidth(gethostcachestring(SLIST_FIELD_MAP, i), me.columnMapSize, 0, me.realFontSize);
        draw_Text(me.realUpperMargin * eY + (me.columnMapOrigin + (me.columnMapSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
-       s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
-       p = strstrofs(s, ":", 0);
-       if(p >= 0)
-               s = substring(s, 0, p);
-       else
-               s = "";
-       s = draw_TextShortenToWidth(s, me.columnMapSize, 0, me.realFontSize);
+       s = draw_TextShortenToWidth(typestr, me.columnTypeSize, 0, me.realFontSize);
        draw_Text(me.realUpperMargin * eY + (me.columnTypeOrigin + (me.columnTypeSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
        s = strcat(ftos(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i)), "/", ftos(gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i)));
        draw_Text(me.realUpperMargin * eY + (me.columnPlayersOrigin + (me.columnPlayersSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
index 9bfdd0d52cbf3e1ad1cfcb86073886bd8a3de586..41288a80869b72639a97740c2cff94789e3b99ec 100644 (file)
@@ -388,6 +388,7 @@ void cvar_changes_init()
                BADCVAR("sv_allow_fullbright");
                BADCVAR("sv_checkforpacketsduringsleep");
                BADCVAR("sv_timeout");
+               BADPREFIX("sv_timeout_");
                BADCVAR("welcome_message_time");
                BADPREFIX("crypto_");
                BADPREFIX("g_chat_");
@@ -489,6 +490,7 @@ void cvar_changes_init()
                BADCVAR("sys_ticrate");
                BADCVAR("teamplay_mode");
                BADCVAR("timelimit_override");
+               BADCVAR("g_spawnshieldtime");
                BADPREFIX("g_warmup_");
                BADPREFIX("sv_ready_restart_");
 
index d8e095db00be22114aa9592b51550e35ec41d27d..698e947da6d1a2ab47a9d8733fe959ecdad70469 100644 (file)
@@ -386,6 +386,7 @@ void WinningConditionHelper()
        s = strcat(s, ":", autocvar_g_xonoticversion);
        s = strcat(s, ":P", ftos(cvar_purechanges_count));
        s = strcat(s, ":S", ftos(nJoinAllowed(0)));
+       s = strcat(s, ":F", ftos(serverflags));
        s = strcat(s, "::", GetPlayerScoreString(world, 1)); // make this 1 once we can, note: this doesn't contain any :<letter>
 
        fullstatus = autocvar_g_full_getstatus_responses;