mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	added sound file column to sound table
This commit is contained in:
		
							parent
							
								
									dd5940b395
								
							
						
					
					
						commit
						50b58b2ead
					
				
					 2 changed files with 26 additions and 0 deletions
				
			
		|  | @ -566,6 +566,31 @@ namespace CSMWorld | |||
|             return true; | ||||
|         } | ||||
|     }; | ||||
| 
 | ||||
|     template<typename ESXRecordT> | ||||
|     struct SoundFileColumn : public Column<ESXRecordT> | ||||
|     { | ||||
|         SoundFileColumn() : Column<ESXRecordT> ("Sound File", ColumnBase::Display_String) {} | ||||
| 
 | ||||
|         virtual QVariant get (const Record<ESXRecordT>& record) const | ||||
|         { | ||||
|             return QString::fromUtf8 (record.get().mSound.c_str()); | ||||
|         } | ||||
| 
 | ||||
|         virtual void set (Record<ESXRecordT>& record, const QVariant& data) | ||||
|         { | ||||
|             ESXRecordT record2 = record.get(); | ||||
| 
 | ||||
|             record2.mSound = data.toString().toUtf8().constData(); | ||||
| 
 | ||||
|             record.setModified (record2); | ||||
|         } | ||||
| 
 | ||||
|         virtual bool isEditable() const | ||||
|         { | ||||
|             return true; | ||||
|         } | ||||
|     }; | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
|  | @ -82,6 +82,7 @@ CSMWorld::Data::Data() | |||
|     mSounds.addColumn (new SoundParamColumn<ESM::Sound> (SoundParamColumn<ESM::Sound>::Type_Volume)); | ||||
|     mSounds.addColumn (new SoundParamColumn<ESM::Sound> (SoundParamColumn<ESM::Sound>::Type_MinRange)); | ||||
|     mSounds.addColumn (new SoundParamColumn<ESM::Sound> (SoundParamColumn<ESM::Sound>::Type_MaxRange)); | ||||
|     mSounds.addColumn (new SoundFileColumn<ESM::Sound>); | ||||
| 
 | ||||
|     addModel (new IdTable (&mGlobals), UniversalId::Type_Globals, UniversalId::Type_Global); | ||||
|     addModel (new IdTable (&mGmsts), UniversalId::Type_Gmsts, UniversalId::Type_Gmst); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue