+
+void DrawScreenAfterAddingSet(char *tree_subdir_new, int tree_type)
+{
+ // get tree info node of newly added level or artwork set
+ TreeInfo *tree_node_first = TREE_FIRST_NODE(tree_type);
+ TreeInfo *tree_node_new = getTreeInfoFromIdentifier(tree_node_first,
+ tree_subdir_new);
+ if (tree_node_new == NULL) // should not happen
+ return;
+
+ // if request dialog is active, do nothing
+ if (game.request_active)
+ return;
+
+ if (game_status == GAME_MODE_MAIN &&
+ tree_type == TREE_TYPE_LEVEL_DIR)
+ {
+ // when adding new level set in main menu, select it as current level set
+
+ // change current level set to newly added level set from zip file
+ leveldir_current = tree_node_new;
+
+ // change current level number to first level of newly added level set
+ level_nr = leveldir_current->first_level;
+
+ // redraw screen to reflect changed level set
+ DrawMainMenu();
+
+ // save this level set and level number as last selected level set
+ SaveLevelSetup_LastSeries();
+ SaveLevelSetup_SeriesInfo();
+ }
+ else if (game_status == GAME_MODE_LEVELS &&
+ tree_type == TREE_TYPE_LEVEL_DIR)
+ {
+ // when adding new level set in level set menu, set cursor and update screen
+
+ leveldir_current = tree_node_new;
+
+ DrawChooseTree(&leveldir_current);
+ }
+ else if (game_status == GAME_MODE_SETUP)
+ {
+ // when adding new artwork set in setup menu, set cursor and update screen
+
+ if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS &&
+ tree_type == TREE_TYPE_GRAPHICS_DIR)
+ {
+ artwork.gfx_current = tree_node_new;
+
+ DrawChooseTree(&artwork.gfx_current);
+ }
+ else if (setup_mode == SETUP_MODE_CHOOSE_SOUNDS &&
+ tree_type == TREE_TYPE_SOUNDS_DIR)
+ {
+ artwork.snd_current = tree_node_new;
+
+ DrawChooseTree(&artwork.snd_current);
+ }
+ else if (setup_mode == SETUP_MODE_CHOOSE_MUSIC &&
+ tree_type == TREE_TYPE_MUSIC_DIR)
+ {
+ artwork.mus_current = tree_node_new;
+
+ DrawChooseTree(&artwork.mus_current);
+ }
+ }
+}
+
+static int UploadTapes(void)
+{
+ SetGameStatus(GAME_MODE_LOADING);
+
+ FadeSetEnterScreen();
+ FadeOut(REDRAW_ALL);
+
+ ClearRectangle(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE);
+
+ FadeIn(REDRAW_ALL);
+
+ DrawInitTextHead("Uploading tapes");
+
+ global.autoplay_mode = AUTOPLAY_MODE_UPLOAD;
+ global.autoplay_leveldir = "ALL";
+ global.autoplay_all = TRUE;
+
+ int num_tapes_uploaded = AutoPlayTapes();
+
+ global.autoplay_mode = AUTOPLAY_MODE_NONE;
+ global.autoplay_leveldir = NULL;
+ global.autoplay_all = FALSE;
+
+ SetGameStatus(GAME_MODE_MAIN);
+
+ DrawMainMenu();
+
+ return num_tapes_uploaded;
+}
+
+static boolean OfferUploadTapes(void)
+{
+ if (!Request("Upload all your tapes to the high score server now?", REQ_ASK))
+ return FALSE;
+
+ int num_tapes_uploaded = UploadTapes();
+ char message[100];
+
+ sprintf(message, "%d tapes uploaded!", num_tapes_uploaded);
+
+ Request(message, REQ_CONFIRM);
+
+ // after all tapes have been uploaded, remove entry from setup menu
+ setup.provide_uploading_tapes = FALSE;
+
+ SaveSetup();
+
+ return (num_tapes_uploaded > 0);
+}
+
+void CheckUploadTapes(void)
+{
+ if (!setup.ask_for_uploading_tapes)
+ return;
+
+ if (directoryExists(getTapeDir(NULL)))
+ {
+ boolean tapes_uploaded = OfferUploadTapes();
+
+ if (!tapes_uploaded)
+ 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;
+ }
+
+ // after asking for uploading all tapes once, do not ask again
+ setup.ask_for_uploading_tapes = FALSE;
+
+ SaveSetup();
+}