- SW: fixed issue with autoselecting single episode entries with non-empty subtitles.

This case needs different offsets.
This commit is contained in:
Christoph Oelckers 2021-01-27 23:53:26 +01:00
parent 3163e4a799
commit 26c5d5aa32

View file

@ -370,6 +370,7 @@ static void BuildEpisodeMenu()
{
// Build episode menu
int addedVolumes = 0;
bool textadded = false;
DMenuDescriptor** desc = MenuDescriptors.CheckKey(NAME_Episodemenu);
if (desc != nullptr && (*desc)->IsKindOf(RUNTIME_CLASS(DListMenuDescriptor)))
{
@ -402,6 +403,7 @@ static void BuildEpisodeMenu()
gVolumeSubtitles[i], SmallFont, CR_GRAY, false, NAME_None, i);
y += ld->mLinespacing * 6 / 10;
ld->mItems.Push(it);
textadded = true;
}
}
}
@ -419,7 +421,7 @@ static void BuildEpisodeMenu()
#endif
if (addedVolumes == 1)
{
ld->mAutoselect = ld->mItems.Size()-1;
ld->mAutoselect = ld->mItems.Size() - (textadded ? 2 : 1);
}
if (popped) ld->mItems.Push(popped);
}