From d6916c35bcde30710fb9391ad6f1d03c5832bf95 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 21 Mar 2025 03:18:22 +0300 Subject: [PATCH] Only print the player name if it doesn't match the profile --- apps/openmw/mwgui/savegamedialog.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index 4ce6abfcd7..967bb23919 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -197,7 +197,8 @@ namespace MWGui title << " (#{OMWEngine:Level} " << signature.mPlayerLevel << " " << MyGUI::TextIterator::toTagsString(MyGUI::UString(className)) << ")"; - mCharacterSelection->addItem(MyGUI::LanguageManager::getInstance().replaceTags(title.str())); + const MyGUI::UString playerDesc = MyGUI::LanguageManager::getInstance().replaceTags(title.str()); + mCharacterSelection->addItem(playerDesc, signature.mPlayerName); if (mCurrentCharacter == &*it || (!mCurrentCharacter && !mSaving @@ -413,9 +414,11 @@ namespace MWGui std::stringstream text; - const std::string& playerName = mCurrentSlot->mProfile.mPlayerName; - if (!playerName.empty()) - text << playerName << "\n"; + const size_t profileIndex = mCharacterSelection->getIndexSelected(); + const std::string& slotPlayerName = mCurrentSlot->mProfile.mPlayerName; + const std::string& profilePlayerName = *mCharacterSelection->getItemDataAt(profileIndex); + if (slotPlayerName != profilePlayerName) + text << slotPlayerName << "\n"; text << "#{OMWEngine:Level} " << mCurrentSlot->mProfile.mPlayerLevel << "\n";