mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-11-04 08:56:48 +00:00 
			
		
		
		
	The progress is not particularly accurate. It simply uses the current / total number of records written/read as indication. Cell records are currently the largest by far, but there is a good chance that could be optimized using a change tracking system.
		
			
				
	
	
		
			67 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
#ifndef GAME_SCRIPT_GLOBALSCRIPTS_H
 | 
						|
#define GAME_SCRIPT_GLOBALSCRIPTS_H
 | 
						|
 | 
						|
#include <string>
 | 
						|
#include <map>
 | 
						|
 | 
						|
#include <stdint.h>
 | 
						|
 | 
						|
#include "locals.hpp"
 | 
						|
 | 
						|
namespace ESM
 | 
						|
{
 | 
						|
    class ESMWriter;
 | 
						|
    class ESMReader;
 | 
						|
}
 | 
						|
 | 
						|
namespace Loading
 | 
						|
{
 | 
						|
    class Listener;
 | 
						|
}
 | 
						|
 | 
						|
namespace MWWorld
 | 
						|
{
 | 
						|
    struct ESMStore;
 | 
						|
}
 | 
						|
 | 
						|
namespace MWScript
 | 
						|
{
 | 
						|
    class GlobalScripts
 | 
						|
    {
 | 
						|
            const MWWorld::ESMStore& mStore;
 | 
						|
            std::map<std::string, std::pair<bool, Locals> > mScripts; // running, local variables
 | 
						|
 | 
						|
        public:
 | 
						|
 | 
						|
            GlobalScripts (const MWWorld::ESMStore& store);
 | 
						|
 | 
						|
            void addScript (const std::string& name);
 | 
						|
 | 
						|
            void removeScript (const std::string& name);
 | 
						|
 | 
						|
            bool isRunning (const std::string& name) const;
 | 
						|
 | 
						|
            void run();
 | 
						|
            ///< run all active global scripts
 | 
						|
 | 
						|
            void clear();
 | 
						|
 | 
						|
            void addStartup();
 | 
						|
            ///< Add startup script
 | 
						|
 | 
						|
            int countSavedGameRecords() const;
 | 
						|
 | 
						|
            void write (ESM::ESMWriter& writer, Loading::Listener& progress) const;
 | 
						|
 | 
						|
            bool readRecord (ESM::ESMReader& reader, int32_t type);
 | 
						|
            ///< Records for variables that do not exist are dropped silently.
 | 
						|
            ///
 | 
						|
            /// \return Known type?
 | 
						|
 | 
						|
            Locals& getLocals (const std::string& name);
 | 
						|
            ///< If the script \a name has not been added as a global script yet, it is added
 | 
						|
            /// automatically, but is not set to running state.
 | 
						|
    };
 | 
						|
}
 | 
						|
 | 
						|
#endif
 |