mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 19:56:38 +00:00 
			
		
		
		
	added missing position columns to reference table
This commit is contained in:
		
							parent
							
								
									4e5e3bd694
								
							
						
					
					
						commit
						f2875e234c
					
				
					 4 changed files with 105 additions and 0 deletions
				
			
		|  | @ -1216,6 +1216,74 @@ namespace CSMWorld | |||
|             return true; | ||||
|         } | ||||
|     }; | ||||
| 
 | ||||
|     template<typename ESXRecordT> | ||||
|     struct PosColumn : public Column<ESXRecordT> | ||||
|     { | ||||
|         ESM::Position ESXRecordT::* mPosition; | ||||
|         int mIndex; | ||||
| 
 | ||||
|         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) {} | ||||
| 
 | ||||
|         virtual QVariant get (const Record<ESXRecordT>& record) const | ||||
|         { | ||||
|             const ESM::Position& position = record.get().*mPosition; | ||||
|             return position.pos[mIndex]; | ||||
|         } | ||||
| 
 | ||||
|         virtual void set (Record<ESXRecordT>& record, const QVariant& data) | ||||
|         { | ||||
|             ESXRecordT record2 = record.get(); | ||||
| 
 | ||||
|             ESM::Position& position = record.get().*mPosition; | ||||
| 
 | ||||
|             position.pos[mIndex] = data.toFloat(); | ||||
| 
 | ||||
|             record.setModified (record2); | ||||
|         } | ||||
| 
 | ||||
|         virtual bool isEditable() const | ||||
|         { | ||||
|             return true; | ||||
|         } | ||||
|     }; | ||||
| 
 | ||||
|     template<typename ESXRecordT> | ||||
|     struct RotColumn : public Column<ESXRecordT> | ||||
|     { | ||||
|         ESM::Position ESXRecordT::* mPosition; | ||||
|         int mIndex; | ||||
| 
 | ||||
|         RotColumn (ESM::Position ESXRecordT::* position, int index, bool door) | ||||
|         : Column<ESXRecordT> ( | ||||
|           (door ? Columns::ColumnId_DoorPositionXRot : Columns::ColumnId_PositionXRot)+index, | ||||
|           ColumnBase::Display_Float), mPosition (position), mIndex (index) {} | ||||
| 
 | ||||
|         virtual QVariant get (const Record<ESXRecordT>& record) const | ||||
|         { | ||||
|             const ESM::Position& position = record.get().*mPosition; | ||||
|             return position.rot[mIndex]; | ||||
|         } | ||||
| 
 | ||||
|         virtual void set (Record<ESXRecordT>& record, const QVariant& data) | ||||
|         { | ||||
|             ESXRecordT record2 = record.get(); | ||||
| 
 | ||||
|             ESM::Position& position = record.get().*mPosition; | ||||
| 
 | ||||
|             position.rot[mIndex] = data.toFloat(); | ||||
| 
 | ||||
|             record.setModified (record2); | ||||
|         } | ||||
| 
 | ||||
|         virtual bool isEditable() const | ||||
|         { | ||||
|             return true; | ||||
|         } | ||||
|     }; | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
|  | @ -147,6 +147,18 @@ namespace CSMWorld | |||
|             { ColumnId_Magical, "Magical" }, | ||||
|             { ColumnId_Silver, "Silver" }, | ||||
|             { ColumnId_Filter, "Filter" }, | ||||
|             { ColumnId_PositionXPos, "Pos X" }, | ||||
|             { ColumnId_PositionYPos, "Pos Y" }, | ||||
|             { ColumnId_PositionZPos, "Pos Z" }, | ||||
|             { ColumnId_PositionXRot, "Rot X" }, | ||||
|             { ColumnId_PositionYRot, "Rot Y" }, | ||||
|             { ColumnId_PositionZRot, "Rot Z" }, | ||||
|             { ColumnId_DoorPositionXPos, "Teleport Pos X" }, | ||||
|             { ColumnId_DoorPositionYPos, "Teleport Pos Y" }, | ||||
|             { ColumnId_DoorPositionZPos, "Teleport Pos Z" }, | ||||
|             { ColumnId_DoorPositionXRot, "Teleport Rot X" }, | ||||
|             { ColumnId_DoorPositionYRot, "Teleport Rot Y" }, | ||||
|             { ColumnId_DoorPositionZRot, "Teleport Rot Z" }, | ||||
| 
 | ||||
|             { ColumnId_UseValue1, "Use value 1" }, | ||||
|             { ColumnId_UseValue2, "Use value 2" }, | ||||
|  |  | |||
|  | @ -140,6 +140,18 @@ namespace CSMWorld | |||
|             ColumnId_Magical = 107, | ||||
|             ColumnId_Silver = 108, | ||||
|             ColumnId_Filter = 109, | ||||
|             ColumnId_PositionXPos = 110, | ||||
|             ColumnId_PositionYPos = 111, | ||||
|             ColumnId_PositionZPos = 112, | ||||
|             ColumnId_PositionXRot = 113, | ||||
|             ColumnId_PositionYRot = 114, | ||||
|             ColumnId_PositionZRot = 115, | ||||
|             ColumnId_DoorPositionXPos = 116, | ||||
|             ColumnId_DoorPositionYPos = 117, | ||||
|             ColumnId_DoorPositionZPos = 118, | ||||
|             ColumnId_DoorPositionXRot = 119, | ||||
|             ColumnId_DoorPositionYRot = 120, | ||||
|             ColumnId_DoorPositionZRot = 121, | ||||
| 
 | ||||
|             // Allocated to a separate value range, so we don't get a collision should we ever need
 | ||||
|             // to extend the number of use values.
 | ||||
|  |  | |||
|  | @ -9,6 +9,7 @@ | |||
| #include <components/esm/esmreader.hpp> | ||||
| #include <components/esm/defs.hpp> | ||||
| #include <components/esm/loadglob.hpp> | ||||
| #include <components/esm/cellref.hpp> | ||||
| 
 | ||||
| #include "idtable.hpp" | ||||
| #include "columnimp.hpp" | ||||
|  | @ -153,6 +154,12 @@ CSMWorld::Data::Data() : mRefs (mCells) | |||
|     mRefs.addColumn (new RecordStateColumn<CellRef>); | ||||
|     mRefs.addColumn (new CellColumn<CellRef>); | ||||
|     mRefs.addColumn (new IdColumn<CellRef>); | ||||
|     mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 0, false)); | ||||
|     mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 1, false)); | ||||
|     mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 2, false)); | ||||
|     mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mPos, 0, false)); | ||||
|     mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mPos, 1, false)); | ||||
|     mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mPos, 2, false)); | ||||
|     mRefs.addColumn (new ScaleColumn<CellRef>); | ||||
|     mRefs.addColumn (new OwnerColumn<CellRef>); | ||||
|     mRefs.addColumn (new SoulColumn<CellRef>); | ||||
|  | @ -163,6 +170,12 @@ CSMWorld::Data::Data() : mRefs (mCells) | |||
|     mRefs.addColumn (new GoldValueColumn<CellRef>); | ||||
|     mRefs.addColumn (new TeleportColumn<CellRef>); | ||||
|     mRefs.addColumn (new TeleportCellColumn<CellRef>); | ||||
|     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, 2, true)); | ||||
|     mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mDoorDest, 0, true)); | ||||
|     mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mDoorDest, 1, true)); | ||||
|     mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mDoorDest, 2, true)); | ||||
|     mRefs.addColumn (new LockLevelColumn<CellRef>); | ||||
|     mRefs.addColumn (new KeyColumn<CellRef>); | ||||
|     mRefs.addColumn (new TrapColumn<CellRef>); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue