From c8fbe43dc0fbadf8c00ed4d92d27f6dad9474a1e Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Sat, 10 Aug 2024 21:13:21 -0700 Subject: [PATCH] Fix load/save menus not starting scrolled to the selected entry Fixes https://github.com/ZDoom/gzdoom/issues/2645 --- wadsrc/static/zscript/engine/ui/menu/loadsavemenu.zs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/zscript/engine/ui/menu/loadsavemenu.zs b/wadsrc/static/zscript/engine/ui/menu/loadsavemenu.zs index e15ca266f4e..82b5ea4bf78 100644 --- a/wadsrc/static/zscript/engine/ui/menu/loadsavemenu.zs +++ b/wadsrc/static/zscript/engine/ui/menu/loadsavemenu.zs @@ -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(); }