         SetEditable(SetValue(parent.children[1], value.GetBool(), sameValue), editable && sameValue);
     else if (type == VAR_INT)
     {
-        if (info.enumNames is null || info.enumNames.empty)
+        if (info.name.Contains("Mask", false))
+            SetEditable(SetValue(parent.GetChild("LineEdit", true), value.ToString(), sameValue), editable && sameValue);
+        else if (info.enumNames is null || info.enumNames.empty)
             SetEditable(SetValue(parent.children[1], value.ToString(), sameValue), editable && sameValue);
         else
             SetEditable(SetValue(parent.children[1], value.GetInt(), sameValue), editable && sameValue);


bool inLoadAttributeEditor = false;
bool inEditAttribute = false;
bool showNonEditableAttribute = false;

Color normalTextColor(1.0f, 1.0f, 1.0f);

    SetAttributeEditorID(attrEdit, serializables);

    return attrEdit;
}

UIElement@ CreateAttributeBitSelector(UIElement@ parent, Array<Serializable@>@ serializables, uint index, uint subIndex)
{
    UIElement@ container = UIElement();
    parent.AddChild(container);
    parent.SetFixedHeight(38);
    container.SetFixedWidth(16 * 4 + 4);

    for (int i = 0; i < 2; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            CheckBox@ bitBox = CheckBox();
            bitBox.name = "BitSelect_" + String(i * 4 + j);
            container.AddChild(bitBox);
            bitBox.position = IntVector2(16 * j, 16 * i);
            bitBox.style = "CheckBox";
            bitBox.SetFixedHeight(16);

            SubscribeToEvent(bitBox,"Toggled", "HandleBitSelectionToggled");
        }
    }

    LineEdit@ attrEdit = CreateAttributeLineEdit(parent, serializables, index, subIndex);
    attrEdit.name = "LineEdit";
    SubscribeToEvent(attrEdit, "TextChanged", "HandleBitSelectionEdit");
    SubscribeToEvent(attrEdit, "TextFinished", "HandleBitSelectionEdit");
    return attrEdit;
}

void UpdateBitSelection(UIElement@ parent)
{
    int mask = 0;
    const int MAX_MASK_BITS = 8;
    for (int i = 0; i < MAX_MASK_BITS; i++)
    {
        CheckBox@ bitBox = parent.GetChild("BitSelect_" + String(i), true);
        mask = mask | (bitBox.checked ? 1 << i : 0);
    }

    if (mask == (1 << MAX_MASK_BITS) - 1 )
        mask = -1;

    inUpdateBitSelection = true;
    LineEdit@ attrEdit = parent.parent.GetChild("LineEdit", true);
    attrEdit.text = String(mask);
    inUpdateBitSelection = false;
}

void SetBitSelection(UIElement@ parent, int value)
{
    int mask = value;
    const int MAX_MASK_BITS = 8;
    if (mask ==  -1)
        mask = (1 << MAX_MASK_BITS) - 1;

    for (int i = 0; i < MAX_MASK_BITS; i++)
    {
        CheckBox@ bitBox = parent.GetChild("BitSelect_" + String(i), true);

        if ((1 << i) & mask != 0)
            bitBox.checked = true;
        else
            bitBox.checked = false;
    }
}

void HandleBitSelectionToggled(StringHash eventType, VariantMap& eventData)
{
    if (inUpdateBitSelection)
        return;

    CheckBox@ bitBox = eventData["Element"].GetPtr();

    UpdateBitSelection(bitBox.parent);
}

void HandleBitSelectionEdit(StringHash eventType, VariantMap& eventData)
{
    if (!inUpdateBitSelection)
    {
        LineEdit@ attrEdit = eventData["Element"].GetPtr();

        inUpdateBitSelection = true;
        SetBitSelection(attrEdit.parent, attrEdit.text.ToInt());
        inUpdateBitSelection = false;
    }

    EditAttribute(eventType, eventData);
}

UIElement@ CreateStringAttributeEditor(ListView@ list, Array<Serializable@>@ serializables, const AttributeInfo&in info, uint index, uint subIndex)
