r2897 - in trunk/data/qcsrc/menu-div0test: . nexuiz

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Nov 4 03:06:52 EST 2007


Author: div0
Date: 2007-11-04 03:06:38 -0500 (Sun, 04 Nov 2007)
New Revision: 2897

Added:
   trunk/data/qcsrc/menu-div0test/color0.tga
   trunk/data/qcsrc/menu-div0test/color1.tga
   trunk/data/qcsrc/menu-div0test/color10.tga
   trunk/data/qcsrc/menu-div0test/color11.tga
   trunk/data/qcsrc/menu-div0test/color12.tga
   trunk/data/qcsrc/menu-div0test/color13.tga
   trunk/data/qcsrc/menu-div0test/color14.tga
   trunk/data/qcsrc/menu-div0test/color2.tga
   trunk/data/qcsrc/menu-div0test/color3.tga
   trunk/data/qcsrc/menu-div0test/color4.tga
   trunk/data/qcsrc/menu-div0test/color5.tga
   trunk/data/qcsrc/menu-div0test/color6.tga
   trunk/data/qcsrc/menu-div0test/color7.tga
   trunk/data/qcsrc/menu-div0test/color8.tga
   trunk/data/qcsrc/menu-div0test/color9.tga
   trunk/data/qcsrc/menu-div0test/nexuiz/colorbutton.c
Log:
oops, forgot to svn add some files


Added: trunk/data/qcsrc/menu-div0test/color0.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color0.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color1.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color1.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color10.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color10.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color11.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color11.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color12.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color12.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color13.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color13.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color14.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color14.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color2.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color2.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color3.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color3.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color4.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color4.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color5.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color5.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color6.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color6.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color7.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color7.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color8.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color8.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/color9.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/qcsrc/menu-div0test/color9.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/qcsrc/menu-div0test/nexuiz/colorbutton.c
===================================================================
--- trunk/data/qcsrc/menu-div0test/nexuiz/colorbutton.c	                        (rev 0)
+++ trunk/data/qcsrc/menu-div0test/nexuiz/colorbutton.c	2007-11-04 08:06:38 UTC (rev 2897)
@@ -0,0 +1,64 @@
+#ifdef INTERFACE
+CLASS(NexuizColorButton) EXTENDS(RadioButton)
+	METHOD(NexuizColorButton, configureNexuizColorButton, void(entity, float, float, float))
+	METHOD(NexuizColorButton, setChecked, void(entity, float))
+	ATTRIB(NexuizColorButton, fontSize, float, SKINFONTSIZE_NORMAL)
+	ATTRIB(NexuizColorButton, image, string, SKINGFX_COLORBUTTON)
+	ATTRIB(NexuizColorButton, image2, string, SKINGFX_COLORBUTTON_COLOR)
+
+	ATTRIB(NexuizColorButton, useDownAsChecked, float, 1)
+
+	ATTRIB(NexuizColorButton, cvarPart, float, 0)
+	ATTRIB(NexuizColorButton, cvarName, string, string_null)
+	ATTRIB(NexuizColorButton, cvarValueFloat, float, 0)
+	METHOD(NexuizColorButton, loadCvars, void(entity))
+	METHOD(NexuizColorButton, saveCvars, void(entity))
+ENDCLASS(NexuizColorButton)
+entity makeNexuizColorButton(float, float, float);
+#endif
+
+#ifdef IMPLEMENTATION
+entity makeNexuizColorButton(float theGroup, float theColor, float theValue)
+{
+	entity me;
+	me = spawnNexuizColorButton();
+	me.configureNexuizColorButton(me, theGroup, theColor, theValue);
+	return me;
+}
+void configureNexuizColorButtonNexuizColorButton(entity me, float theGroup, float theColor, float theValue)
+{
+	me.cvarName = "_cl_color";
+	me.cvarValueFloat = theValue;
+	me.cvarPart = theColor;
+	me.loadCvars(me);
+	me.configureRadioButton(me, string_null, me.fontSize, me.image, theGroup, 0);
+	me.srcMulti = 1;
+	me.src2 = strzone(strcat(me.image2, ftos(me.cvarValueFloat)));
+}
+void setCheckedNexuizColorButton(entity me, float val)
+{
+	if(val != me.checked)
+	{
+		me.checked = val;
+		me.saveCvars(me);
+	}
+}
+void loadCvarsNexuizColorButton(entity me)
+{
+	if(me.cvarPart == 1)
+		me.checked = (cvar(me.cvarName) & 240) == me.cvarValueFloat * 16;
+	else
+		me.checked = (cvar(me.cvarName) & 15) == me.cvarValueFloat;
+}
+void saveCvarsNexuizColorButton(entity me)
+{
+	if(me.checked)
+	{
+		if(me.cvarPart == 1)
+			cvar_set(me.cvarName, ftos(cvar(me.cvarName) & 15 + me.cvarValueFloat * 16));
+		else
+			cvar_set(me.cvarName, ftos(cvar(me.cvarName) & 240 + me.cvarValueFloat));
+	}
+	// TODO on an apply button, read _cl_color and execute the color command for it
+}
+#endif




More information about the nexuiz-commits mailing list