When adding a level group or an artwork group by dropping a zip file
into the program window, show a request dialog that the program has to
be restarted to activate the new content.
Unfortunately, this is currently required to rebuild the internal
level and artwork set structures (and should be improved to be rebuild
them on-the-fly without a program restart).
Before, the program was just stopped with a user-unfriendly message
reporting a fatal error.
// add extracted level or artwork set to tree info structure
AddTreeSetToTreeInfo(tree_node, directory, top_dir, tree_type);
+ // force restart after adding level collection
+ if (getTreeInfoFromIdentifier(TREE_FIRST_NODE(tree_type), top_dir) == NULL)
+ {
+ Request("Program must be restarted after adding a new level collection!",
+ REQ_CONFIRM);
+
+ CloseAllAndExit(0);
+ }
+
// update menu screen (and possibly change current level set)
DrawScreenAfterAddingSet(top_dir, tree_type);
TreeInfo *tree_node_new = getTreeInfoFromIdentifier(*tree_node_first,
tree_subdir_new);
+ // if not found, check if added node is level group or artwork group
+ if (tree_node_new == NULL)
+ tree_node_new = getTreeInfoFromIdentifierExt(*tree_node_first,
+ tree_subdir_new,
+ TREE_NODE_TYPE_GROUP);
+
if (tree_node_new == NULL) // should not happen
return FALSE;