mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 06:26:39 +00:00 
			
		
		
		
	Sample use case: users are using the Morrowind Code Patch feature that allows modders to enable this flag to differentiate editor-made potions from player crafted potions for tooltips.
		
			
				
	
	
		
			35 lines
		
	
	
	
		
			868 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
	
		
			868 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#include "loadgmst.hpp"
 | 
						|
 | 
						|
#include "esmreader.hpp"
 | 
						|
#include "esmwriter.hpp"
 | 
						|
#include "defs.hpp"
 | 
						|
 | 
						|
namespace ESM
 | 
						|
{
 | 
						|
    unsigned int GameSetting::sRecordId = REC_GMST;
 | 
						|
 | 
						|
    void GameSetting::load (ESMReader &esm, bool &isDeleted)
 | 
						|
    {
 | 
						|
        isDeleted = false; // GameSetting record can't be deleted now (may be changed in the future)
 | 
						|
        mRecordFlags = esm.getRecordFlags();
 | 
						|
 | 
						|
        mId = esm.getHNString("NAME");
 | 
						|
        mValue.read (esm, ESM::Variant::Format_Gmst);
 | 
						|
    }
 | 
						|
 | 
						|
    void GameSetting::save (ESMWriter &esm, bool /*isDeleted*/) const
 | 
						|
    {
 | 
						|
        esm.writeHNCString("NAME", mId);
 | 
						|
        mValue.write (esm, ESM::Variant::Format_Gmst);
 | 
						|
    }
 | 
						|
 | 
						|
    void GameSetting::blank()
 | 
						|
    {
 | 
						|
        mValue.setType (ESM::VT_None);
 | 
						|
    }
 | 
						|
 | 
						|
    bool operator== (const GameSetting& left, const GameSetting& right)
 | 
						|
    {
 | 
						|
        return left.mValue==right.mValue;
 | 
						|
    }
 | 
						|
}
 |