Merge branch 'im-not-taking-you-anywhere' into 'master'

Fix #7901, make teleport fields non-interactive when mTeleport is false

Closes #7901

See merge request OpenMW/openmw!3986
fix-osga-rotate-wildly
Alexei Kotov 9 months ago
commit 359600db83

@ -164,6 +164,7 @@
Bug #7887: Editor: Mismatched reported script data size and actual data size causes a crash during save
Bug #7898: Editor: Invalid reference scales are allowed
Bug #7899: Editor: Doors can't be unlocked
Bug #7901: Editor: Teleport-related fields shouldn't be editable if a ref does not teleport
Feature #2566: Handle NAM9 records for manual cell references
Feature #3537: Shader-based water ripples
Feature #5173: Support for NiFogProperty

@ -1136,8 +1136,8 @@ namespace CSMWorld
template <typename ESXRecordT>
struct TeleportColumn : public Column<ESXRecordT>
{
TeleportColumn()
: Column<ESXRecordT>(Columns::ColumnId_Teleport, ColumnBase::Display_Boolean)
TeleportColumn(int flags)
: Column<ESXRecordT>(Columns::ColumnId_Teleport, ColumnBase::Display_Boolean, flags)
{
}
@ -1165,6 +1165,8 @@ namespace CSMWorld
QVariant get(const Record<ESXRecordT>& record) const override
{
if (!record.get().mTeleport)
return QVariant();
return QString::fromUtf8(record.get().mDestCell.c_str());
}
@ -1309,17 +1311,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
{
if (!record.get().mTeleport && mIsDoor)
return QVariant();
const ESM::Position& position = record.get().*mPosition;
return position.pos[mIndex];
}
@ -1343,17 +1349,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
{
if (!record.get().mTeleport && mIsDoor)
return QVariant();
const ESM::Position& position = record.get().*mPosition;
return osg::RadiansToDegrees(position.rot[mIndex]);
}

@ -593,7 +593,8 @@ CSMWorld::Data::Data(ToUTF8::FromType encoding, const Files::PathContainer& data
mRefs.addColumn(new ChargesColumn<CellRef>);
mRefs.addColumn(new EnchantmentChargesColumn<CellRef>);
mRefs.addColumn(new StackSizeColumn<CellRef>);
mRefs.addColumn(new TeleportColumn<CellRef>);
mRefs.addColumn(new TeleportColumn<CellRef>(
ColumnBase::Flag_Table | ColumnBase::Flag_Dialogue | ColumnBase::Flag_Dialogue_Refresh));
mRefs.addColumn(new TeleportCellColumn<CellRef>);
mRefs.addColumn(new PosColumn<CellRef>(&CellRef::mDoorDest, 0, true));
mRefs.addColumn(new PosColumn<CellRef>(&CellRef::mDoorDest, 1, true));

Loading…
Cancel
Save