From: Holger Schemel Date: Tue, 22 Jan 2019 00:18:52 +0000 (+0100) Subject: added selecting new level set if dropped as zip file into window X-Git-Tag: 4.1.2.0~46 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=be5bf9c7912238465ec23cec535277ebc1a4a21b;p=rocksndiamonds.git added selecting new level set if dropped as zip file into window --- diff --git a/src/events.c b/src/events.c index f33b3116..05d4b351 100644 --- a/src/events.c +++ b/src/events.c @@ -1546,7 +1546,23 @@ static void HandleDropFileEventExt(char *filename) 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(); + } + } } }