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:
parent
8bebe7179c
commit
f2e86e860e
1 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||
}
|
Loading…
Reference in a new issue