Procházet zdrojové kódy

work towards reflecting the typemask in the checkboxes in a combinatory manner again

AzaezelX před 7 měsíci
rodič
revize
d8fcbb7863

+ 1 - 1
Engine/source/console/dynamicTypes.h

@@ -267,7 +267,7 @@ class BitfieldConsoleBaseType : public ConsoleBaseType
                if (inString.find((*tbl)[i].getName()) != String::NPos)
                   mask.set(BIT(i));
             }
-            retVal = mask;
+            retVal = mask.getMask();
          }
          *((S32*)dptr) = retVal;
       }

+ 18 - 0
Engine/source/gui/editor/guiInspectorTypes.cpp

@@ -1522,6 +1522,24 @@ void GuiInspectorTypeBitMask32::setValue( StringTableEntry value )
 {
    U32 mask = dAtoui( value );
 
+   if (mask == 0 && mask != -1) //zero we need to double check. -1 we know is all on
+   {
+      BitSet32 bitMask;
+      const EnumTable* tbl = mInspector->getInspectObject(0)->getClassRep()->getEnumTable();
+      if (tbl)
+      {
+         const U32 numEnums = tbl->getNumValues();
+         String inString(value);
+
+         for (U32 i = 0; i < numEnums; i++)
+         {
+            if (inString.find((*tbl)[i].getName()) != String::NPos)
+               bitMask.set(BIT(i));
+         }
+         mask = bitMask.getMask();
+      }
+   }
+
    for ( U32 i = 0; i < mArrayCtrl->size(); i++ )
    {
       GuiCheckBoxCtrl *pCheckBox = dynamic_cast<GuiCheckBoxCtrl*>( mArrayCtrl->at(i) );