[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29664] trunk/blender/source/blender/ editors/space_logic/logic_window.c: Logic UI: small fixes

Dalai Felinto dfelinto at gmail.com
Thu Jun 24 06:52:30 CEST 2010


Revision: 29664
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29664
Author:   dfelinto
Date:     2010-06-24 06:52:28 +0200 (Thu, 24 Jun 2010)

Log Message:
-----------
Logic UI: small fixes
1) "Actuators" menu wasn't working (it was showing the sensors one)
2) s/c/a top menus (the one showing options to hide/show objects and logics) with a big space.
- To have those options like this sounds a bit like a legacy, but for the time being at least, let's make it better :)
3) not show the s/c/a common header when object not visible

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_logic/logic_window.c

Modified: trunk/blender/source/blender/editors/space_logic/logic_window.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-06-24 00:53:11 UTC (rev 29663)
+++ trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-06-24 04:52:28 UTC (rev 29664)
@@ -4426,7 +4426,7 @@
 	layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first);
 	row = uiLayoutRow(layout, 1);
 	
-	uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco, 70, UI_UNIT_Y, "");		/* replace this with uiLayout stuff later */
+	uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco, 300, UI_UNIT_Y, "");		/* replace this with uiLayout stuff later */
 	
 	uiItemR(row, &logic_ptr, "controllers_show_selected_objects", 0, "Sel", 0);
 	uiItemR(row, &logic_ptr, "controllers_show_active_objects", 0, "Act", 0);
@@ -4439,6 +4439,9 @@
 		int iact;
 		
 		ob= (Object *)idar[a];
+
+		/* only draw the controller common header if "visible" */
+		if( (ob->scavisflag & OB_VIS_CONT) == 0) continue;
 	
 		/* Drawing the Controller Header common to all Selected Objects */
 
@@ -4475,7 +4478,7 @@
 
 		/* End of Drawing the Controller Header common to all Selected Objects */
 
-		if (!(ob->scavisflag & OB_VIS_CONT) || !(ob->scaflag & OB_SHOWCONT)) continue;
+		if ((ob->scaflag & OB_SHOWCONT) == 0) continue;
 		
 
 		uiItemS(layout);
@@ -4524,7 +4527,7 @@
 	layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first);
 	row = uiLayoutRow(layout, 1);
 	
-	uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco, 70, UI_UNIT_Y, "");		/* replace this with uiLayout stuff later */
+	uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco, 300, UI_UNIT_Y, "");		/* replace this with uiLayout stuff later */
 	
 	uiItemR(row, &logic_ptr, "sensors_show_selected_objects", 0, "Sel", 0);
 	uiItemR(row, &logic_ptr, "sensors_show_active_objects", 0, "Act", 0);
@@ -4537,11 +4540,14 @@
 		
 		ob= (Object *)idar[a];
 
+		/* only draw the sensor common header if "visible" */
+		if((ob->scavisflag & OB_VIS_SENS) == 0) continue;
+
 		row = uiLayoutRow(layout, 1);
 		uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
 		uiItemMenuEnumO(row, "LOGIC_OT_sensor_add", "type", "Add Sensor", 0);
 		
-		if (!(ob->scavisflag & OB_VIS_SENS) || !(ob->scaflag & OB_SHOWSENS)) continue;
+		if ((ob->scaflag & OB_SHOWSENS) == 0) continue;
 		
 		uiItemS(layout);
 		
@@ -4583,7 +4589,7 @@
 	layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first);
 	row = uiLayoutRow(layout, 1);
 	
-	uiDefBlockBut(block, sensor_menu, NULL, "Actuators", xco-10, yco, 70, UI_UNIT_Y, "");		/* replace this with uiLayout stuff later */
+	uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco, 300, UI_UNIT_Y, "");		/* replace this with uiLayout stuff later */
 	
 	uiItemR(row, &logic_ptr, "actuators_show_selected_objects", 0, "Sel", 0);
 	uiItemR(row, &logic_ptr, "actuators_show_active_objects", 0, "Act", 0);
@@ -4596,11 +4602,14 @@
 		
 		ob= (Object *)idar[a];
 
+		/* only draw the actuator common header if "visible" */
+		if( (ob->scavisflag & OB_VIS_ACT) == 0) continue;
+
 		row = uiLayoutRow(layout, 1);
 		uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
 		uiItemMenuEnumO(row, "LOGIC_OT_actuator_add", "type", "Add Actuator", 0);
 
-		if (!(ob->scavisflag & OB_VIS_ACT) || !(ob->scaflag & OB_SHOWACT)) continue;
+		if ((ob->scaflag & OB_SHOWACT) == 0) continue;
 		
 		uiItemS(layout);
 		





More information about the Bf-blender-cvs mailing list