setString(&last_level_series[0], leveldir_current->identifier);
}
+static TreeInfo *StoreOrRestoreLastPlayedLevels(TreeInfo *node, boolean store)
+{
+ static char *identifier = NULL;
+
+ if (store)
+ {
+ setString(&identifier, (node && node->is_copy ? node->identifier : NULL));
+
+ return NULL; // not used
+ }
+ else
+ {
+ TreeInfo *node_new = getTreeInfoFromIdentifierExt(leveldir_first,
+ identifier,
+ TREE_NODE_TYPE_COPY);
+ return (node_new != NULL ? node_new : node);
+ }
+}
+
+void StoreLastPlayedLevels(TreeInfo *node)
+{
+ StoreOrRestoreLastPlayedLevels(node, TRUE);
+}
+
+void RestoreLastPlayedLevels(TreeInfo **node)
+{
+ *node = StoreOrRestoreLastPlayedLevels(*node, FALSE);
+}
+
void LoadLevelSetup_LastSeries(void)
{
// --------------------------------------------------------------------------
boolean CreateUserLevelSet(char *, char *, char *, int, boolean);
void UpdateLastPlayedLevels_TreeInfo(void);
+void StoreLastPlayedLevels(TreeInfo *);
+void RestoreLastPlayedLevels(TreeInfo **);
void LoadLevelSetup_LastSeries(void);
void SaveLevelSetup_LastSeries(void);
SaveLevelSetup_LastSeries();
SaveLevelSetup_SeriesInfo();
+ // restore level set if chosen from "last played level set" menu
+ RestoreLastPlayedLevels(&leveldir_current);
+
if (setup.internal.choose_from_top_leveldir)
gotoTopLevelDir();
HandleMainMenu_SelectLevel(0, 0, new_level_nr);
}
+ else if (game_status == GAME_MODE_LEVELS)
+ {
+ // store level set if chosen from "last played level set" menu
+ StoreLastPlayedLevels(leveldir_current);
+ }
else if (game_status == GAME_MODE_NAMES)
{
if (mx >= sx1_edit_name && mx <= sx2_edit_name)