1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:53:53 +00:00

allow the use of record types in string filters

This commit is contained in:
Marc Zinnschlag 2013-09-05 13:59:09 +02:00
parent 8bebe7179c
commit f2e86e860e

View file

@ -3,6 +3,8 @@
#include <components/misc/stringops.hpp>
#include "universalid.hpp"
namespace CSMWorld
{
namespace Columns
@ -271,7 +273,7 @@ namespace
bool CSMWorld::Columns::hasEnums (ColumnId column)
{
return getEnumNames (column)!=0;
return getEnumNames (column)!=0 || column==ColumnId_RecordType;
}
std::vector<std::string> CSMWorld::Columns::getEnums (ColumnId column)
@ -281,6 +283,13 @@ std::vector<std::string> CSMWorld::Columns::getEnums (ColumnId column)
if (const char **table = getEnumNames (column))
for (int i=0; table[i]; ++i)
enums.push_back (table[i]);
else if (column==ColumnId_RecordType)
{
enums.push_back (""); // none
for (int i=UniversalId::Type_None+1; i<UniversalId::NumberOfTypes; ++i)
enums.push_back (UniversalId (static_cast<UniversalId::Type> (i)).getTypeName());
}
return enums;
}