added marking nodes in "last played level sets" sub-tree as copy
authorHolger Schemel <info@artsoft.org>
Thu, 25 Feb 2021 18:36:56 +0000 (19:36 +0100)
committerHolger Schemel <info@artsoft.org>
Thu, 25 Feb 2021 18:38:44 +0000 (19:38 +0100)
src/libgame/setup.c
src/libgame/system.h

index d867ebbae239e3245939f2a063261ae83fc97b33..581aac21420c1ce6cb6a12f1a660ca31b52f68c9 100644 (file)
@@ -2520,6 +2520,7 @@ static void setTreeInfoToDefaults(TreeInfo *ti, int type)
   ti->sort_priority = LEVELCLASS_UNDEFINED;    // default: least priority
   ti->latest_engine = FALSE;                   // default: get from level
   ti->parent_link = FALSE;
+  ti->is_copy = FALSE;
   ti->in_user_dir = FALSE;
   ti->user_defined = FALSE;
   ti->color = 0;
@@ -2601,6 +2602,7 @@ static void setTreeInfoToDefaultsFromParent(TreeInfo *ti, TreeInfo *parent)
   ti->sort_priority = parent->sort_priority;
   ti->latest_engine = parent->latest_engine;
   ti->parent_link = FALSE;
+  ti->is_copy = FALSE;
   ti->in_user_dir = parent->in_user_dir;
   ti->user_defined = parent->user_defined;
   ti->color = parent->color;
@@ -2701,6 +2703,7 @@ static TreeInfo *getTreeInfoCopy(TreeInfo *ti)
 
   ti_copy->level_group         = ti->level_group;
   ti_copy->parent_link         = ti->parent_link;
+  ti_copy->is_copy             = ti->is_copy;
   ti_copy->in_user_dir         = ti->in_user_dir;
   ti_copy->user_defined                = ti->user_defined;
   ti_copy->readonly            = ti->readonly;
@@ -4561,6 +4564,8 @@ void UpdateLastPlayedLevels_TreeInfo(void)
     (*node_new)->node_top = &leveldir_first;   // correct top node link
     (*node_new)->node_parent = leveldir_last;  // correct parent node link
 
+    (*node_new)->is_copy = TRUE;               // mark entry as node copy
+
     (*node_new)->node_group = NULL;
     (*node_new)->next = NULL;
 
index ca8494bc46868c4b4d95c673260440ff6c02d77d..2db4961c53cbedd3c9d939c9e13339b8c7558025 100644 (file)
@@ -1565,6 +1565,7 @@ struct TreeInfo
 
   boolean level_group; // directory contains more level series directories
   boolean parent_link; // entry links back to parent directory
+  boolean is_copy;     // this entry is a copy of another entry in the tree
   boolean in_user_dir; // user defined levels are stored in home directory
   boolean user_defined;        // levels in user directory and marked as "private"
   boolean readonly;    // readonly levels can not be changed with editor