added parent link to custom artwork tree to go back to setup menu
authorHolger Schemel <info@artsoft.org>
Tue, 2 Feb 2021 16:55:57 +0000 (17:55 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 2 Feb 2021 16:55:57 +0000 (17:55 +0100)
src/libgame/setup.c
src/screens.c

index 192e2ce67e4d2b5307bdccf257e5ac9a4421563c..7c864576780e2164c0e50019ff96be61ace4c42e 100644 (file)
@@ -4068,6 +4068,9 @@ static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node)
   LoadArtworkInfoFromLevelInfoExt(artwork_node, NULL, leveldir_first_all, TRUE);
   LoadArtworkInfoFromLevelInfoExt(artwork_node, NULL, leveldir_first_all, FALSE);
 
+  // add top tree node over all three separate sub-trees
+  *artwork_node = createTopTreeInfoNode(*artwork_node);
+
   // set all parent links (back links) in complete artwork tree
   setTreeInfoParentNodes(*artwork_node, NULL);
 }
index a716f5eaf7d1941623ed04d66823ff637cbe8774..36125cd573a898de20f0abc1ce7b2a977f8df5ce 100644 (file)
@@ -4355,9 +4355,16 @@ static void DrawChooseTree(TreeInfo **ti_ptr)
 
   if (strEqual((*ti_ptr)->subdir, STRING_TOP_DIRECTORY))
   {
-    SetGameStatus(GAME_MODE_MAIN);
+    if (game_status == GAME_MODE_SETUP)
+    {
+      execSetupArtwork();
+    }
+    else       // GAME_MODE_LEVELS
+    {
+      SetGameStatus(GAME_MODE_MAIN);
 
-    DrawMainMenu();
+      DrawMainMenu();
+    }
 
     return;
   }