improved asking for and uploading tapes to score server
authorHolger Schemel <info@artsoft.org>
Wed, 13 Oct 2021 09:51:02 +0000 (11:51 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 13 Oct 2021 09:51:02 +0000 (11:51 +0200)
src/init.c
src/screens.c

index 7802e8e9a7da848e6abd41291bbbe3c0b61d66b2..8c0f26e3ede53fd49e6feccfa6ed995f635d7e54 100644 (file)
@@ -6332,9 +6332,6 @@ void OpenAll(void)
 
   DrawMainMenu();
 
-  // needed once to offer uploading score tapes after starting the program
-  CheckUploadTapes();
-
 #if 0
   Debug("internal:path", "SDL_GetBasePath() == '%s'",
        SDL_GetBasePath());
index 47777fa23d825d853309e856707f24e64023208a..79ed0aa7051ee186d7611ac7d95150b8f64bd8dc 100644 (file)
@@ -1743,6 +1743,9 @@ void DrawMainMenu(void)
   OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2);
 
   SyncEmscriptenFilesystem();
+
+  // needed once to upload tapes (after program start or after user change)
+  CheckUploadTapes();
 }
 
 static void gotoTopLevelDir(void)
@@ -5116,9 +5119,6 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
          SetGameStatus(GAME_MODE_MAIN);
 
          DrawMainMenu();
-
-         // needed once to offer uploading score tapes after changing user
-         CheckUploadTapes();
        }
       }
     }
@@ -10019,6 +10019,9 @@ void CheckUploadTapes(void)
   if (!setup.ask_for_uploading_tapes)
     return;
 
+  // after asking for uploading all tapes once, do not ask again
+  setup.ask_for_uploading_tapes = FALSE;
+
   if (directoryExists(getTapeDir(NULL)))
   {
     boolean tapes_uploaded = OfferUploadTapes();
@@ -10033,8 +10036,5 @@ void CheckUploadTapes(void)
     setup.provide_uploading_tapes = FALSE;
   }
 
-  // after asking for uploading all tapes once, do not ask again
-  setup.ask_for_uploading_tapes = FALSE;
-
   SaveSetup();
 }