Logic Editor UI: sensor frequency active only when one of the triggers is on. Removin...
authorDalai Felinto <dfelinto@gmail.com>
Thu, 24 Mar 2011 21:07:54 +0000 (21:07 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Thu, 24 Mar 2011 21:07:54 +0000 (21:07 +0000)
I still would love to see a change in the action actuators (Action, Shape and FCurve) even if only a rename or unifying them in a single actuator (I do have some patch for that). Anyways

source/blender/editors/space_logic/logic_window.c

index ae4303f91a4b2ff51dc0cbb2bc357f2cee08ae28..8cbe56c852f8abfe8154c960b0393c7bbe98c96e 100644 (file)
@@ -3228,7 +3228,7 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo
 
 static void draw_sensor_internal_header(uiLayout *layout, PointerRNA *ptr)
 {
-       uiLayout *box, *split, *row;
+       uiLayout *box, *split, *subrow, *row;
 
        box= uiLayoutBox(layout);
        split = uiLayoutSplit(box, 0.45, 0);
@@ -3236,7 +3236,11 @@ static void draw_sensor_internal_header(uiLayout *layout, PointerRNA *ptr)
        row= uiLayoutRow(split, 1);
        uiItemR(row, ptr, "use_pulse_true_level", 0, "", ICON_DOTSUP);
        uiItemR(row, ptr, "use_pulse_false_level", 0, "", ICON_DOTSDOWN);
-       uiItemR(row, ptr, "frequency", 0, "Freq", ICON_NONE);
+
+       subrow=uiLayoutRow(row, 0);
+       uiLayoutSetActive(subrow, (RNA_boolean_get(ptr, "use_pulse_true_level")
+                                                       || RNA_boolean_get(ptr, "use_pulse_false_level")));
+       uiItemR(subrow, ptr, "frequency", 0, "Freq", ICON_NONE);
        
        row= uiLayoutRow(split, 1);
        uiItemR(row, ptr, "use_level", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
@@ -3683,7 +3687,7 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
 
        row= uiLayoutRow(layout, 0);
        uiItemR(row, ptr, "play_mode", 0, "", ICON_NONE);
-       uiItemR(row, ptr, "action", 0, NULL, ICON_NONE);
+       uiItemR(row, ptr, "action", 0, "", ICON_NONE);
        uiItemR(row, ptr, "use_continue_last_frame", 0, NULL, ICON_NONE);
 
        row= uiLayoutRow(layout, 0);
@@ -4275,7 +4279,7 @@ static void draw_actuator_shape_action(uiLayout *layout, PointerRNA *ptr)
 
        row= uiLayoutRow(layout, 0);
        uiItemR(row, ptr, "mode", 0, "", ICON_NONE);
-       uiItemR(row, ptr, "action", 0, NULL, ICON_NONE);
+       uiItemR(row, ptr, "action", 0, "", ICON_NONE);
        uiItemR(row, ptr, "use_continue_last_frame", 0, NULL, ICON_NONE);
 
        row= uiLayoutRow(layout, 0);