store character profile information in saved game file

actorid
Marc Zinnschlag 11 years ago
parent e938c5a0ee
commit fc1501a510

@ -9,6 +9,11 @@
#include "../mwbase/dialoguemanager.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)
: mQuitRequest (false), mState (State_NoGame), mCharacterManager (saves)
{
@ -59,7 +64,20 @@ void MWState::StateManager::saveGame (const Slot *slot)
{
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)
slot = mCharacterManager.getCurrentCharacter()->createSlot (profile);

@ -26,7 +26,7 @@ namespace ESM
std::vector<std::string> mContentFiles;
std::string mPlayerName;
int mPlayerLevel;
std::string mPlayerClass;
std::string mPlayerClass; // this is the ID and not the name of the class
std::string mPlayerCell;
TimeStamp mInGameTime;
double mTimePlayed;

Loading…
Cancel
Save