+ Error(ERR_DEBUG, "DROP FILE EVENT: '%s'", filename);
+
+ // check and extract dropped zip files into correct user data directory
+ if (strSuffixLower(filename, ".zip"))
+ {
+ int tree_type = GetZipFileTreeType(filename);
+ char *directory = TREE_USERDIR(tree_type);
+
+ if (directory == NULL)
+ {
+ Error(ERR_WARN, "zip file '%s' has invalid content!", filename);
+
+ return;
+ }
+
+ char *top_dir = ExtractZipFileIntoDirectory(filename, directory, tree_type);
+
+ if (top_dir != NULL)
+ {
+ AddUserTreeSetToTreeInfo(top_dir, tree_type);
+
+ // when adding new level set, select it as the new current level set
+ if (tree_type == TREE_TYPE_LEVEL_DIR)
+ {
+ // change current level set to newly added level set from zip file
+ leveldir_current = getTreeInfoFromIdentifier(leveldir_first, top_dir);
+
+ // change current level number to first level of newly added level set
+ level_nr = leveldir_current->first_level;
+
+ // when in main menu, redraw screen to reflect changed level set
+ if (game_status == GAME_MODE_MAIN)
+ DrawMainMenu();
+ }
+ }
+ }
+}
+
+static void HandleDropTextEventExt(char *text)
+{
+ Error(ERR_DEBUG, "DROP TEXT EVENT: '%s'", text);
+}
+
+void HandleDropFileEvent(Event *event)
+{
+ HandleDropFileEventExt(event->drop.file);
+
+ SDL_free(event->drop.file);
+}
+
+void HandleDropTextEvent(Event *event)
+{
+ HandleDropTextEventExt(event->drop.file);
+
+ SDL_free(event->drop.file);