2015-01-17 00:11:36 +01:00
|
|
|
#ifndef OPENMW_ESSIMPORT_CONTEXT_H
|
|
|
|
#define OPENMW_ESSIMPORT_CONTEXT_H
|
|
|
|
|
2015-01-18 16:13:52 +01:00
|
|
|
#include <map>
|
|
|
|
|
2022-01-22 15:58:41 +01:00
|
|
|
#include <components/esm3/controlsstate.hpp>
|
|
|
|
#include <components/esm3/dialoguestate.hpp>
|
|
|
|
#include <components/esm3/globalmap.hpp>
|
2023-02-22 15:57:59 +01:00
|
|
|
#include <components/esm3/loadcell.hpp>
|
2022-01-22 15:58:41 +01:00
|
|
|
#include <components/esm3/loadcrea.hpp>
|
|
|
|
#include <components/esm3/loadnpc.hpp>
|
|
|
|
#include <components/esm3/player.hpp>
|
2015-01-17 00:11:36 +01:00
|
|
|
|
2015-01-19 13:16:12 +01:00
|
|
|
#include "importcntc.hpp"
|
2015-01-18 16:13:52 +01:00
|
|
|
#include "importcrec.hpp"
|
2015-01-17 00:11:36 +01:00
|
|
|
#include "importnpcc.hpp"
|
2017-09-20 18:56:32 +02:00
|
|
|
#include "importsplm.h"
|
2015-01-18 16:13:52 +01:00
|
|
|
|
2015-01-17 00:11:36 +01:00
|
|
|
namespace ESSImport
|
|
|
|
{
|
|
|
|
|
|
|
|
struct Context
|
|
|
|
{
|
2015-01-18 19:59:29 +01:00
|
|
|
// set from the TES3 header
|
|
|
|
std::string mPlayerCellName;
|
|
|
|
|
2015-01-17 00:11:36 +01:00
|
|
|
ESM::Player mPlayer;
|
|
|
|
ESM::NPC mPlayerBase;
|
|
|
|
std::string mCustomPlayerClassName;
|
|
|
|
|
2015-01-20 01:28:34 +01:00
|
|
|
ESM::DialogueState mDialogueState;
|
|
|
|
|
2016-10-20 02:14:36 +02:00
|
|
|
ESM::ControlsState mControlsState;
|
|
|
|
|
2015-01-29 02:20:14 +01:00
|
|
|
// cells which should show an explored overlay on the global map
|
|
|
|
std::set<std::pair<int, int>> mExploredCells;
|
|
|
|
|
2015-01-23 00:15:57 +01:00
|
|
|
ESM::GlobalMap mGlobalMapState;
|
|
|
|
|
2015-01-17 00:11:36 +01:00
|
|
|
int mDay, mMonth, mYear;
|
|
|
|
float mHour;
|
|
|
|
|
2015-01-18 16:13:52 +01:00
|
|
|
// key <refIndex, refId>
|
2022-10-06 19:39:46 +02:00
|
|
|
std::map<std::pair<int, ESM::RefId>, CREC> mCreatureChanges;
|
|
|
|
std::map<std::pair<int, ESM::RefId>, NPCC> mNpcChanges;
|
|
|
|
std::map<std::pair<int, ESM::RefId>, CNTC> mContainerChanges;
|
2015-01-18 16:13:52 +01:00
|
|
|
|
2022-10-06 19:39:46 +02:00
|
|
|
std::map<std::pair<int, ESM::RefId>, int> mActorIdMap;
|
2017-09-12 21:11:30 +02:00
|
|
|
int mNextActorId;
|
|
|
|
|
2022-10-06 19:39:46 +02:00
|
|
|
std::map<ESM::RefId, ESM::Creature> mCreatures;
|
|
|
|
std::map<ESM::RefId, ESM::NPC> mNpcs;
|
2015-01-30 22:07:21 +01:00
|
|
|
|
2017-09-20 18:56:32 +02:00
|
|
|
std::vector<SPLM::ActiveSpell> mActiveSpells;
|
|
|
|
|
2015-01-17 00:11:36 +01:00
|
|
|
Context()
|
2015-07-11 03:33:31 +02:00
|
|
|
: mDay(0)
|
|
|
|
, mMonth(0)
|
|
|
|
, mYear(0)
|
|
|
|
, mHour(0.f)
|
2017-09-12 21:11:30 +02:00
|
|
|
, mNextActorId(0)
|
2015-01-17 00:11:36 +01:00
|
|
|
{
|
2023-04-01 11:31:05 +02:00
|
|
|
mPlayer.mCellId = ESM::RefId::esm3ExteriorCell(0, 0);
|
2016-12-24 18:30:39 +01:00
|
|
|
mPlayer.mLastKnownExteriorPosition[0] = mPlayer.mLastKnownExteriorPosition[1]
|
|
|
|
= mPlayer.mLastKnownExteriorPosition[2] = 0.0f;
|
2016-12-18 04:37:59 +01:00
|
|
|
mPlayer.mHasMark = 0;
|
2017-09-15 00:21:02 +02:00
|
|
|
mPlayer.mCurrentCrimeId = -1; // TODO
|
|
|
|
mPlayer.mPaidCrimeId = -1;
|
2015-01-18 19:59:29 +01:00
|
|
|
mPlayer.mObject.blank();
|
2017-01-21 03:39:51 +01:00
|
|
|
mPlayer.mObject.mEnabled = true;
|
2022-10-06 19:39:46 +02:00
|
|
|
mPlayer.mObject.mRef.mRefID = ESM::RefId::stringRefId("player"); // REFR.mRefID would be PlayerSaveGame
|
2017-09-12 21:11:30 +02:00
|
|
|
mPlayer.mObject.mCreatureStats.mActorId = generateActorId();
|
2015-01-23 00:15:57 +01:00
|
|
|
|
|
|
|
mGlobalMapState.mBounds.mMinX = 0;
|
|
|
|
mGlobalMapState.mBounds.mMaxX = 0;
|
|
|
|
mGlobalMapState.mBounds.mMinY = 0;
|
|
|
|
mGlobalMapState.mBounds.mMaxY = 0;
|
2019-02-17 11:56:24 +04:00
|
|
|
|
|
|
|
mPlayerBase.blank();
|
2015-01-17 00:11:36 +01:00
|
|
|
}
|
2017-09-12 21:11:30 +02:00
|
|
|
|
|
|
|
int generateActorId() { return mNextActorId++; }
|
2015-01-17 00:11:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|