[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16544] trunk/blender/source/blender/src/ buttons_logic.c: BGE bug #17621 fixed: State Actuator GUI Flaw.

Benoit Bolsee benoit.bolsee at online.be
Mon Sep 15 23:10:54 CEST 2008


Revision: 16544
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16544
Author:   ben2610
Date:     2008-09-15 23:10:51 +0200 (Mon, 15 Sep 2008)

Log Message:
-----------
BGE bug #17621 fixed: State Actuator GUI Flaw. State actuator didn't behave like the object state mask. Now it works the same: LMB select one state, deselects all others, multiple select with SHIFT-LMB

Modified Paths:
--------------
    trunk/blender/source/blender/src/buttons_logic.c

Modified: trunk/blender/source/blender/src/buttons_logic.c
===================================================================
--- trunk/blender/source/blender/src/buttons_logic.c	2008-09-15 18:23:34 UTC (rev 16543)
+++ trunk/blender/source/blender/src/buttons_logic.c	2008-09-15 21:10:51 UTC (rev 16544)
@@ -1647,6 +1647,16 @@
 	return (char*)"";
 }
 
+static void check_state_mask(void *arg1_but, void *arg2_mask)
+{
+	unsigned int *cont_mask = arg2_mask;
+	uiBut *but = arg1_but;
+
+	if (*cont_mask == 0 || !(G.qual & LR_SHIFTKEY))
+		*cont_mask = (1<<but->retval);
+	but->retval = B_REDR;
+}
+
 static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, short xco, short yco, short width)
 {
 	bSoundActuator      *sa      = NULL;
@@ -1674,6 +1684,7 @@
 	int myline, stbit;
 	uiBut *but;
 
+
 	/* yco is at the top of the rect, draw downwards */
 	uiBlockSetEmboss(block, UI_EMBOSSM);
 	set_col_actuator(act->type, 0);
@@ -2380,10 +2391,12 @@
 		for (wval=0; wval<15; wval+=5) {
 			uiBlockBeginAlign(block);
 			for (stbit=0; stbit<5; stbit++) {
-				uiDefButBitI(block, TOG, (1<<(stbit+wval)), 0, "",	(short)(xco+85+12*stbit+13*wval), yco-17, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(wval+stbit)));
+				but = uiDefButBitI(block,  TOG, 1<<(stbit+wval), stbit+wval, "",	(short)(xco+85+12*stbit+13*wval), yco-17, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+wval)));
+				uiButSetFunc(but, check_state_mask, but, &(staAct->mask));
 			}
 			for (stbit=0; stbit<5; stbit++) {
-				uiDefButBitI(block, TOG, (1<<(stbit+wval+15)), 0, "",	(short)(xco+85+12*stbit+13*wval), yco-29, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(wval+stbit+15)));
+				but = uiDefButBitI(block, TOG, 1<<(stbit+wval+15), stbit+wval+15, "",	(short)(xco+85+12*stbit+13*wval), yco-29, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+wval+15)));
+				uiButSetFunc(but, check_state_mask, but, &(staAct->mask));
 			}
 		}
 		uiBlockEndAlign(block);
@@ -2990,16 +3003,6 @@
 	}
 }
 
-static void check_object_state(void *arg1_but, void *arg2_mask)
-{
-	unsigned int *cont_mask = arg2_mask;
-	uiBut *but = arg1_but;
-
-	if (*cont_mask == 0 || !(G.qual & LR_SHIFTKEY))
-		*cont_mask = (1<<but->retval);
-	but->retval = B_REDR;
-}
-
 static void check_controller_state_mask(void *arg1_but, void *arg2_mask)
 {
 	unsigned int *cont_mask = arg2_mask;
@@ -3273,11 +3276,11 @@
 				uiBlockBeginAlign(block);
 				for (stbit=0; stbit<5; stbit++) {
 					but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset), stbit+offset, "",	(short)(xco+35+12*stbit+13*offset), yco, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset)));
-					uiButSetFunc(but, check_object_state, but, &(ob->state));
+					uiButSetFunc(but, check_state_mask, but, &(ob->state));
 				}
 				for (stbit=0; stbit<5; stbit++) {
 					but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset+15)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset+15), stbit+offset+15, "",	(short)(xco+35+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset+15)));
-					uiButSetFunc(but, check_object_state, but, &(ob->state));
+					uiButSetFunc(but, check_state_mask, but, &(ob->state));
 				}
 			}
 			uiBlockBeginAlign(block);





More information about the Bf-blender-cvs mailing list