[nexuiz-commits] r6378 - in branches/nexuiz-2.0: . data/qcsrc/menu/item data/qcsrc/menu/nexuiz

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Mar 30 09:22:00 EDT 2009


Author: div0
Date: 2009-03-30 09:21:59 -0400 (Mon, 30 Mar 2009)
New Revision: 6378

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/qcsrc/menu/item/label.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c
Log:
r6040 | esteel | 2009-03-03 18:39:59 +0100 (Tue, 03 Mar 2009) | 1 line
use part of terencehills patch and moved the skin colors to the right in the playersetup dialog.  seems to fit the overall structure better
r6041 | esteel | 2009-03-03 19:23:03 +0100 (Tue, 03 Mar 2009) | 1 line
second part of terencehills patch, colored name preview
r6043 | div0 | 2009-03-03 20:09:41 +0100 (Tue, 03 Mar 2009) | 2 lines
remove a weird empty window
r6367 | esteel | 2009-03-30 12:56:50 +0200 (Mon, 30 Mar 2009) | 1 line
fix the namepreview. display changes at once now! really can be in 2.5 now
r6375 | esteel | 2009-03-30 14:42:50 +0200 (Mon, 30 Mar 2009) | 1 line
patch by terencehill to make the color buttons align correctly
r6376 | div0 | 2009-03-30 14:59:37 +0200 (Mon, 30 Mar 2009) | 2 lines
fix the last commit. Now the feature is ready..


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-03-30 13:10:13 UTC (rev 6377)
+++ branches/nexuiz-2.0/.patchsets	2009-03-30 13:21:59 UTC (rev 6378)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-6039,6044-6357,6363-6364
+revisions_applied = 1-6357,6363-6364,6367-6367,6375-6376

Modified: branches/nexuiz-2.0/data/qcsrc/menu/item/label.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/item/label.c	2009-03-30 13:10:13 UTC (rev 6377)
+++ branches/nexuiz-2.0/data/qcsrc/menu/item/label.c	2009-03-30 13:21:59 UTC (rev 6378)
@@ -9,6 +9,7 @@
 	ATTRIB(Label, fontSize, float, 8)
 	ATTRIB(Label, align, float, 0.5)
 	ATTRIB(Label, allowCut, float, 0)
+	ATTRIB(Label, allowColors, float, 0)
 	ATTRIB(Label, keepspaceLeft, float, 0) // for use by subclasses (radiobuttons for example)
 	ATTRIB(Label, keepspaceRight, float, 0)
 	ATTRIB(Label, marginLeft, float, 0) // alternate way to specify keepspace* (in characters from the font)
@@ -32,7 +33,7 @@
 void setTextLabel(entity me, string txt)
 {
 	me.text = txt;
-	me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(me.realFontSize_x * draw_TextWidth(me.text, 0), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
+	me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(me.realFontSize_x * draw_TextWidth(me.text, me.allowColors), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
 }
 void resizeNotifyLabel(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
 {
@@ -43,7 +44,7 @@
 		me.keepspaceLeft = me.marginLeft * me.realFontSize_x;
 	if(me.marginRight)
 		me.keepspaceRight = me.marginRight * me.realFontSize_x;
-	me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(me.realFontSize_x * draw_TextWidth(me.text, 0), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
+	me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(me.realFontSize_x * draw_TextWidth(me.text, me.allowColors), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
 	me.realOrigin_y = 0.5 * (1 - me.realFontSize_y);
 }
 void configureLabelLabel(entity me, string txt, float sz, float algn)
@@ -71,20 +72,23 @@
 		if(t)
 		{
 			if(me.allowCut) // FIXME allowCut incompatible with align != 0
-				draw_Text(me.realOrigin, draw_TextShortenToWidth(t, (1 - me.keepspaceLeft - me.keepspaceRight) / me.realFontSize_x, 0), me.realFontSize, me.colorL, me.alpha, 0);
+				draw_Text(me.realOrigin, draw_TextShortenToWidth(t, (1 - me.keepspaceLeft - me.keepspaceRight) / me.realFontSize_x, me.allowColors), me.realFontSize, me.colorL, me.alpha, me.allowColors);
 			else if(me.allowWrap) // FIXME allowWrap incompatible with align != 0
 			{
 				getWrappedLine_remaining = t;
 				o = me.realOrigin;
 				while(getWrappedLine_remaining)
 				{
-					t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight) / me.realFontSize_x, draw_TextWidth_WithoutColors);
-					draw_Text(o, t, me.realFontSize, me.colorL, me.alpha, 0);
+					if (me.allowColors)
+						t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight) / me.realFontSize_x, draw_TextWidth_WithColors);
+					else
+						t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight) / me.realFontSize_x, draw_TextWidth_WithoutColors);
+					draw_Text(o, t, me.realFontSize, me.colorL, me.alpha, me.allowColors);
 					o_y += me.realFontSize_y;
 				}
 			}
 			else
-				draw_Text(me.realOrigin, t, me.realFontSize, me.colorL, me.alpha, 0);
+				draw_Text(me.realOrigin, t, me.realFontSize, me.colorL, me.alpha, me.allowColors);
 		}
 }
 #endif

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c	2009-03-30 13:10:13 UTC (rev 6377)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c	2009-03-30 13:21:59 UTC (rev 6378)
@@ -30,15 +30,21 @@
 }
 void fillNexuizPlayerSettingsTab(entity me)
 {
-	entity e, pms, sl, e0, box;
-	float i, n;
+	entity e, pms, sl, label, e0, box;
+	float i, r, m, n;
 
 	me.TR(me);
-		me.TD(me, 1, 1, me.playerNameLabel = makeNexuizTextLabel(0, "Player Name:"));
+		me.TD(me, 1, 0.5, me.playerNameLabel = makeNexuizTextLabel(0, "Name:"));
 			me.playerNameLabelAlpha = me.playerNameLabel.alpha;
-		me.TD(me, 1, 2, box = makeNexuizInputBox(1, "_cl_name"));
+		me.TD(me, 1, 2.5, label = makeNexuizTextLabel(0, string_null));
+			label.allowCut = 1;
+			label.allowColors = 1;
+			label.alpha = 1;
+	me.TR(me);
+		me.TD(me, 1, 3.0, box = makeNexuizInputBox(1, "_cl_name"));
 			box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
 			box.maxLength = 63;
+			label.textEntity = box;
 	me.TR(me);
 		me.TD(me, 5, 1, e = makeNexuizColorpicker(box));
 		me.TD(me, 5, 2, e = makeNexuizCharmap(box));
@@ -47,23 +53,32 @@
 	me.TR(me);
 	me.TR(me);
 	me.TR(me);
-		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "First Color:"));
-		n = 16 - !cvar("developer");
-		for(i = 0; i < n; ++i)
-			me.TDNoMargin(me, 1, 2 / n, e = makeNexuizColorButton(1, 0, i), '1 0 0');
 	me.TR(me);
-		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Second Color:"));
-		for(i = 0; i < n; ++i)
-			me.TDNoMargin(me, 1, 2 / n, e = makeNexuizColorButton(2, 1, i), '1 0 0');
-	me.TR(me);
+	me.gotoRC(me, 8, 0.0);
 		pms = makeNexuizPlayerModelSelector();
+		me.TD(me, 1, 0.6, e = makeNexuizTextLabel(1, "Model:"));
 		me.TD(me, 1, 0.3, e = makeNexuizButton("<<", '0 0 0'));
 			e.onClick = PlayerModelSelector_Prev_Click;
 			e.onClickEntity = pms;
-		me.TD(me, me.rows - me.currentRow - 1, 2.4, pms);
+		me.TD(me, me.rows - me.currentRow - 1, 1.8, pms);
 		me.TD(me, 1, 0.3, e = makeNexuizButton(">>", '0 0 0'));
 			e.onClick = PlayerModelSelector_Next_Click;
 			e.onClickEntity = pms;
+	me.TR(me);
+		r = me.currentRow;
+		m = me.rows - r - 2;
+		n = 16 - !cvar("developer");
+		m = m / (n - 1);
+		for(i = 0; i < n; ++i)
+		{
+			me.gotoRC(me, r + i * m, 0.1);
+			me.TDNoMargin(me, m, 0.2, e = makeNexuizColorButton(1, 0, i), '0 1 0');
+		}
+		for(i = 0; i < n; ++i)
+		{
+			me.gotoRC(me, r + i * m, 0.4);
+			me.TDNoMargin(me, m, 0.2, e = makeNexuizColorButton(2, 1, i), '0 1 0');
+		}
 
 	me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
 		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Field of View:"));
@@ -100,13 +115,13 @@
 	me.TR(me);
 		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Crosshair:"));
 		for(i = 1; i <= 10; ++i) {
-			me.TDNoMargin(me, 1, 2 / 10, e = makeNexuizCrosshairButton(3, i), '0 0 0');
+			me.TDNoMargin(me, 1, 2 / 10, e = makeNexuizCrosshairButton(3, i), '1 1 0');
 			setDependent(e, "crosshair_per_weapon", 0, 0);
 		}
 	me.TR(me);
 		me.TDempty(me, 1);
 		for(i = 11; i <= 20; ++i) {
-			me.TDNoMargin(me, 1, 2 / 10, e = makeNexuizCrosshairButton(3, i), '0 0 0');
+			me.TDNoMargin(me, 1, 2 / 10, e = makeNexuizCrosshairButton(3, i), '1 1 0');
 			setDependent(e, "crosshair_per_weapon", 0, 0);
 		}
 	me.TR(me);



More information about the nexuiz-commits mailing list