Fix load/save menus not starting scrolled to the selected entry

Fixes https://github.com/ZDoom/gzdoom/issues/2645
This commit is contained in:
Chris Cowan 2024-08-10 21:13:21 -07:00 committed by Rachael Alexanderson
parent faead1c733
commit c8fbe43dc0

View file

@ -483,8 +483,8 @@ class SaveMenu : LoadSaveMenu
{
Super.Init(parent, desc);
manager.InsertNewSaveNode();
TopItem = 0;
Selected = manager.ExtractSaveData (-1);
TopItem = MAX(0, Selected - listboxRows + 1);
UpdateSaveComment();
}
@ -623,8 +623,8 @@ class LoadMenu : LoadSaveMenu
override void Init(Menu parent, ListMenuDescriptor desc)
{
Super.Init(parent, desc);
TopItem = 0;
Selected = manager.ExtractSaveData (-1);
TopItem = MAX(0, Selected - listboxRows + 1);
UpdateSaveComment();
}