diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 5733fd83f..843d08281 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -197,7 +197,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mSpells.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_Skill, ColumnBase::Display_String)); mSpells.getNestableColumn(index)->addColumn( - new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_String)); // reuse attribute + new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_Attribute)); // reuse attribute mSpells.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_EffectRange, ColumnBase::Display_Integer)); mSpells.getNestableColumn(index)->addColumn( @@ -271,7 +271,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mEnchantments.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_Skill, ColumnBase::Display_String)); mEnchantments.getNestableColumn(index)->addColumn( - new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_String)); // reuse attribute + new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_Attribute)); // reuse attribute mEnchantments.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_EffectRange, ColumnBase::Display_Integer)); mEnchantments.getNestableColumn(index)->addColumn( diff --git a/apps/opencs/model/world/nestedcoladapterimp.hpp b/apps/opencs/model/world/nestedcoladapterimp.hpp index 2aa1123a3..951c7a610 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.hpp +++ b/apps/opencs/model/world/nestedcoladapterimp.hpp @@ -354,23 +354,7 @@ namespace CSMWorld } case 2: { - switch (effect.mAttribute) - { - // see ESM::Attribute::AttributeID in - case ESM::Attribute::Strength: - case ESM::Attribute::Intelligence: - case ESM::Attribute::Willpower: - case ESM::Attribute::Agility: - case ESM::Attribute::Speed: - case ESM::Attribute::Endurance: - case ESM::Attribute::Personality: - case ESM::Attribute::Luck: - { - return QString(ESM::Attribute::sAttributeNames[effect.mAttribute].c_str()); - } - case -1: return QString("N/A"); - default: return QVariant(); - } + return effect.mAttribute; } case 3: { @@ -431,21 +415,7 @@ namespace CSMWorld } case 2: { - std::string attr = value.toString().toStdString(); - if ("N/A" == attr) - { - effect.mAttribute = -1; - break; - } - - for (unsigned int i = 0; i < ESM::Attribute::Length; ++i) - { - if (ESM::Attribute::sAttributeNames[i] == attr) - { - effect.mAttribute = static_cast(i); - break; - } - } + effect.mAttribute = static_cast(value.toInt()); break; } case 3: diff --git a/apps/opencs/model/world/refidcollection.cpp b/apps/opencs/model/world/refidcollection.cpp index 2e53c2b1c..92fbfd08e 100644 --- a/apps/opencs/model/world/refidcollection.cpp +++ b/apps/opencs/model/world/refidcollection.cpp @@ -85,7 +85,7 @@ CSMWorld::RefIdCollection::RefIdCollection() mColumns.back().addColumn( new NestedChildColumn (Columns::ColumnId_Skill, ColumnBase::Display_String)); mColumns.back().addColumn( - new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_String)); // reuse attribute + new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_Attribute)); // reuse attribute mColumns.back().addColumn( new NestedChildColumn (Columns::ColumnId_EffectRange, ColumnBase::Display_Integer)); mColumns.back().addColumn(