From: Holger Schemel Date: Wed, 13 Oct 2021 09:51:02 +0000 (+0200) Subject: improved asking for and uploading tapes to score server X-Git-Tag: 4.3.0.0~18 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=1cf0e16ba9bfee0897a02d4a7d9d2eccfb8f04b3 improved asking for and uploading tapes to score server --- diff --git a/src/init.c b/src/init.c index 7802e8e9..8c0f26e3 100644 --- a/src/init.c +++ b/src/init.c @@ -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()); diff --git a/src/screens.c b/src/screens.c index 47777fa2..79ed0aa7 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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(); }