forked from mirror/openmw-tes3mp
savegamedialog: don't reset the character selection scrollbar when a character is deleted
This commit is contained in:
parent
8f5347b79b
commit
30d5c7488d
1 changed files with 4 additions and 2 deletions
|
@ -91,15 +91,17 @@ namespace MWGui
|
||||||
|
|
||||||
if (mSaveList->getItemCount() == 0)
|
if (mSaveList->getItemCount() == 0)
|
||||||
{
|
{
|
||||||
// The character might be deleted now
|
|
||||||
size_t previousIndex = mCharacterSelection->getIndexSelected();
|
size_t previousIndex = mCharacterSelection->getIndexSelected();
|
||||||
open();
|
mCurrentCharacter = NULL;
|
||||||
|
mCharacterSelection->removeItemAt(previousIndex);
|
||||||
if (mCharacterSelection->getItemCount())
|
if (mCharacterSelection->getItemCount())
|
||||||
{
|
{
|
||||||
size_t nextCharacter = std::min(previousIndex, mCharacterSelection->getItemCount()-1);
|
size_t nextCharacter = std::min(previousIndex, mCharacterSelection->getItemCount()-1);
|
||||||
mCharacterSelection->setIndexSelected(nextCharacter);
|
mCharacterSelection->setIndexSelected(nextCharacter);
|
||||||
onCharacterSelected(mCharacterSelection, nextCharacter);
|
onCharacterSelected(mCharacterSelection, nextCharacter);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
fillSaveList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue