r5040 - in trunk/data: gfx/menu/default gfx/menu/silver gfx/menu/simplygray gfx/menu/wickedblack gfx/menu/wickedblue gfx/menu/wickedgreen gfx/menu/wickedred gfx/menu/wickedwhite gfx/menu/wickedyellow gfx/menu/wickedz gfx/menu/xaw qcsrc/menu qcsrc/menu/nexuiz
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Nov 12 08:38:47 EST 2008
Author: esteel
Date: 2008-11-12 08:38:46 -0500 (Wed, 12 Nov 2008)
New Revision: 5040
Added:
trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_join_serverinfo.c
trunk/data/qcsrc/menu/nexuiz/playerlist.c
Modified:
trunk/data/gfx/menu/default/skinvalues.txt
trunk/data/gfx/menu/silver/skinvalues.txt
trunk/data/gfx/menu/simplygray/skinvalues.txt
trunk/data/gfx/menu/wickedblack/skinvalues.txt
trunk/data/gfx/menu/wickedblue/skinvalues.txt
trunk/data/gfx/menu/wickedgreen/skinvalues.txt
trunk/data/gfx/menu/wickedred/skinvalues.txt
trunk/data/gfx/menu/wickedwhite/skinvalues.txt
trunk/data/gfx/menu/wickedyellow/skinvalues.txt
trunk/data/gfx/menu/wickedz/skinvalues.txt
trunk/data/gfx/menu/xaw/skinvalues.txt
trunk/data/qcsrc/menu/classes.c
trunk/data/qcsrc/menu/mbuiltin.qh
trunk/data/qcsrc/menu/nexuiz/mainwindow.c
trunk/data/qcsrc/menu/nexuiz/serverlist.c
trunk/data/qcsrc/menu/skin-customizables.inc
Log:
Ronans server info dialog
Modified: trunk/data/gfx/menu/default/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/default/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/default/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_CREDITS '0.7 0.7 1'
COLOR_DIALOG_WEAPONS '1 0.7 0.7'
COLOR_DIALOG_RADAR '0.7 0.7 1'
+COLOR_DIALOG_SERVERINFO '0.7 0.7 1'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '0.4 0.4 0.7'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.4 0.4 0.7'
Modified: trunk/data/gfx/menu/silver/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/silver/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/silver/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_CREDITS '0.7 0.7 1'
COLOR_DIALOG_WEAPONS '0.8 0.8 0.8'
COLOR_DIALOG_RADAR '0.8 0.8 0.8'
+COLOR_DIALOG_SERVERINFO '0.6 0.7 0.8'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '0.2 0.7 0.2'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.4 0.4 0.7'
Modified: trunk/data/gfx/menu/simplygray/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/simplygray/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/simplygray/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_CREDITS '0.7 0.7 0.7'
COLOR_DIALOG_WEAPONS '0.7 0.7 0.7'
COLOR_DIALOG_RADAR '0.7 0.7 0.7'
+COLOR_DIALOG_SERVERINFO '0.7 0.7 0.7'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '0 0.9 0.9'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.4 0.4 0.7'
Modified: trunk/data/gfx/menu/wickedblack/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/wickedblack/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/wickedblack/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_WEAPONS '1 0.7 0.7'
COLOR_DIALOG_RADAR '1 1 1'
COLOR_DIALOG_CREDITS '1 1 1'
+COLOR_DIALOG_SERVERINFO '1 1 1'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '0.9 0.9 0.9'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.75 0.75 0.75'
Modified: trunk/data/gfx/menu/wickedblue/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/wickedblue/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/wickedblue/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_CREDITS '0.5 0.75 1'
COLOR_DIALOG_WEAPONS '0.5 0.75 1'
COLOR_DIALOG_RADAR '0.5 0.75 1'
+COLOR_DIALOG_SERVERINFO '0.5 0.75 1'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '0.5 0.75 1'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.75 0.75 0.75'
Modified: trunk/data/gfx/menu/wickedgreen/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/wickedgreen/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/wickedgreen/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_CREDITS '0.5 1 0'
COLOR_DIALOG_WEAPONS '0.5 1 0'
COLOR_DIALOG_RADAR '0.5 1 0'
+COLOR_DIALOG_SERVERINFO '0.5 1 0'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '0.5 1 0'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.75 0.75 0.75'
Modified: trunk/data/gfx/menu/wickedred/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/wickedred/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/wickedred/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_CREDITS '1 0 0'
COLOR_DIALOG_WEAPONS '1 0 0'
COLOR_DIALOG_RADAR '1 0 0'
+COLOR_DIALOG_SERVERINFO '1 0 0'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '1 0 0'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.75 0.75 0.75'
Modified: trunk/data/gfx/menu/wickedwhite/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/wickedwhite/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/wickedwhite/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_CREDITS '1 1 1'
COLOR_DIALOG_WEAPONS '1 1 1'
COLOR_DIALOG_RADAR '1 1 1'
+COLOR_DIALOG_SERVERINFO '1 1 1'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '0.9 0.9 0.9'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.75 0.75 0.75'
Modified: trunk/data/gfx/menu/wickedyellow/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/wickedyellow/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/wickedyellow/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_CREDITS '1 0.875 0'
COLOR_DIALOG_WEAPONS '1 0.875 0'
COLOR_DIALOG_RADAR '1 0.875 0'
+COLOR_DIALOG_SERVERINFO '1 0.875 0'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '1 0.875 0'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.75 0.75 0.75'
Modified: trunk/data/gfx/menu/wickedz/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/wickedz/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/wickedz/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -34,6 +34,7 @@
COLOR_DIALOG_CREDITS '0.4 0.8 0.9'
COLOR_DIALOG_WEAPONS '0.4 0.8 0.9'
COLOR_DIALOG_RADAR '0.4 0.8 0.9'
+COLOR_DIALOG_SERVERINFO '0.4 0.8 0.9'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -173,6 +174,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '0.6 0.4 0.1'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.75 0.75 0.75'
Modified: trunk/data/gfx/menu/xaw/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/xaw/skinvalues.txt 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/gfx/menu/xaw/skinvalues.txt 2008-11-12 13:38:46 UTC (rev 5040)
@@ -20,6 +20,7 @@
COLOR_DIALOG_CREDITS '1 1 1'
COLOR_DIALOG_WEAPONS '1 1 1'
COLOR_DIALOG_RADAR '1 1 1'
+COLOR_DIALOG_SERVERINFO '1 1 1'
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -159,6 +160,10 @@
ALPHA_SERVERLIST_FAVORITE 0.8
COLOR_SERVERLIST_FAVORITE '1 1 1'
+// item: server info
+COLOR_SERVERINFO_NAME '1 1 1'
+COLOR_SERVERINFO_IP '0 0 0'
+
// item: skin list
COLOR_SKINLIST_TITLE '1 1 1'
COLOR_SKINLIST_AUTHOR '0.5 0.5 0.5'
Modified: trunk/data/qcsrc/menu/classes.c
===================================================================
--- trunk/data/qcsrc/menu/classes.c 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/qcsrc/menu/classes.c 2008-11-12 13:38:46 UTC (rev 5040)
@@ -42,6 +42,8 @@
#include "nexuiz/textslider.c"
#include "nexuiz/colorbutton.c"
#include "nexuiz/dialog_multiplayer_join.c"
+#include "nexuiz/dialog_multiplayer_join_serverinfo.c"
+#include "nexuiz/playerlist.c"
#include "nexuiz/listbox.c"
#include "nexuiz/serverlist.c"
#include "nexuiz/inputbox.c"
Modified: trunk/data/qcsrc/menu/mbuiltin.qh
===================================================================
--- trunk/data/qcsrc/menu/mbuiltin.qh 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/qcsrc/menu/mbuiltin.qh 2008-11-12 13:38:46 UTC (rev 5040)
@@ -259,7 +259,7 @@
float(string s1, string s2) strcasecmp = #229;
float(string s1, string s2, float len) strncasecmp = #230;
-string(string s) strdecolorize(string s) = #477;
+string(string s) strdecolorize = #477;
//DP_QC_STRINGBUFFERS
//idea: ??
Added: trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_join_serverinfo.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_join_serverinfo.c (rev 0)
+++ trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_join_serverinfo.c 2008-11-12 13:38:46 UTC (rev 5040)
@@ -0,0 +1,195 @@
+#ifdef INTERFACE
+CLASS(NexuizServerInfoDialog) EXTENDS(NexuizDialog)
+ METHOD(NexuizServerInfoDialog, fill, void(entity))
+ METHOD(NexuizServerInfoDialog, loadServerInfo, void(entity, float))
+ ATTRIB(NexuizServerInfoDialog, title, string, "Server Information")
+ ATTRIB(NexuizServerInfoDialog, color, vector, SKINCOLOR_DIALOG_SERVERINFO)
+ ATTRIB(NexuizServerInfoDialog, intendedWidth, float, 0.60)
+ ATTRIB(NexuizServerInfoDialog, rows, float, 11)
+ ATTRIB(NexuizServerInfoDialog, columns, float, 12)
+
+ ATTRIB(NexuizServerInfoDialog, currentServerName, string, string_null)
+ ATTRIB(NexuizServerInfoDialog, currentServerCName, string, string_null)
+ ATTRIB(NexuizServerInfoDialog, currentServerType, string, string_null)
+ ATTRIB(NexuizServerInfoDialog, currentServerMap, string, string_null)
+ ATTRIB(NexuizServerInfoDialog, currentServerPlayers, string, string_null)
+ ATTRIB(NexuizServerInfoDialog, currentServerNumPlayers, string, string_null)
+ ATTRIB(NexuizServerInfoDialog, currentServerNumBots, string, string_null)
+ ATTRIB(NexuizServerInfoDialog, currentServerMod, string, string_null)
+ ATTRIB(NexuizServerInfoDialog, currentServerVersion, string, string_null)
+ ATTRIB(NexuizServerInfoDialog, currentServerPing, string, string_null)
+
+ ATTRIB(NexuizServerInfoDialog, nameLabel, entity, NULL)
+ ATTRIB(NexuizServerInfoDialog, cnameLabel, entity, NULL)
+ ATTRIB(NexuizServerInfoDialog, typeLabel, entity, NULL)
+ ATTRIB(NexuizServerInfoDialog, mapLabel, entity, NULL)
+ ATTRIB(NexuizServerInfoDialog, rawPlayerList, entity, NULL)
+ ATTRIB(NexuizServerInfoDialog, numPlayersLabel, entity, NULL)
+ ATTRIB(NexuizServerInfoDialog, numBotsLabel, entity, NULL)
+ ATTRIB(NexuizServerInfoDialog, modLabel, entity, NULL)
+ ATTRIB(NexuizServerInfoDialog, versionLabel, entity, NULL)
+ ATTRIB(NexuizServerInfoDialog, pingLabel, entity, NULL)
+
+ENDCLASS(NexuizServerInfoDialog)
+#endif
+float SLIST_FIELD_NAME;
+float SLIST_FIELD_CNAME;
+float SLIST_FIELD_QCSTATUS;
+float SLIST_FIELD_MAP;
+float SLIST_FIELD_PLAYERS;
+float SLIST_FIELD_NUMHUMANS;
+float SLIST_FIELD_MAXPLAYERS;
+float SLIST_FIELD_NUMBOTS;
+float SLIST_FIELD_MOD;
+float SLIST_FIELD_PING;
+string CURRENT_IP; //used by join button
+void Join_Click(entity me);
+#ifdef IMPLEMENTATION
+void loadServerInfoNexuizServerInfoDialog(entity me, float i)
+{
+ float m;
+ string s, typestr, versionstr, numh, maxp;
+
+ SLIST_FIELD_NAME = gethostcacheindexforkey("name");
+ me.currentServerName = strzone(gethostcachestring(SLIST_FIELD_NAME, i));
+ me.nameLabel.setText(me.nameLabel, me.currentServerName);
+
+ SLIST_FIELD_CNAME = gethostcacheindexforkey("cname");
+ me.currentServerCName = strzone(gethostcachestring(SLIST_FIELD_CNAME, i));
+ CURRENT_IP = me.currentServerCName; //used by join button
+ me.cnameLabel.setText(me.cnameLabel, me.currentServerCName);
+
+ SLIST_FIELD_QCSTATUS = gethostcacheindexforkey("qcstatus");
+ s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
+ m = tokenizebyseparator(s, ":");
+ if(m > 1)
+ {
+ typestr = argv (0);
+ versionstr = argv(1);
+ }
+ else
+ {
+ typestr = "N.A.";
+ versionstr = "N.A.";
+ }
+ me.currentServerType = strzone(typestr);
+ me.typeLabel.setText(me.typeLabel, me.currentServerType);
+
+
+ SLIST_FIELD_MAP = gethostcacheindexforkey("map");
+ me.currentServerMap = strzone(gethostcachestring(SLIST_FIELD_MAP, i));
+ me.mapLabel.setText(me.mapLabel, me.currentServerMap);
+
+ SLIST_FIELD_PLAYERS = gethostcacheindexforkey("players");
+ me.currentServerPlayers = strzone(gethostcachestring(SLIST_FIELD_PLAYERS, i));
+ me.rawPlayerList.setPlayerList(me.rawPlayerList, me.currentServerPlayers);
+
+ SLIST_FIELD_NUMHUMANS = gethostcacheindexforkey("numhumans");
+ numh = ftos(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i));
+ SLIST_FIELD_MAXPLAYERS = gethostcacheindexforkey("maxplayers");
+ maxp = ftos(gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i));
+ me.currentServerNumPlayers = strzone(strcat(numh,"/",maxp));
+ me.numPlayersLabel.setText(me.numPlayersLabel, me.currentServerNumPlayers);
+
+ SLIST_FIELD_NUMBOTS = gethostcacheindexforkey("numbots");
+ s = ftos(gethostcachenumber(SLIST_FIELD_NUMBOTS, i));
+ me.currentServerNumBots = strzone(s);
+ me.numBotsLabel.setText(me.numBotsLabel, me.currentServerNumBots);
+
+ SLIST_FIELD_MOD = gethostcacheindexforkey("mod");
+ me.currentServerMod = strzone(gethostcachestring(SLIST_FIELD_MOD, i));
+ me.modLabel.setText(me.modLabel, me.currentServerMod);
+
+ me.currentServerVersion = strzone(versionstr);
+ me.versionLabel.setText(me.versionLabel, me.currentServerVersion);
+
+ SLIST_FIELD_PING = gethostcacheindexforkey("ping");
+ s = ftos(gethostcachenumber(SLIST_FIELD_PING, i));
+ me.currentServerPing = strzone(s);
+ me.pingLabel.setText(me.pingLabel, me.currentServerPing);
+}
+
+void fillNexuizServerInfoDialog(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TD(me, 1, me.columns, e = makeNexuizTextLabel(0.5, ""));
+ e.alpha = 1;
+ e.colorL = SKINCOLOR_SERVERINFO_NAME;
+ e.allowCut = 1;
+ me.nameLabel = e;
+ me.TR(me);
+ me.TD(me, 1, me.columns, e = makeNexuizTextLabel(0.5, ""));
+ e.alpha = 1;
+ e.colorL = SKINCOLOR_SERVERINFO_IP;
+ e.allowCut = 1;
+ me.cnameLabel = e;
+
+ me.TR(me);
+ me.TD(me, 1, 6, e = makeNexuizTextLabel(0, "Players :"));
+ e.alpha = 1;
+ me.TR(me);
+ me.TD(me, me.rows - 4, 5.5, e = makeNexuizPlayerList());
+ me.rawPlayerList = e;
+
+ me.gotoRC(me, 1, 6); me.setFirstColumn(me, me.currentColumn);
+
+ me.TR(me);
+ me.TD(me, 1, 1.75, e = makeNexuizTextLabel(0, "Type :"));
+ e.alpha = 1;
+ me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
+ e.allowCut = 1;
+ me.typeLabel = e;
+ me.TR(me);
+ me.TD(me, 1, 1.75, e = makeNexuizTextLabel(0, "Map :"));
+ e.alpha = 1;
+ me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
+ e.allowCut = 1;
+ me.mapLabel = e;
+ me.TR(me);
+ me.TD(me, 1, 1.75, e = makeNexuizTextLabel(0, "Players :"));
+ e.alpha = 1;
+ me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
+ e.allowCut = 1;
+ me.numPlayersLabel = e;
+ me.TR(me);
+ me.TD(me, 1, 1.75, e = makeNexuizTextLabel(0, "Bots :"));
+ e.alpha = 1;
+ me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
+ e.allowCut = 1;
+ me.numBotsLabel = e;
+ me.TR(me);
+ me.TD(me, 1, 1.75, e = makeNexuizTextLabel(0, "Mod :"));
+ e.alpha = 1;
+ me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
+ e.allowCut = 1;
+ me.modLabel = e;
+ me.TR(me);
+ me.TD(me, 1, 1.75, e = makeNexuizTextLabel(0, "Version :"));
+ e.alpha = 1;
+ me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
+ e.allowCut = 1;
+ me.versionLabel = e;
+ me.TR(me);
+ me.TD(me, 1, 1.75, e = makeNexuizTextLabel(0, "Ping :"));
+ e.alpha = 1;
+ me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
+ e.allowCut = 1;
+ me.pingLabel = e;
+
+ me.gotoRC(me, me.rows - 1, 0);
+
+ me.TD(me, 1, me.columns - 6, e = makeNexuizButton("OK", '0 0 0'));
+ e.onClick = Dialog_Close;
+ e.onClickEntity = me;
+ me.TD(me, 1, me.columns - 6, e = makeNexuizButton("Join!", '0 0 0'));
+ e.onClick = Join_Click;
+ e.onClickEntity = me;
+}
+
+void Join_Click(entity me)
+{
+ localcmd("connect ", CURRENT_IP, "\n");
+}
+
+#endif
Modified: trunk/data/qcsrc/menu/nexuiz/mainwindow.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/mainwindow.c 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/qcsrc/menu/nexuiz/mainwindow.c 2008-11-12 13:38:46 UTC (rev 5040)
@@ -7,6 +7,7 @@
ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
ATTRIB(MainWindow, winnerDialog, entity, NULL)
ATTRIB(MainWindow, radarDialog, entity, NULL)
+ ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
ATTRIB(MainWindow, mainNexposee, entity, NULL)
ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
ENDCLASS(MainWindow)
@@ -54,6 +55,10 @@
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.serverInfoDialog = i = spawnNexuizServerInfoDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
me.mainNexposee = n = spawnNexuizNexposee();
/*
if(checkextension("DP_GECKO_SUPPORT"))
Added: trunk/data/qcsrc/menu/nexuiz/playerlist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/playerlist.c (rev 0)
+++ trunk/data/qcsrc/menu/nexuiz/playerlist.c 2008-11-12 13:38:46 UTC (rev 5040)
@@ -0,0 +1,137 @@
+#ifdef INTERFACE
+CLASS(NexuizPlayerList) EXTENDS(NexuizListBox)
+ ATTRIB(NexuizPlayerList, rowsPerItem, float, 1)
+ METHOD(NexuizPlayerList, resizeNotify, void(entity, vector, vector, vector, vector))
+ METHOD(NexuizPlayerList, drawListBoxItem, void(entity, float, vector, float))
+ ATTRIB(NexuizPlayerList, realFontSize, vector, '0 0 0')
+ ATTRIB(NexuizPlayerList, columnNameOrigin, float, 0)
+ ATTRIB(NexuizPlayerList, columnNameSize, float, 0)
+ ATTRIB(NexuizPlayerList, realUpperMargin, float, 0)
+ ATTRIB(NexuizPlayerList, origin, vector, '0 0 0')
+ ATTRIB(NexuizPlayerList, itemAbsSize, vector, '0 0 0')
+ METHOD(NexuizPlayerList, setPlayerList, void(entity, string))
+ METHOD(NexuizPlayerList, getPlayerList, string(entity, float, float))
+ ATTRIB(NexuizPlayerList, playerList, float, -1)
+ENDCLASS(NexuizPlayerList)
+entity makeNexuizPlayerList();
+#endif
+
+#ifdef IMPLEMENTATION
+
+#define PLAYERPARM_SCORE 0
+#define PLAYERPARM_PING 1
+#define PLAYERPARM_NAME 2
+#define PLAYERPARM_COUNT 3
+
+entity makeNexuizPlayerList()
+{
+ entity me;
+ me = spawnNexuizPlayerList();
+ me.configureNexuizListBox(me);
+ return me;
+}
+
+void setPlayerListNexuizPlayerList(entity me, string plist)
+{
+ dprint(plist,"------------\n");
+
+ float buf,i;
+ string s;
+
+ buf = buf_create();
+ me.nItems = tokenizebyseparator(plist, "\n");
+ for(i = 0; i < me.nItems; ++i)
+ {
+ bufstr_set(buf, i * PLAYERPARM_COUNT + PLAYERPARM_NAME, argv(i)); // -666 100 "^4Nex ^2Player"
+ }
+
+ for(i = 0; i < me.nItems; ++i)
+ {
+ s = bufstr_get(buf, i * PLAYERPARM_COUNT + PLAYERPARM_NAME);
+ tokenize_sane(s);
+ bufstr_set(buf, i * PLAYERPARM_COUNT + PLAYERPARM_SCORE, argv(0)); // -666
+ bufstr_set(buf, i * PLAYERPARM_COUNT + PLAYERPARM_PING, argv(1)); // 100
+ bufstr_set(buf, i * PLAYERPARM_COUNT + PLAYERPARM_NAME, argv(2)); // ^4Nex ^2Player
+ }
+ me.playerList = buf;
+}
+
+string getPlayerListNexuizPlayerList(entity me, float i, float key)
+{
+ return bufstr_get(me.playerList, i * PLAYERPARM_COUNT + key);
+}
+
+void resizeNotifyNexuizPlayerList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
+{
+ me.origin = absOrigin;
+ me.itemAbsSize = '0 0 0';
+ resizeNotifyNexuizListBox(me, relOrigin, relSize, absOrigin, absSize);
+
+ me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize_y * me.itemHeight));
+ me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize_x * (1 - me.controlWidth)));
+ me.realUpperMargin = 0.5 * (1 - me.realFontSize_y);
+
+ me.columnNameOrigin = me.realFontSize_x;
+ me.columnNameSize = 1 - 2 * me.realFontSize_x;
+}
+
+void drawListBoxItemNexuizPlayerList(entity me, float i, vector absSize, float isSelected)
+{
+ string s, ch, ch2;
+ float maxTextLen, textLen;
+ float j;
+ vector theOrigin, theSize, theColor;
+ float theAlpha;
+ float brightness;
+
+
+ s = me.getPlayerList(me, i, PLAYERPARM_NAME);
+ maxTextLen = strlen(draw_TextShortenToWidth(strdecolorize(s), 0.95 * me.columnNameSize / me.realFontSize_x, 0));
+ brightness = cvar("r_textbrightness");
+ theOrigin = me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0) * me.realFontSize_x)) * eX ;
+ theSize = me.realFontSize;
+ theColor = '1 1 1';
+ theAlpha = 1;
+
+ for(j = 0; j < strlen(s); ++j)
+ {
+ ch = substring(s, j, 1);
+ if(ch == "^")
+ {
+ ch2 = substring(s, j+1, 1);
+ if(ch2 == "0" || stof(ch2))// digit?
+ {
+ switch(stof(ch2))
+ {
+ case 0: theColor = '0 0 0'; theAlpha = 1; break;
+ case 1: theColor = '1 0 0'; theAlpha = 1; break;
+ case 2: theColor = '0 1 0'; theAlpha = 1; break;
+ case 3: theColor = '1 1 0'; theAlpha = 1; break;
+ case 4: theColor = '0 0 1'; theAlpha = 1; break;
+ case 5: theColor = '0 1 1'; theAlpha = 1; break;
+ case 6: theColor = '1 0 1'; theAlpha = 1; break;
+ case 7: theColor = '1 1 1'; theAlpha = 1; break;
+ case 8: theColor = '1 1 1'; theAlpha = 0.5; break;
+ case 9: theColor = '0.5 0.5 0.5'; theAlpha = 1; break;
+ }
+ theColor = theColor * (1 - brightness) + brightness * '1 1 1';
+ ++j;
+ continue;
+ }
+ }
+
+ if (textLen < maxTextLen)
+ {
+ draw_Text(theOrigin, ch, theSize, theColor, theAlpha, 0);
+ theOrigin += eX * draw_TextWidth(ch, 0) * me.realFontSize_x;
+ ++textLen;
+ }
+ else
+ {
+ draw_Text(theOrigin, "...", theSize, theColor, theAlpha, 0);
+ break;
+ }
+ }
+}
+
+#endif
Modified: trunk/data/qcsrc/menu/nexuiz/serverlist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/serverlist.c 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/qcsrc/menu/nexuiz/serverlist.c 2008-11-12 13:38:46 UTC (rev 5040)
@@ -545,6 +545,23 @@
if(i < me.nItems)
ToggleFavorite(me.selectedServer);
}
+ else if(scan == K_MOUSE2)
+ {
+ if(i == me.lastClickedDemo)
+ if(time < me.lastClickedTime + 0.3)
+ {
+ // DOUBLE CLICK!
+ main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
+ DialogOpenButton_Click(NULL, main.serverInfoDialog);
+ }
+ me.lastClickedServer = i;
+ me.lastClickedTime = time;
+ }
+ else if(scan == K_MOUSE3 || scan == K_SPACE)
+ {
+ main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
+ DialogOpenButton_Click(NULL, main.serverInfoDialog);
+ }
else if(keyDownListBox(me, scan, ascii, shift))
return 1;
else if(!me.controlledTextbox)
Modified: trunk/data/qcsrc/menu/skin-customizables.inc
===================================================================
--- trunk/data/qcsrc/menu/skin-customizables.inc 2008-11-12 12:29:03 UTC (rev 5039)
+++ trunk/data/qcsrc/menu/skin-customizables.inc 2008-11-12 13:38:46 UTC (rev 5040)
@@ -53,6 +53,7 @@
SKINVECTOR(COLOR_DIALOG_WEAPONS, '1 0.7 0.7');
SKINVECTOR(COLOR_DIALOG_RADAR, '0.7 0.7 1');
SKINVECTOR(COLOR_DIALOG_DEMOBROSWER, '0.7 0.7 1');
+ SKINVECTOR(COLOR_DIALOG_SERVERINFO, '0.7 0.7 1');
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
@@ -192,6 +193,10 @@
SKINFLOAT(ALPHA_SERVERLIST_FAVORITE, 0.8);
SKINVECTOR(COLOR_SERVERLIST_FAVORITE, '1 1 1');
+ // item: server info
+ SKINVECTOR(COLOR_SERVERINFO_NAME, '1 1 1');
+ SKINVECTOR(COLOR_SERVERINFO_IP, '0.4 0.4 0.7');
+
// item: skin list
SKINVECTOR(COLOR_SKINLIST_TITLE, '1 1 1');
SKINVECTOR(COLOR_SKINLIST_AUTHOR, '0.4 0.4 0.7');
More information about the nexuiz-commits
mailing list