+ // check and extract dropped zip files into correct user data directory
+ if (!strSuffixLower(filename, ".zip"))
+ {
+ Warn("file '%s' not supported", filename);
+
+ return TREE_TYPE_UNDEFINED;
+ }
+
+ TreeInfo *tree_node = NULL;
+ int tree_type = GetZipFileTreeType(filename);
+ char *directory = TREE_USERDIR(tree_type);
+
+ if (directory == NULL)
+ {
+ Warn("zip file '%s' has invalid content!", filename);
+
+ return TREE_TYPE_UNDEFINED;
+ }
+
+ if (tree_type == TREE_TYPE_LEVEL_DIR &&
+ game_status == GAME_MODE_LEVELS &&
+ leveldir_current->node_parent != NULL)
+ {
+ // extract new level set next to currently selected level set
+ tree_node = leveldir_current;
+
+ // get parent directory of currently selected level set directory
+ directory = getLevelDirFromTreeInfo(leveldir_current->node_parent);
+
+ // use private level directory instead of top-level package level directory
+ if (strPrefix(directory, options.level_directory) &&
+ strEqual(leveldir_current->node_parent->fullpath, "."))
+ directory = getUserLevelDir(NULL);
+ }
+
+ // extract level or artwork set from zip file to target directory
+ char *top_dir = ExtractZipFileIntoDirectory(filename, directory, tree_type);
+
+ if (top_dir == NULL)
+ {
+ // error message already issued by "ExtractZipFileIntoDirectory()"
+
+ return TREE_TYPE_UNDEFINED;
+ }
+
+ // add extracted level or artwork set to tree info structure
+ AddTreeSetToTreeInfo(tree_node, directory, top_dir, tree_type);
+
+ // update menu screen (and possibly change current level set)
+ DrawScreenAfterAddingSet(top_dir, tree_type);
+
+ return tree_type;
+}
+
+static void HandleDropTextEvent(char *text)
+{
+ Debug("event:droptext", "text == '%s'", text);
+}
+
+static void HandleDropCompleteEvent(int num_level_sets_succeeded,
+ int num_artwork_sets_succeeded,
+ int num_files_failed)
+{
+ // only show request dialog if no other request dialog already active
+ if (game.request_active)
+ return;