r4909 - in branches/nexuiz-2.0: . data/gfx/menu/silver data/gfx/menu/simplygray data/qcsrc/menu/item

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Oct 27 06:29:33 EDT 2008


Author: div0
Date: 2008-10-27 06:29:33 -0400 (Mon, 27 Oct 2008)
New Revision: 4909

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/gfx/menu/silver/skinvalues.txt
   branches/nexuiz-2.0/data/gfx/menu/simplygray/skinvalues.txt
   branches/nexuiz-2.0/data/qcsrc/menu/item/slider.c
Log:
r4907 | div0 | 2008-10-27 11:28:49 +0100 (Mon, 27 Oct 2008) | 2 lines
fix behaviour of sliders when clicking to scroll page-wise. Now never goes farther than were the mouse cursor is, easier to use that way!
r4908 | esteel | 2008-10-27 11:29:01 +0100 (Mon, 27 Oct 2008) | 1 line
corrected two skin authors

Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2008-10-27 10:29:01 UTC (rev 4908)
+++ branches/nexuiz-2.0/.patchsets	2008-10-27 10:29:33 UTC (rev 4909)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-4905
+revisions_applied = 1-4908

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/skinvalues.txt
===================================================================
--- branches/nexuiz-2.0/data/gfx/menu/silver/skinvalues.txt	2008-10-27 10:29:01 UTC (rev 4908)
+++ branches/nexuiz-2.0/data/gfx/menu/silver/skinvalues.txt	2008-10-27 10:29:33 UTC (rev 4909)
@@ -1,5 +1,5 @@
 title Silver
-author tZork
+author morfar
 
 // font sizes (used for everything)
 FONTSIZE_NORMAL                 12

Modified: branches/nexuiz-2.0/data/gfx/menu/simplygray/skinvalues.txt
===================================================================
--- branches/nexuiz-2.0/data/gfx/menu/simplygray/skinvalues.txt	2008-10-27 10:29:01 UTC (rev 4908)
+++ branches/nexuiz-2.0/data/gfx/menu/simplygray/skinvalues.txt	2008-10-27 10:29:33 UTC (rev 4909)
@@ -1,5 +1,5 @@
 title Simply Gray
-author ???
+author Morphed
 
 // font sizes (used for everything)
 FONTSIZE_NORMAL                 12

Modified: branches/nexuiz-2.0/data/qcsrc/menu/item/slider.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/item/slider.c	2008-10-27 10:29:01 UTC (rev 4908)
+++ branches/nexuiz-2.0/data/qcsrc/menu/item/slider.c	2008-10-27 10:29:33 UTC (rev 4909)
@@ -88,7 +88,7 @@
 	float inRange;
 	if(me.disabled)
 		return 0;
-	inRange = (me.value == median(me.valueMin, me.value, me.valueMax));
+	inRange = (almost_in_bounds(me.valueMin, me.value, me.valueMax));
 	if(key == K_LEFTARROW)
 	{
 		if(inRange)
@@ -178,10 +178,39 @@
 	}
 	else
 	{
+		float clickValue, pageValue, inRange;
+		clickValue = median(0, (pos_x - me.pressOffset - 0.5 * me.controlWidth) / (1 - me.textSpace - me.controlWidth), 1) * (me.valueMax - me.valueMin) + me.valueMin;
+		inRange = (almost_in_bounds(me.valueMin, me.value, me.valueMax));
 		if(pos_x < controlCenter)
-			me.keyDown(me, K_PGUP, 0, 0);
+		{
+			pageValue = me.value - me.valuePageStep;
+			if(me.valueStep)
+				clickValue = floor(clickValue / me.valueStep) * me.valueStep;
+			pageValue = max(pageValue, clickValue);
+			if(inRange)
+				me.setValue(me, median(me.valueMin, pageValue, me.valueMax));
+			else
+				me.setValue(me, me.valueMax);
+		}
 		else
-			me.keyDown(me, K_PGDN, 0, 0);
+		{
+			pageValue = me.value + me.valuePageStep;
+			if(me.valueStep)
+				clickValue = ceil(clickValue / me.valueStep) * me.valueStep;
+			pageValue = min(pageValue, clickValue);
+			if(inRange)
+				me.setValue(me, median(me.valueMin, pageValue, me.valueMax));
+			else
+				me.setValue(me, me.valueMax);
+		}
+		if(pageValue == clickValue)
+		{
+			controlCenter = (me.value - me.valueMin) / (me.valueMax - me.valueMin) * (1 - me.textSpace - me.controlWidth) + 0.5 * me.controlWidth;
+			me.pressed = 1;
+			me.pressOffset = pos_x - controlCenter;
+			me.previousValue = me.value;
+			//me.mouseDrag(me, pos);
+		}
 	}
 	return 1;
 }




More information about the nexuiz-commits mailing list