mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-02 06:06:41 +00:00
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
This commit is contained in:
commit
359600db83
3 changed files with 15 additions and 3 deletions
|
@ -164,6 +164,7 @@
|
||||||
Bug #7887: Editor: Mismatched reported script data size and actual data size causes a crash during save
|
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 #7898: Editor: Invalid reference scales are allowed
|
||||||
Bug #7899: Editor: Doors can't be unlocked
|
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 #2566: Handle NAM9 records for manual cell references
|
||||||
Feature #3537: Shader-based water ripples
|
Feature #3537: Shader-based water ripples
|
||||||
Feature #5173: Support for NiFogProperty
|
Feature #5173: Support for NiFogProperty
|
||||||
|
|
|
@ -1136,8 +1136,8 @@ namespace CSMWorld
|
||||||
template <typename ESXRecordT>
|
template <typename ESXRecordT>
|
||||||
struct TeleportColumn : public Column<ESXRecordT>
|
struct TeleportColumn : public Column<ESXRecordT>
|
||||||
{
|
{
|
||||||
TeleportColumn()
|
TeleportColumn(int flags)
|
||||||
: Column<ESXRecordT>(Columns::ColumnId_Teleport, ColumnBase::Display_Boolean)
|
: Column<ESXRecordT>(Columns::ColumnId_Teleport, ColumnBase::Display_Boolean, flags)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1165,6 +1165,8 @@ namespace CSMWorld
|
||||||
|
|
||||||
QVariant get(const Record<ESXRecordT>& record) const override
|
QVariant get(const Record<ESXRecordT>& record) const override
|
||||||
{
|
{
|
||||||
|
if (!record.get().mTeleport)
|
||||||
|
return QVariant();
|
||||||
return QString::fromUtf8(record.get().mDestCell.c_str());
|
return QString::fromUtf8(record.get().mDestCell.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1309,17 +1311,21 @@ namespace CSMWorld
|
||||||
{
|
{
|
||||||
ESM::Position ESXRecordT::*mPosition;
|
ESM::Position ESXRecordT::*mPosition;
|
||||||
int mIndex;
|
int mIndex;
|
||||||
|
bool mIsDoor;
|
||||||
|
|
||||||
PosColumn(ESM::Position ESXRecordT::*position, int index, bool door)
|
PosColumn(ESM::Position ESXRecordT::*position, int index, bool door)
|
||||||
: Column<ESXRecordT>((door ? Columns::ColumnId_DoorPositionXPos : Columns::ColumnId_PositionXPos) + index,
|
: Column<ESXRecordT>((door ? Columns::ColumnId_DoorPositionXPos : Columns::ColumnId_PositionXPos) + index,
|
||||||
ColumnBase::Display_Float)
|
ColumnBase::Display_Float)
|
||||||
, mPosition(position)
|
, mPosition(position)
|
||||||
, mIndex(index)
|
, mIndex(index)
|
||||||
|
, mIsDoor(door)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant get(const Record<ESXRecordT>& record) const override
|
QVariant get(const Record<ESXRecordT>& record) const override
|
||||||
{
|
{
|
||||||
|
if (!record.get().mTeleport && mIsDoor)
|
||||||
|
return QVariant();
|
||||||
const ESM::Position& position = record.get().*mPosition;
|
const ESM::Position& position = record.get().*mPosition;
|
||||||
return position.pos[mIndex];
|
return position.pos[mIndex];
|
||||||
}
|
}
|
||||||
|
@ -1343,17 +1349,21 @@ namespace CSMWorld
|
||||||
{
|
{
|
||||||
ESM::Position ESXRecordT::*mPosition;
|
ESM::Position ESXRecordT::*mPosition;
|
||||||
int mIndex;
|
int mIndex;
|
||||||
|
bool mIsDoor;
|
||||||
|
|
||||||
RotColumn(ESM::Position ESXRecordT::*position, int index, bool door)
|
RotColumn(ESM::Position ESXRecordT::*position, int index, bool door)
|
||||||
: Column<ESXRecordT>((door ? Columns::ColumnId_DoorPositionXRot : Columns::ColumnId_PositionXRot) + index,
|
: Column<ESXRecordT>((door ? Columns::ColumnId_DoorPositionXRot : Columns::ColumnId_PositionXRot) + index,
|
||||||
ColumnBase::Display_Double)
|
ColumnBase::Display_Double)
|
||||||
, mPosition(position)
|
, mPosition(position)
|
||||||
, mIndex(index)
|
, mIndex(index)
|
||||||
|
, mIsDoor(door)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant get(const Record<ESXRecordT>& record) const override
|
QVariant get(const Record<ESXRecordT>& record) const override
|
||||||
{
|
{
|
||||||
|
if (!record.get().mTeleport && mIsDoor)
|
||||||
|
return QVariant();
|
||||||
const ESM::Position& position = record.get().*mPosition;
|
const ESM::Position& position = record.get().*mPosition;
|
||||||
return osg::RadiansToDegrees(position.rot[mIndex]);
|
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 ChargesColumn<CellRef>);
|
||||||
mRefs.addColumn(new EnchantmentChargesColumn<CellRef>);
|
mRefs.addColumn(new EnchantmentChargesColumn<CellRef>);
|
||||||
mRefs.addColumn(new StackSizeColumn<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 TeleportCellColumn<CellRef>);
|
||||||
mRefs.addColumn(new PosColumn<CellRef>(&CellRef::mDoorDest, 0, true));
|
mRefs.addColumn(new PosColumn<CellRef>(&CellRef::mDoorDest, 0, true));
|
||||||
mRefs.addColumn(new PosColumn<CellRef>(&CellRef::mDoorDest, 1, true));
|
mRefs.addColumn(new PosColumn<CellRef>(&CellRef::mDoorDest, 1, true));
|
||||||
|
|
Loading…
Reference in a new issue