mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 09:06:40 +00:00
store character profile information in saved game file
This commit is contained in:
parent
e938c5a0ee
commit
fc1501a510
2 changed files with 20 additions and 2 deletions
|
@ -9,6 +9,11 @@
|
||||||
#include "../mwbase/dialoguemanager.hpp"
|
#include "../mwbase/dialoguemanager.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
|
#include "../mwworld/player.hpp"
|
||||||
|
#include "../mwworld/class.hpp"
|
||||||
|
|
||||||
|
#include "../mwmechanics/npcstats.hpp"
|
||||||
|
|
||||||
MWState::StateManager::StateManager (const boost::filesystem::path& saves)
|
MWState::StateManager::StateManager (const boost::filesystem::path& saves)
|
||||||
: mQuitRequest (false), mState (State_NoGame), mCharacterManager (saves)
|
: mQuitRequest (false), mState (State_NoGame), mCharacterManager (saves)
|
||||||
{
|
{
|
||||||
|
@ -59,7 +64,20 @@ void MWState::StateManager::saveGame (const Slot *slot)
|
||||||
{
|
{
|
||||||
ESM::SavedGame profile;
|
ESM::SavedGame profile;
|
||||||
|
|
||||||
/// \todo configure profile
|
MWBase::World& world = *MWBase::Environment::get().getWorld();
|
||||||
|
|
||||||
|
MWWorld::Ptr player = world.getPlayer().getPlayer();
|
||||||
|
|
||||||
|
/// \todo store content file list
|
||||||
|
profile.mPlayerName = player.getClass().getName (player);
|
||||||
|
profile.mPlayerLevel = player.getClass().getNpcStats (player).getLevel();
|
||||||
|
profile.mPlayerClass = player.get<ESM::NPC>()->mBase->mId;
|
||||||
|
/// \todo player cell
|
||||||
|
/// \todo gamehour
|
||||||
|
profile.mInGameTime.mDay = world.getDay();
|
||||||
|
profile.mInGameTime.mMonth = world.getMonth();
|
||||||
|
/// \todo year
|
||||||
|
/// \todo time played
|
||||||
|
|
||||||
if (!slot)
|
if (!slot)
|
||||||
slot = mCharacterManager.getCurrentCharacter()->createSlot (profile);
|
slot = mCharacterManager.getCurrentCharacter()->createSlot (profile);
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace ESM
|
||||||
std::vector<std::string> mContentFiles;
|
std::vector<std::string> mContentFiles;
|
||||||
std::string mPlayerName;
|
std::string mPlayerName;
|
||||||
int mPlayerLevel;
|
int mPlayerLevel;
|
||||||
std::string mPlayerClass;
|
std::string mPlayerClass; // this is the ID and not the name of the class
|
||||||
std::string mPlayerCell;
|
std::string mPlayerCell;
|
||||||
TimeStamp mInGameTime;
|
TimeStamp mInGameTime;
|
||||||
double mTimePlayed;
|
double mTimePlayed;
|
||||||
|
|
Loading…
Reference in a new issue