diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index 8f22408fe..0f4e1e020 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -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()->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); diff --git a/components/esm/savedgame.hpp b/components/esm/savedgame.hpp index c0e6f1aeb..e712e8f1f 100644 --- a/components/esm/savedgame.hpp +++ b/components/esm/savedgame.hpp @@ -26,7 +26,7 @@ namespace ESM std::vector 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;