From: Holger Schemel Date: Mon, 6 Sep 2021 22:03:19 +0000 (+0200) Subject: added setup file option to toggle setup menu option to upload all tapes X-Git-Tag: 4.3.0.0~66 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=90f8536de7ebd32951dd44b0a2046a088f8a9c5a;p=rocksndiamonds.git added setup file option to toggle setup menu option to upload all tapes --- diff --git a/src/files.c b/src/files.c index 20f51025..e13641b9 100644 --- a/src/files.c +++ b/src/files.c @@ -9772,6 +9772,10 @@ static struct TokenInfo global_setup_tokens[] = TYPE_SWITCH, &setup.ask_for_uploading_tapes, "ask_for_uploading_tapes" }, + { + TYPE_SWITCH, + &setup.provide_uploading_tapes, "provide_uploading_tapes" + }, { TYPE_STRING, &setup.touch.control_type, "touch.control_type" @@ -10412,6 +10416,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->api_server_hostname = getStringCopy(API_SERVER_HOSTNAME); si->api_server_password = getStringCopy(UNDEFINED_PASSWORD); si->ask_for_uploading_tapes = TRUE; + si->provide_uploading_tapes = TRUE; si->touch.control_type = getStringCopy(TOUCH_CONTROL_DEFAULT); si->touch.move_distance = TOUCH_MOVE_DISTANCE_DEFAULT; // percent diff --git a/src/libgame/system.h b/src/libgame/system.h index ed246f0d..b512d1cf 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1501,6 +1501,7 @@ struct SetupInfo char *api_server_hostname; char *api_server_password; boolean ask_for_uploading_tapes; + boolean provide_uploading_tapes; struct SetupAutoSetupInfo auto_setup; struct SetupLevelSetupInfo level_setup; diff --git a/src/screens.c b/src/screens.c index 27d35a30..553b2410 100644 --- a/src/screens.c +++ b/src/screens.c @@ -9879,11 +9879,20 @@ static boolean OfferUploadTapes(void) Request(message, REQ_CONFIRM); + // after all tapes have been uploaded, remove entry from setup menu + setup.provide_uploading_tapes = FALSE; + setHideSetupEntry(execOfferUploadTapes); + + SaveSetup(); + return (num_tapes_uploaded > 0); } void CheckUploadTapes(void) { + if (!setup.provide_uploading_tapes) + setHideSetupEntry(execOfferUploadTapes); + if (!setup.ask_for_uploading_tapes) return; @@ -9895,7 +9904,14 @@ void CheckUploadTapes(void) Request("You can upload your tapes from the setup menu later!", REQ_CONFIRM); } + else + { + // if tapes directory does not exist yet, never offer uploading all tapes + setup.provide_uploading_tapes = FALSE; + setHideSetupEntry(execOfferUploadTapes); + } + // after asking for uploading all tapes once, do not ask again setup.ask_for_uploading_tapes = FALSE; SaveSetup();