@@ -59,13 +59,14 @@ SaveLoadMenuGUI::SaveLoadMenuGUI(AllegroScreen* guiScreen, GUIInputWrapper* guiI
5959 m_SaveGamesListBox->SetMouseScrolling (true );
6060 m_SaveGamesListBox->SetScrollBarThickness (15 );
6161 m_SaveGamesListBox->SetScrollBarPadding (2 );
62+ m_SaveGamesListBox->SetHighlightAsIfAlwaysFocused (true );
6263
6364 m_SaveGameName = dynamic_cast <GUITextBox*>(m_GUIControlManager->GetControl (" SaveGameName" ));
6465 m_LoadButton = dynamic_cast <GUIButton*>(m_GUIControlManager->GetControl (" ButtonLoad" ));
6566 m_CreateButton = dynamic_cast <GUIButton*>(m_GUIControlManager->GetControl (" ButtonCreate" ));
6667 m_OverwriteButton = dynamic_cast <GUIButton*>(m_GUIControlManager->GetControl (" ButtonOverwrite" ));
6768 m_DeleteButton = dynamic_cast <GUIButton*>(m_GUIControlManager->GetControl (" ButtonDelete" ));
68- m_ActivityCannotBeSavedLabel = dynamic_cast <GUILabel*>(m_GUIControlManager->GetControl (" ActivityCannotBeSavedWarning " ));
69+ m_DescriptionLabel = dynamic_cast <GUILabel*>(m_GUIControlManager->GetControl (" DescriptionLabel " ));
6970
7071 m_ConfirmationBox = dynamic_cast <GUICollectionBox*>(m_GUIControlManager->GetControl (" ConfirmDialog" ));
7172 m_ConfirmationBox->CenterInParent (true , true );
@@ -75,6 +76,8 @@ SaveLoadMenuGUI::SaveLoadMenuGUI(AllegroScreen* guiScreen, GUIInputWrapper* guiI
7576 m_CancelButton = dynamic_cast <GUIButton*>(m_GUIControlManager->GetControl (" CancelButton" ));
7677
7778 m_SaveGamesFetched = false ;
79+ m_WasSaving = false ;
80+ m_SavingBlinkTimer.SetRealTimeLimitS (1 .5f );
7881
7982 SwitchToConfirmDialogMode (ConfirmDialogMode::None);
8083}
@@ -85,7 +88,6 @@ void SaveLoadMenuGUI::PopulateSaveGamesList() {
8588 }
8689
8790 m_SaveGames.clear ();
88- m_SaveGameName->SetText (" " );
8991
9092 m_GUIControlManager->GetManager ()->SetFocus (nullptr );
9193
@@ -253,8 +255,41 @@ void SaveLoadMenuGUI::UpdateButtonEnabledStates() {
253255
254256 m_LoadButton->SetEnabled (saveExists);
255257 m_DeleteButton->SetEnabled (saveExists);
258+
259+ m_DescriptionLabel->SetText (" " );
260+
261+ bool isSaving = g_ActivityMan.IsCurrentlySaving ();
262+ if (isSaving != m_WasSaving) {
263+ m_SavingBlinkTimer.Reset ();
264+ }
265+
266+ if (g_ActivityMan.GetActivity ()) {
267+ if (isSaving) {
268+ const char * saveText = " " ;
269+ switch (m_SavingBlinkTimer.StepReal (500 , 3 )) {
270+ case 0 :
271+ saveText = " Saving game, please wait. " ;
272+ break ;
273+ case 1 :
274+ saveText = " Saving game, please wait.. " ;
275+ break ;
276+ case 2 :
277+ saveText = " Saving game, please wait..." ;
278+ break ;
279+ }
280+
281+ m_DescriptionLabel->SetText (saveText);
282+ } else if (!m_SavingBlinkTimer.IsPastRealTimeLimit ()) {
283+ // Show "Saved!" for a little while after saving
284+ m_DescriptionLabel->SetText (" Game saved successfully!" );
285+ } else if (!g_ActivityMan.GetActivity ()->GetAllowsUserSaving ()) {
286+ m_DescriptionLabel->SetText (" The currently played activity does not allow saving." );
287+ } else if (m_SaveGameName->GetText ().empty ()) {
288+ m_DescriptionLabel->SetText (" Enter a name for your savegame." );
289+ }
290+ }
256291
257- m_ActivityCannotBeSavedLabel-> SetVisible (g_ActivityMan. GetActivity () && !g_ActivityMan. GetActivity ()-> GetAllowsUserSaving ()) ;
292+ m_WasSaving = isSaving ;
258293}
259294
260295void SaveLoadMenuGUI::SwitchToConfirmDialogMode (ConfirmDialogMode mode) {
0 commit comments