diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index 94f25e118b..4ce6abfcd7 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -43,6 +43,7 @@ namespace MWGui { getWidget(mScreenshot, "Screenshot"); getWidget(mCharacterSelection, "SelectCharacter"); + getWidget(mCellName, "CellName"); getWidget(mInfoText, "InfoText"); getWidget(mOkButton, "OkButton"); getWidget(mCancelButton, "CancelButton"); @@ -390,6 +391,7 @@ namespace MWGui if (pos == MyGUI::ITEM_NONE || !mCurrentCharacter) { mCurrentSlot = nullptr; + mCellName->setCaption({}); mInfoText->setCaption({}); mScreenshot->setImageTexture({}); return; @@ -411,15 +413,19 @@ namespace MWGui std::stringstream text; - text << Misc::fileTimeToString(mCurrentSlot->mTimeStamp, "%Y.%m.%d %T") << "\n"; + const std::string& playerName = mCurrentSlot->mProfile.mPlayerName; + if (!playerName.empty()) + text << playerName << "\n"; + + text << "#{OMWEngine:Level} " << mCurrentSlot->mProfile.mPlayerLevel << "\n"; + + if (mCurrentSlot->mProfile.mCurrentDay > 0) + text << "#{Calendar:day} " << mCurrentSlot->mProfile.mCurrentDay << "\n"; if (mCurrentSlot->mProfile.mMaximumHealth > 0) text << "#{OMWEngine:Health} " << static_cast(mCurrentSlot->mProfile.mCurrentHealth) << "/" << static_cast(mCurrentSlot->mProfile.mMaximumHealth) << "\n"; - text << "#{OMWEngine:Level} " << mCurrentSlot->mProfile.mPlayerLevel << "\n"; - text << "#{sCell=" << mCurrentSlot->mProfile.mPlayerCellName << "}\n"; - int hour = int(mCurrentSlot->mProfile.mInGameTime.mGameHour); bool pm = hour >= 12; if (hour >= 13) @@ -427,20 +433,19 @@ namespace MWGui if (hour == 0) hour = 12; - if (mCurrentSlot->mProfile.mCurrentDay > 0) - text << "#{Calendar:day} " << mCurrentSlot->mProfile.mCurrentDay << "\n"; - text << mCurrentSlot->mProfile.mInGameTime.mDay << " " << MWBase::Environment::get().getWorld()->getTimeManager()->getMonthName( mCurrentSlot->mProfile.mInGameTime.mMonth) - << " " << hour << " " << (pm ? "#{Calendar:pm}" : "#{Calendar:am}"); + << " " << hour << " " << (pm ? "#{Calendar:pm}" : "#{Calendar:am}") << "\n"; if (mCurrentSlot->mProfile.mTimePlayed > 0) { - text << "\n" - << "#{OMWEngine:TimePlayed}: " << formatTimeplayed(mCurrentSlot->mProfile.mTimePlayed); + text << "#{OMWEngine:TimePlayed}: " << formatTimeplayed(mCurrentSlot->mProfile.mTimePlayed) << "\n"; } + text << Misc::fileTimeToString(mCurrentSlot->mTimeStamp, "%Y.%m.%d %T") << "\n"; + + mCellName->setCaptionWithReplacing("#{sCell=" + mCurrentSlot->mProfile.mPlayerCellName + "}"); mInfoText->setCaptionWithReplacing(text.str()); // Reset the image for the case we're unable to recover a screenshot diff --git a/apps/openmw/mwgui/savegamedialog.hpp b/apps/openmw/mwgui/savegamedialog.hpp index 35e65fbed0..af831f066e 100644 --- a/apps/openmw/mwgui/savegamedialog.hpp +++ b/apps/openmw/mwgui/savegamedialog.hpp @@ -57,6 +57,7 @@ namespace MWGui bool mSaving; MyGUI::ComboBox* mCharacterSelection; + MyGUI::EditBox* mCellName; MyGUI::EditBox* mInfoText; MyGUI::Button* mOkButton; MyGUI::Button* mCancelButton; diff --git a/files/data/mygui/openmw_savegame_dialog.layout b/files/data/mygui/openmw_savegame_dialog.layout index 1e40b5dd34..8bb6a64401 100644 --- a/files/data/mygui/openmw_savegame_dialog.layout +++ b/files/data/mygui/openmw_savegame_dialog.layout @@ -37,14 +37,20 @@ + + + + + + + + - -