From: Holger Schemel Date: Sun, 31 Oct 2021 00:17:08 +0000 (+0200) Subject: added asking before uploading scores and tapes for the first time X-Git-Tag: 4.3.0.0~2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ef596d6fab46df4658603046b589b3e21bda9bca;p=rocksndiamonds.git added asking before uploading scores and tapes for the first time --- diff --git a/src/files.c b/src/files.c index 4c5a3661..28a19e67 100644 --- a/src/files.c +++ b/src/files.c @@ -10069,6 +10069,10 @@ static struct TokenInfo server_setup_tokens[] = TYPE_SWITCH, &setup.provide_uploading_tapes, TEST_PREFIX "provide_uploading_tapes" }, + { + TYPE_SWITCH, + &setup.ask_for_using_api_server,TEST_PREFIX "ask_for_using_api_server" + }, }; static struct TokenInfo editor_setup_tokens[] = @@ -10871,6 +10875,7 @@ static void setSetupInfoToDefaults_ServerSetup(struct SetupInfo *si) si->api_server_password = getStringCopy(UNDEFINED_PASSWORD); si->ask_for_uploading_tapes = TRUE; si->provide_uploading_tapes = TRUE; + si->ask_for_using_api_server = TRUE; } static void setSetupInfoToDefaults_EditorCascade(struct SetupInfo *si) diff --git a/src/game.c b/src/game.c index 3cdb836d..d4cc5ea8 100644 --- a/src/game.c +++ b/src/game.c @@ -5146,6 +5146,24 @@ void NewHighScore(int level_nr, boolean tape_saved) return; SaveScoreTape(level_nr); + + if (setup.ask_for_using_api_server) + { + setup.use_api_server = + Request("Upload your score and tape to the high score server?", REQ_ASK); + + if (!setup.use_api_server) + Request("Not using high score server! Use setup menu to enable again!", + REQ_CONFIRM); + + runtime.use_api_server = setup.use_api_server; + + // after asking for using API server once, do not ask again + setup.ask_for_using_api_server = FALSE; + + SaveSetup_ServerSetup(); + } + SaveServerScore(level_nr, tape_saved); } diff --git a/src/libgame/system.h b/src/libgame/system.h index 11c88762..d9b42321 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1515,6 +1515,7 @@ struct SetupInfo char *api_server_password; boolean ask_for_uploading_tapes; boolean provide_uploading_tapes; + boolean ask_for_using_api_server; struct SetupAutoSetupInfo auto_setup; struct SetupLevelSetupInfo level_setup;