From: Rudolf Polzer Date: Wed, 3 Nov 2010 06:45:03 +0000 (+0100) Subject: mark "pure" servers as such in the menu X-Git-Tag: xonotic-v0.1.0preview~209 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ea02e878227f13bc2fc13a82532a979896bb992c;p=xonotic%2Fxonotic-data.pk3dir.git mark "pure" servers as such in the menu --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 9513dfcc4..25cf9fa29 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1341,6 +1341,9 @@ alias _userbind_call "${$1}" alias +userbind "_userbind_call userbind${1}_press" alias -userbind "_userbind_call userbind${1}_release" +// we must change its default from 1.0 to 1 to be consistent with menuqc +seta slowmo 1 + seta menu_skin "luminos" set menu_slowmo 1 seta menu_sounds 0 "enables menu sound effects. 1 enables click sounds, 2 also enables hover sounds" diff --git a/gfx/menu/default/icon_aeslevel0.tga b/gfx/menu/default/icon_aeslevel0.tga new file mode 100644 index 000000000..5c9e66ac6 Binary files /dev/null and b/gfx/menu/default/icon_aeslevel0.tga differ diff --git a/gfx/menu/default/icon_aeslevel1.tga b/gfx/menu/default/icon_aeslevel1.tga new file mode 100644 index 000000000..f1e92735a Binary files /dev/null and b/gfx/menu/default/icon_aeslevel1.tga differ diff --git a/gfx/menu/default/icon_aeslevel2.tga b/gfx/menu/default/icon_aeslevel2.tga new file mode 100644 index 000000000..7153820cd Binary files /dev/null and b/gfx/menu/default/icon_aeslevel2.tga differ diff --git a/gfx/menu/default/icon_aeslevel3.tga b/gfx/menu/default/icon_aeslevel3.tga new file mode 100644 index 000000000..c31bfe802 Binary files /dev/null and b/gfx/menu/default/icon_aeslevel3.tga differ diff --git a/gfx/menu/default/icon_aeslevel4.tga b/gfx/menu/default/icon_aeslevel4.tga new file mode 100644 index 000000000..88963f8d8 Binary files /dev/null and b/gfx/menu/default/icon_aeslevel4.tga differ diff --git a/gfx/menu/default/icon_aeslevel5.tga b/gfx/menu/default/icon_aeslevel5.tga new file mode 100644 index 000000000..0ed332d8a Binary files /dev/null and b/gfx/menu/default/icon_aeslevel5.tga differ diff --git a/gfx/menu/default/icon_pure0.tga b/gfx/menu/default/icon_pure0.tga new file mode 100644 index 000000000..5c9e66ac6 Binary files /dev/null and b/gfx/menu/default/icon_pure0.tga differ diff --git a/gfx/menu/default/icon_pure1.tga b/gfx/menu/default/icon_pure1.tga new file mode 100644 index 000000000..183ec93eb Binary files /dev/null and b/gfx/menu/default/icon_pure1.tga differ diff --git a/gfx/menu/luminos/icon_aeslevel0.tga b/gfx/menu/luminos/icon_aeslevel0.tga new file mode 100644 index 000000000..5c9e66ac6 Binary files /dev/null and b/gfx/menu/luminos/icon_aeslevel0.tga differ diff --git a/gfx/menu/luminos/icon_aeslevel1.tga b/gfx/menu/luminos/icon_aeslevel1.tga new file mode 100644 index 000000000..f1e92735a Binary files /dev/null and b/gfx/menu/luminos/icon_aeslevel1.tga differ diff --git a/gfx/menu/luminos/icon_aeslevel2.tga b/gfx/menu/luminos/icon_aeslevel2.tga new file mode 100644 index 000000000..7153820cd Binary files /dev/null and b/gfx/menu/luminos/icon_aeslevel2.tga differ diff --git a/gfx/menu/luminos/icon_aeslevel3.tga b/gfx/menu/luminos/icon_aeslevel3.tga new file mode 100644 index 000000000..c31bfe802 Binary files /dev/null and b/gfx/menu/luminos/icon_aeslevel3.tga differ diff --git a/gfx/menu/luminos/icon_aeslevel4.tga b/gfx/menu/luminos/icon_aeslevel4.tga new file mode 100644 index 000000000..88963f8d8 Binary files /dev/null and b/gfx/menu/luminos/icon_aeslevel4.tga differ diff --git a/gfx/menu/luminos/icon_aeslevel5.tga b/gfx/menu/luminos/icon_aeslevel5.tga new file mode 100644 index 000000000..0ed332d8a Binary files /dev/null and b/gfx/menu/luminos/icon_aeslevel5.tga differ diff --git a/gfx/menu/luminos/icon_pure0.tga b/gfx/menu/luminos/icon_pure0.tga new file mode 100644 index 000000000..5c9e66ac6 Binary files /dev/null and b/gfx/menu/luminos/icon_pure0.tga differ diff --git a/gfx/menu/luminos/icon_pure1.tga b/gfx/menu/luminos/icon_pure1.tga new file mode 100644 index 000000000..183ec93eb Binary files /dev/null and b/gfx/menu/luminos/icon_pure1.tga differ diff --git a/gfx/menu/xaw/icon_aeslevel0.tga b/gfx/menu/xaw/icon_aeslevel0.tga new file mode 100644 index 000000000..5c9e66ac6 Binary files /dev/null and b/gfx/menu/xaw/icon_aeslevel0.tga differ diff --git a/gfx/menu/xaw/icon_aeslevel1.tga b/gfx/menu/xaw/icon_aeslevel1.tga new file mode 100644 index 000000000..f1e92735a Binary files /dev/null and b/gfx/menu/xaw/icon_aeslevel1.tga differ diff --git a/gfx/menu/xaw/icon_aeslevel2.tga b/gfx/menu/xaw/icon_aeslevel2.tga new file mode 100644 index 000000000..7153820cd Binary files /dev/null and b/gfx/menu/xaw/icon_aeslevel2.tga differ diff --git a/gfx/menu/xaw/icon_aeslevel3.tga b/gfx/menu/xaw/icon_aeslevel3.tga new file mode 100644 index 000000000..c31bfe802 Binary files /dev/null and b/gfx/menu/xaw/icon_aeslevel3.tga differ diff --git a/gfx/menu/xaw/icon_aeslevel4.tga b/gfx/menu/xaw/icon_aeslevel4.tga new file mode 100644 index 000000000..88963f8d8 Binary files /dev/null and b/gfx/menu/xaw/icon_aeslevel4.tga differ diff --git a/gfx/menu/xaw/icon_aeslevel5.tga b/gfx/menu/xaw/icon_aeslevel5.tga new file mode 100644 index 000000000..0ed332d8a Binary files /dev/null and b/gfx/menu/xaw/icon_aeslevel5.tga differ diff --git a/gfx/menu/xaw/icon_pure0.tga b/gfx/menu/xaw/icon_pure0.tga new file mode 100644 index 000000000..5c9e66ac6 Binary files /dev/null and b/gfx/menu/xaw/icon_pure0.tga differ diff --git a/gfx/menu/xaw/icon_pure1.tga b/gfx/menu/xaw/icon_pure1.tga new file mode 100644 index 000000000..183ec93eb Binary files /dev/null and b/gfx/menu/xaw/icon_pure1.tga differ diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c index 21eefeae6..4824331a0 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c @@ -5,7 +5,7 @@ CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog) ATTRIB(XonoticServerInfoDialog, title, string, "Server Information") ATTRIB(XonoticServerInfoDialog, color, vector, SKINCOLOR_DIALOG_SERVERINFO) ATTRIB(XonoticServerInfoDialog, intendedWidth, float, 0.68) - ATTRIB(XonoticServerInfoDialog, rows, float, 14) + ATTRIB(XonoticServerInfoDialog, rows, float, 15) ATTRIB(XonoticServerInfoDialog, columns, float, 12) ATTRIB(XonoticServerInfoDialog, currentServerName, string, string_null) @@ -22,6 +22,7 @@ CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog) ATTRIB(XonoticServerInfoDialog, currentServerID, string, string_null) ATTRIB(XonoticServerInfoDialog, currentServerEncrypt, string, string_null) ATTRIB(XonoticServerInfoDialog, currentServerCanConnect, string, string_null) + ATTRIB(XonoticServerInfoDialog, currentServerPure, string, string_null) ATTRIB(XonoticServerInfoDialog, nameLabel, entity, NULL) ATTRIB(XonoticServerInfoDialog, cnameLabel, entity, NULL) @@ -37,6 +38,7 @@ CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog) ATTRIB(XonoticServerInfoDialog, idLabel, entity, NULL) ATTRIB(XonoticServerInfoDialog, encryptLabel, entity, NULL) ATTRIB(XonoticServerInfoDialog, canConnectLabel, entity, NULL) + ATTRIB(XonoticServerInfoDialog, pureLabel, entity, NULL) ENDCLASS(XonoticServerInfoDialog) float SLIST_FIELD_NAME; @@ -55,8 +57,8 @@ void Join_Click(entity btn, entity me); #ifdef IMPLEMENTATION void XonoticServerInfoDialog_loadServerInfo(entity me, float i) { - float m; - string s, typestr, versionstr, numh, maxp; + float m, pure, j; + string s, typestr, versionstr, numh, maxp, k, v; SLIST_FIELD_NAME = gethostcacheindexforkey("name"); me.currentServerName = strzone(gethostcachestring(SLIST_FIELD_NAME, i)); @@ -66,19 +68,28 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) me.currentServerCName = strzone(gethostcachestring(SLIST_FIELD_CNAME, i)); me.cnameLabel.setText(me.cnameLabel, me.currentServerCName); + pure = -1; + typestr = "N/A"; + versionstr = "N/A"; + SLIST_FIELD_QCSTATUS = gethostcacheindexforkey("qcstatus"); s = gethostcachestring(SLIST_FIELD_QCSTATUS, i); m = tokenizebyseparator(s, ":"); - if(m > 1) + if(m >= 2) { - typestr = argv (0); + typestr = argv(0); versionstr = argv(1); } - else + for(j = 2; j < m; ++j) { - typestr = "N/A"; - versionstr = "N/A"; + if(argv(j) == "") + break; + k = substring(argv(j), 0, 1); + v = substring(argv(j), 1, -1); + if(k == "P") + pure = stof(v); } + me.currentServerType = strzone(typestr); me.typeLabel.setText(me.typeLabel, me.currentServerType); @@ -109,6 +120,9 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) me.currentServerVersion = strzone(versionstr); me.versionLabel.setText(me.versionLabel, me.currentServerVersion); + me.currentServerPure = ((pure < 0) ? "N/A" : (pure == 0) ? "Official settings" : sprintf("%d modified settings", pure)); + me.pureLabel.setText(me.pureLabel, me.currentServerPure); + SLIST_FIELD_PING = gethostcacheindexforkey("ping"); s = ftos(gethostcachenumber(SLIST_FIELD_PING, i)); me.currentServerPing = strzone(s); @@ -192,6 +206,11 @@ void XonoticServerInfoDialog_fill(entity me) me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, "")); e.allowCut = 1; me.mapLabel = e; + me.TR(me); + me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Gameplay:")); + me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, "")); + e.allowCut = 1; + me.pureLabel = e; me.TR(me); me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Players:")); me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, "")); diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index 95e1f80b8..610350c02 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -10,6 +10,8 @@ CLASS(XonoticServerList) EXTENDS(XonoticListBox) ATTRIB(XonoticServerList, realFontSize, vector, '0 0 0') ATTRIB(XonoticServerList, realUpperMargin, float, 0) + ATTRIB(XonoticServerList, columnIconsOrigin, float, 0) + ATTRIB(XonoticServerList, columnIconsSize, float, 0) ATTRIB(XonoticServerList, columnPingOrigin, float, 0) ATTRIB(XonoticServerList, columnPingSize, float, 0) ATTRIB(XonoticServerList, columnNameOrigin, float, 0) @@ -490,12 +492,14 @@ void XonoticServerList_resizeNotify(entity me, vector relOrigin, vector relSize, me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth)); me.realUpperMargin = 0.5 * (1 - me.realFontSize_y); - me.columnPingOrigin = 0; + me.columnIconsOrigin = 0; + me.columnIconsSize = me.realFontSize_x * 2; me.columnPingSize = me.realFontSize_x * 4; me.columnMapSize = me.realFontSize_x * 12; me.columnTypeSize = me.realFontSize_x * 4; me.columnPlayersSize = me.realFontSize_x * 6; - me.columnNameSize = 1 - me.columnPlayersSize - me.columnMapSize - me.columnPingSize - me.columnTypeSize - 4 * me.realFontSize_x; + me.columnNameSize = 1 - me.columnPlayersSize - me.columnMapSize - me.columnPingSize - me.columnIconsSize - me.columnTypeSize - 5 * me.realFontSize_x; + me.columnPingOrigin = me.columnIconsOrigin + me.columnIconsSize + me.realFontSize_x; me.columnNameOrigin = me.columnPingOrigin + me.columnPingSize + me.realFontSize_x; me.columnMapOrigin = me.columnNameOrigin + me.columnNameSize + me.realFontSize_x; me.columnTypeOrigin = me.columnMapOrigin + me.columnMapSize + me.realFontSize_x; @@ -598,7 +602,44 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float theColor = SKINCOLOR_SERVERLIST_IMPOSSIBLE; theAlpha = SKINALPHA_SERVERLIST_IMPOSSIBLE; } - // TODO show an icon for encryption status + + if(q == 1) + { + if(cvar("crypto_aeslevel") >= 2) + q |= 4; + } + if(q == 2) + { + if(cvar("crypto_aeslevel") >= 1) + q |= 4; + } + if(q == 3) + q = 5; + if(q >= 3) + q -= 2; + // possible status: + // 0: crypto off + // 1: AES possible + // 2: AES recommended but not available + // 3: AES possible and will be used + // 4: AES recommended and will be used + // 5: AES required + + s = gethostcachestring(SLIST_FIELD_QCSTATUS, i); + { + vector iconSize; + iconSize_y = 1; + iconSize_x = iconSize_y * (absSize_y / absSize_x); + + vector iconPos; + iconPos_x = (me.columnIconsSize - 2 * iconSize_x) * 0.5; + iconPos_y = (1 - iconSize_y) * 0.5; + + draw_Picture(iconPos, strcat("icon_pure", ftos(strstrofs(s, ":P0:", 0) >= 0)), iconSize, '1 1 1', 1); + + iconPos_x += iconSize_x; + draw_Picture(iconPos, strcat("icon_aeslevel", ftos(q)), iconSize, '1 1 1', 1); + } s = ftos(p); draw_Text(me.realUpperMargin * eY + (me.columnPingSize - draw_TextWidth(s, 0, me.realFontSize)) * eX, s, me.realFontSize, theColor, theAlpha, 0); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index cd99ef476..b4bb3100a 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -259,12 +259,17 @@ void cvar_changes_init() BADPREFIX("r_"); BADPREFIX("sbar_"); BADPREFIX("scr_"); + BADPREFIX("snd_"); BADPREFIX("userbind"); BADPREFIX("v_"); BADPREFIX("vid_"); BADPREFIX("crosshair"); BADCVAR("mod_q3bsp_lightmapmergepower"); BADCVAR("mod_q3bsp_nolightmaps"); + BADCVAR("fov"); + BADCVAR("mastervolume"); + BADCVAR("volume"); + BADCVAR("bgmvolume"); // private BADCVAR("serverconfig"); @@ -340,6 +345,7 @@ void cvar_changes_init() // does nothing visible BADPREFIX("prvm_"); + BADPREFIX("crypto_"); // allowed changes to server admins (please sync this to server.cfg) // vi commands: diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 59480ab65..fbddca71d 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -369,7 +369,8 @@ void WinningConditionHelper() s = GetGametype(); s = strcat(s, ":", cvar_string("g_xonoticversion")); - s = strcat(s, "::", GetPlayerScoreString(world, 2)); // make this 1 once we can + s = strcat(s, ":P", ftos(cvar_purechanges_count)); + s = strcat(s, "::", GetPlayerScoreString(world, 1)); // make this 1 once we can, note: this doesn't contain any : fullstatus = cvar("g_full_getstatus_responses");