2020-12-18 22:21:10 +00:00
|
|
|
#ifndef GAME_MWBASE_LUAMANAGER_H
|
|
|
|
#define GAME_MWBASE_LUAMANAGER_H
|
|
|
|
|
|
|
|
#include <SDL_events.h>
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
}
|
|
|
|
|
2021-01-29 01:38:09 +00:00
|
|
|
namespace Loading
|
|
|
|
{
|
|
|
|
class Listener;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
class LuaScripts;
|
|
|
|
}
|
|
|
|
|
2020-12-18 22:21:10 +00:00
|
|
|
namespace MWBase
|
|
|
|
{
|
|
|
|
|
|
|
|
class LuaManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~LuaManager() = default;
|
|
|
|
|
|
|
|
virtual void newGameStarted() = 0;
|
|
|
|
virtual void objectAddedToScene(const MWWorld::Ptr& ptr) = 0;
|
|
|
|
virtual void objectRemovedFromScene(const MWWorld::Ptr& ptr) = 0;
|
|
|
|
virtual void keyPressed(const SDL_KeyboardEvent &arg) = 0;
|
|
|
|
|
|
|
|
struct ActorControls {
|
|
|
|
bool controlledFromLua;
|
|
|
|
|
|
|
|
bool jump;
|
|
|
|
bool run;
|
|
|
|
float movement;
|
|
|
|
float sideMovement;
|
|
|
|
float turn;
|
|
|
|
};
|
|
|
|
|
|
|
|
virtual const ActorControls* getActorControls(const MWWorld::Ptr&) const = 0;
|
|
|
|
|
|
|
|
virtual void clear() = 0;
|
|
|
|
virtual void setupPlayer(const MWWorld::Ptr&) = 0;
|
2021-01-29 01:38:09 +00:00
|
|
|
|
|
|
|
// Saving
|
|
|
|
int countSavedGameRecords() const { return 1; };
|
|
|
|
virtual void write(ESM::ESMWriter& writer, Loading::Listener& progress) = 0;
|
|
|
|
virtual void saveLocalScripts(const MWWorld::Ptr& ptr, ESM::LuaScripts& data) = 0;
|
|
|
|
|
|
|
|
// Loading from a save
|
|
|
|
virtual void readRecord(ESM::ESMReader& reader, uint32_t type) = 0;
|
|
|
|
virtual void loadLocalScripts(const MWWorld::Ptr& ptr, const ESM::LuaScripts& data) = 0;
|
|
|
|
|
|
|
|
// Should be called before loading. The map is used to fix refnums if the order of content files was changed.
|
|
|
|
virtual void setContentFileMapping(const std::map<int, int>&) = 0;
|
2020-12-18 22:21:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // GAME_MWBASE_LUAMANAGER_H
|