Logic UI: Changing Controllers names to follow Sensors and actuators (back to have...
authorNathan Letwory <nathan@letworyinteractive.com>
Wed, 14 Jul 2010 23:51:21 +0000 (23:51 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Wed, 14 Jul 2010 23:51:21 +0000 (23:51 +0000)
Cosmetic commit, no structural/big code changes (patch by dfelinto).

source/blender/editors/space_logic/logic_window.c
source/blender/makesrna/intern/rna_controller.c

index 005ebfb5b88616c9686c90821414c3cd7dd6b171..c4a42d89758101d8dfd9993f22c717c4dc836298 100644 (file)
@@ -644,17 +644,17 @@ static char *controller_name(int type)
 {
        switch (type) {
        case CONT_LOGIC_AND:
-               return "AND";
+               return "And";
        case CONT_LOGIC_OR:
-               return "OR";
+               return "Or";
        case CONT_LOGIC_NAND:
-               return "NAND";
+               return "Nand";
        case CONT_LOGIC_NOR:
-               return "NOR";
+               return "Nor";
        case CONT_LOGIC_XOR:
-               return "XOR";
+               return "Xor";
        case CONT_LOGIC_XNOR:
-               return "XNOR";
+               return "Xnor";
        case CONT_EXPRESSION:
                return "Expression";
        case CONT_PYTHON:
@@ -3537,7 +3537,8 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, i
        uiLayout *box, *row, *subrow;
        bController *cont= (bController *)ptr->data;
 
-       char name[3]; //XXX provisorly for state number
+       char state[3];
+       sprintf(state, "%d", RNA_int_get(ptr, "state"));
        
        box= uiLayoutBox(layout);
        row= uiLayoutRow(box, 0);
@@ -3546,15 +3547,14 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, i
        if(RNA_boolean_get(ptr, "expanded")) {
                uiItemR(row, ptr, "type", 0, "", 0);
                uiItemR(row, ptr, "name", 0, "", 0);
+               /* XXX provisory for Blender 2.50Beta */
+               uiDefBlockBut(uiLayoutGetBlock(layout), controller_state_mask_menu, cont, state, (short)(xco+width-44), yco, 22+22, UI_UNIT_Y, "Set controller state index (from 1 to 30)");
        } else {
                uiItemL(row, controller_name(cont->type), 0);
                uiItemL(row, cont->name, 0);
+               uiItemL(row, state, 0);
        }
 
-       /* XXX provisory for Blender 2.50Beta */
-       sprintf(name, "%d", RNA_int_get(ptr, "state"));
-       uiDefBlockBut(uiLayoutGetBlock(layout), controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22+22, UI_UNIT_Y, "Set controller state index (from 1 to 30)");
-
        uiItemR(row, ptr, "priority", 0, "", 0);
 
        if(RNA_boolean_get(ptr, "expanded")==0) {
index 6307c39be52d25968dc1647662f1e52678174aaa..c66ce532351edcd5eb5506e8a1388925a49ceb2d 100644 (file)
 #include "DNA_controller_types.h"
 
 EnumPropertyItem controller_type_items[] ={
-       {CONT_LOGIC_AND, "LOGIC_AND", 0, "AND", "Logic And"},
-       {CONT_LOGIC_OR, "LOGIC_OR", 0, "OR", "Logic Or"},
-       {CONT_LOGIC_NAND, "LOGIC_NAND", 0, "NAND", "Logic Nand"},
-       {CONT_LOGIC_NOR, "LOGIC_NOR", 0, "NOR", "Logic Nor"},
-       {CONT_LOGIC_XOR, "LOGIC_XOR", 0, "XOR", "Logic Xor"},
-       {CONT_LOGIC_XNOR, "LOGIC_XNOR", 0, "XNOR", "Logic Xnor"},
+       {CONT_LOGIC_AND, "LOGIC_AND", 0, "And", "Logic And"},
+       {CONT_LOGIC_OR, "LOGIC_OR", 0, "Or", "Logic Or"},
+       {CONT_LOGIC_NAND, "LOGIC_NAND", 0, "Nand", "Logic Nand"},
+       {CONT_LOGIC_NOR, "LOGIC_NOR", 0, "Nor", "Logic Nor"},
+       {CONT_LOGIC_XOR, "LOGIC_XOR", 0, "Xor", "Logic Xor"},
+       {CONT_LOGIC_XNOR, "LOGIC_XNOR", 0, "Xnor", "Logic Xnor"},
        {CONT_EXPRESSION, "EXPRESSION", 0, "Expression", ""},
        {CONT_PYTHON, "PYTHON", 0, "Python Script", ""},
        {0, NULL, 0, NULL, NULL}};