mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 16:09:43 +00:00
Fix(columnimp.hpp): Use QVariant() constructor instead of UserType to
hide unused subs from view and make a member variable to tell if the column is used for a door or a regular position
This commit is contained in:
parent
1360eeb839
commit
4e59246d2d
1 changed files with 9 additions and 9 deletions
|
@ -1167,7 +1167,7 @@ namespace CSMWorld
|
|||
QVariant get(const Record<ESXRecordT>& record) const override
|
||||
{
|
||||
if (!record.get().mTeleport)
|
||||
return QVariant(QVariant::UserType);
|
||||
return QVariant();
|
||||
return QString::fromUtf8(record.get().mDestCell.c_str());
|
||||
}
|
||||
|
||||
|
@ -1312,21 +1312,21 @@ namespace CSMWorld
|
|||
{
|
||||
ESM::Position ESXRecordT::*mPosition;
|
||||
int mIndex;
|
||||
bool mIsDoor;
|
||||
|
||||
PosColumn(ESM::Position ESXRecordT::*position, int index, bool door)
|
||||
: Column<ESXRecordT>((door ? Columns::ColumnId_DoorPositionXPos : Columns::ColumnId_PositionXPos) + index,
|
||||
ColumnBase::Display_Float)
|
||||
, mPosition(position)
|
||||
, mIndex(index)
|
||||
, mIsDoor(door)
|
||||
{
|
||||
}
|
||||
|
||||
QVariant get(const Record<ESXRecordT>& record) const override
|
||||
{
|
||||
int column = this->mColumnId;
|
||||
if (!record.get().mTeleport && column >= Columns::ColumnId_DoorPositionXPos
|
||||
&& column <= Columns::ColumnId_DoorPositionZPos)
|
||||
return QVariant(QVariant::UserType);
|
||||
if (!record.get().mTeleport && mIsDoor)
|
||||
return QVariant();
|
||||
const ESM::Position& position = record.get().*mPosition;
|
||||
return position.pos[mIndex];
|
||||
}
|
||||
|
@ -1350,21 +1350,21 @@ namespace CSMWorld
|
|||
{
|
||||
ESM::Position ESXRecordT::*mPosition;
|
||||
int mIndex;
|
||||
bool mIsDoor;
|
||||
|
||||
RotColumn(ESM::Position ESXRecordT::*position, int index, bool door)
|
||||
: Column<ESXRecordT>((door ? Columns::ColumnId_DoorPositionXRot : Columns::ColumnId_PositionXRot) + index,
|
||||
ColumnBase::Display_Double)
|
||||
, mPosition(position)
|
||||
, mIndex(index)
|
||||
, mIsDoor(door)
|
||||
{
|
||||
}
|
||||
|
||||
QVariant get(const Record<ESXRecordT>& record) const override
|
||||
{
|
||||
int column = this->mColumnId;
|
||||
if (!record.get().mTeleport && column >= Columns::ColumnId_DoorPositionXRot
|
||||
&& column <= Columns::ColumnId::ColumnId_DoorPositionZRot)
|
||||
return QVariant(QVariant::UserType);
|
||||
if (!record.get().mTeleport && mIsDoor)
|
||||
return QVariant();
|
||||
const ESM::Position& position = record.get().*mPosition;
|
||||
return osg::RadiansToDegrees(position.rot[mIndex]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue