r2048 - in branches/nexuiz-2.0/data: menu qcsrc/menu/custom
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Dec 14 05:13:02 EST 2006
Author: esteel
Date: 2006-12-14 05:13:02 -0500 (Thu, 14 Dec 2006)
New Revision: 2048
Modified:
branches/nexuiz-2.0/data/menu/joingame.menu
branches/nexuiz-2.0/data/menu/templates.menu
branches/nexuiz-2.0/data/qcsrc/menu/custom/joingame.qc
branches/nexuiz-2.0/data/qcsrc/menu/custom/joingame.qh
Log:
merged blacks colored ping patch from trunk
Modified: branches/nexuiz-2.0/data/menu/joingame.menu
===================================================================
--- branches/nexuiz-2.0/data/menu/joingame.menu 2006-12-14 09:27:13 UTC (rev 2047)
+++ branches/nexuiz-2.0/data/menu/joingame.menu 2006-12-14 10:13:02 UTC (rev 2048)
@@ -151,7 +151,7 @@
size '824 15'
action Nex_Action_EntryConnect
- DeriveTemplate Nex_HostCache_ValueField Ping
+ DeriveTemplate Nex_HostCache_Ping Ping
{
pos '0 0'
size [SList_Ping]
Modified: branches/nexuiz-2.0/data/menu/templates.menu
===================================================================
--- branches/nexuiz-2.0/data/menu/templates.menu 2006-12-14 09:27:13 UTC (rev 2047)
+++ branches/nexuiz-2.0/data/menu/templates.menu 2006-12-14 10:13:02 UTC (rev 2048)
@@ -224,6 +224,10 @@
{
type "Item_Nex_HostCache_Players"
}
+DeriveTemplate Label Nex_HostCache_Ping
+{
+ type "Item_Nex_HostCache_Ping"
+}
DeriveTemplate PictureButton Nex_HostCache_Entry
{
normal "$gfx/white"
Modified: branches/nexuiz-2.0/data/qcsrc/menu/custom/joingame.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/custom/joingame.qc 2006-12-14 09:27:13 UTC (rev 2047)
+++ branches/nexuiz-2.0/data/qcsrc/menu/custom/joingame.qc 2006-12-14 10:13:02 UTC (rev 2048)
@@ -111,3 +111,39 @@
self._update = Item_Nex_HostCache_Players_Update;
};
+
+//////////////////////////////////
+// Item_Nex_HostCache_Ping
+///////
+
+const vector HOSTCACHE_FAST_PING_COLOR = '1.0 1.0 0.0';
+const vector HOSTCACHE_MEDIUM_PING_COLOR = '0.0 1.0 0.0';
+const vector HOSTCACHE_SLOW_PING_COLOR = '1.0 0.0 0.0';
+
+const float HOSTCACHE_FAST_PING = 90;
+const float HOSTCACHE_SLOW_PING = 150;
+
+void() Item_Nex_HostCache_Ping_Update =
+{
+ local float ping;
+
+ Item_Nex_HostCache_ValueField_Update();
+
+ // AK 06 yes I know its not fast.. but its shorter..
+ ping = stof( self.text );
+ if( ping < HOSTCACHE_FAST_PING ) {
+ self.color = HOSTCACHE_FAST_PING_COLOR;
+ } else if( ping > HOSTCACHE_SLOW_PING ) {
+ self.color = HOSTCACHE_SLOW_PING_COLOR;
+ } else {
+ self.color = HOSTCACHE_MEDIUM_PING_COLOR;
+ }
+}
+
+void() Item_Nex_HostCache_Ping_Spawn =
+{
+ Item_Nex_HostCache_ValueField_Spawn();
+
+ self._update = Item_Nex_HostCache_Ping_Update;
+};
+
Modified: branches/nexuiz-2.0/data/qcsrc/menu/custom/joingame.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/custom/joingame.qh 2006-12-14 09:27:13 UTC (rev 2047)
+++ branches/nexuiz-2.0/data/qcsrc/menu/custom/joingame.qh 2006-12-14 10:13:02 UTC (rev 2048)
@@ -29,3 +29,7 @@
void() Item_Nex_HostCache_Players_Update;
void() Item_Nex_HostCache_Players_Spawn;
+// Item_Nex_HostCache_Ping Item_Nex_HostCache_ValueField
+void() Item_Nex_HostCache_Ping_Update;
+void() Item_Nex_HostCache_Ping_Spawn;
+
More information about the nexuiz-commits
mailing list