@@ -38,6 +38,7 @@ void SaveMenu::MenuButtonOnClick(Widgets::Button* target) {
3838 SaveSystem::GetSaveFlags (EntryType, ScrWork[SW_SAVEFILENO]) &
3939 SaveSystem::SaveFlagsMode::WriteProtect);
4040 ChoiceMade = true ;
41+ LockInputs = *ActiveMenuType == +SaveMenuPageType::Save;
4142 }
4243}
4344
@@ -69,8 +70,8 @@ SaveMenu::SaveMenu() : UI::SaveMenu() {
6970 // Quick Save Pages initialization
7071
7172 for (int i = 0 ; i < Pages; i++) {
72- MainItems = new Widgets::Group (this );
73- MainItems ->WrapFocus = false ;
73+ Widgets::Group* mainItems = new Widgets::Group (this );
74+ mainItems ->WrapFocus = false ;
7475
7576 for (int j = 0 ; j < EntriesPerPage; j++) {
7677 SaveEntryButton* saveEntryButton =
@@ -79,7 +80,7 @@ SaveMenu::SaveMenu() : UI::SaveMenu() {
7980 EntryPositions[j], i, false , LockedSymbolSprite);
8081 saveEntryButton->OnClickHandler = onClick;
8182 saveEntryButton->AddThumbnail (EmptyThumbnailSprite, ThumbnailRelativePos);
82- MainItems ->Add (saveEntryButton);
83+ mainItems ->Add (saveEntryButton);
8384 EntryGrid[j] = saveEntryButton;
8485 }
8586
@@ -98,7 +99,7 @@ SaveMenu::SaveMenu() : UI::SaveMenu() {
9899 EntryGrid[5 ]->SetFocus (EntryGrid[4 ], FDIR_UP);
99100 EntryGrid[5 ]->SetFocus (EntryGrid[4 ], FDIR_DOWN);
100101
101- QuickSavePages.push_back (MainItems );
102+ QuickSavePages.push_back (mainItems );
102103 }
103104 // Maintaining focus across pages
104105 for (auto pageItr = QuickSavePages.begin (); pageItr != QuickSavePages.end ();
@@ -129,15 +130,15 @@ SaveMenu::SaveMenu() : UI::SaveMenu() {
129130 // Full Save Pages initialization
130131
131132 for (int i = 0 ; i < Pages; i++) {
132- MainItems = new Widgets::Group (this );
133- MainItems ->WrapFocus = false ;
133+ Widgets::Group* mainItems = new Widgets::Group (this );
134+ mainItems ->WrapFocus = false ;
134135
135136 for (int j = 0 ; j < EntriesPerPage; j++) {
136137 SaveEntryButton* saveEntryButton = new SaveEntryButton (
137138 i * EntriesPerPage + j, SaveEntrySprite, EntryHighlightedSprite,
138139 SaveEntrySprite, EntryPositions[j], i, true , LockedSymbolSprite);
139140 saveEntryButton->OnClickHandler = onClick;
140- MainItems ->Add (saveEntryButton);
141+ mainItems ->Add (saveEntryButton);
141142 EntryGrid[j] = saveEntryButton;
142143 }
143144
@@ -156,7 +157,7 @@ SaveMenu::SaveMenu() : UI::SaveMenu() {
156157 EntryGrid[5 ]->SetFocus (EntryGrid[4 ], FDIR_UP);
157158 EntryGrid[5 ]->SetFocus (EntryGrid[4 ], FDIR_DOWN);
158159
159- FullSavePages.push_back (MainItems );
160+ FullSavePages.push_back (mainItems );
160161 }
161162
162163 // Maintaining focus across pages
@@ -265,6 +266,10 @@ void SaveMenu::Hide() {
265266}
266267
267268void SaveMenu::UpdateInput (float dt) {
269+ if (LockInputs) {
270+ return ;
271+ }
272+
268273 using namespace Vm ::Interface;
269274 Menu::UpdateInput (dt);
270275 const auto updatePage = [&](int nextPage) {
@@ -336,7 +341,9 @@ void SaveMenu::Update(float dt) {
336341 TitleFade.Update (dt);
337342 UpdateTitles ();
338343 if (IsFocused) {
339- SavePages->at (*CurrentPage)->Update (dt);
344+ if (!LockInputs) {
345+ SavePages->at (*CurrentPage)->Update (dt);
346+ }
340347 SaveEntryButton::UpdateFocusedAlphaFade (dt);
341348 auto currentlyFocusedButton =
342349 static_cast <SaveEntryButton*>(CurrentlyFocusedElement);
@@ -541,9 +548,11 @@ void SaveMenu::UpdateTitles() {
541548}
542549
543550void SaveMenu::RefreshCurrentEntryInfo () {
544- if (!CurrentlyFocusedElement) return ;
545- static_cast <SaveEntryButton*>(CurrentlyFocusedElement)
546- ->RefreshInfo (EntryType);
551+ if (CurrentlyFocusedElement) {
552+ static_cast <SaveEntryButton*>(CurrentlyFocusedElement)
553+ ->RefreshInfo (EntryType);
554+ }
555+ LockInputs = false ;
547556}
548557
549558} // namespace CHLCC
0 commit comments