Bugfix: it was impossible to create a level subset in leveleditor cause Create button...
authorRicardo Cruz <rick2@aeiou.pt>
Mon, 25 Oct 2004 18:46:13 +0000 (18:46 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Mon, 25 Oct 2004 18:46:13 +0000 (18:46 +0000)
Bugfix: LevelSubset was saving subsets hide-from-contribs field wrongly, and couldn't load them.

SVN-Revision: 2063

src/level_subset.cpp
src/leveleditor.cpp

index fda5417..4b3378d 100644 (file)
@@ -150,7 +150,7 @@ LevelSubset::save()
       fprintf(fi,"  (description \"%s\")\n", description.c_str());
 
       /* Save the hide from Contrbis menu boolean: */
-      fprintf(fi,"  (hide-from-contribs \"%s\")\n", hide_from_contribs ? "#t" : "#f");
+      fprintf(fi,"  (hide-from-contribs %s)\n", hide_from_contribs ? "#t" : "#f");
 
       fprintf( fi,")");
       fclose(fi);
index 260c9d3..b861345 100644 (file)
@@ -268,9 +268,13 @@ while(SDL_PollEvent(&event))
       }
     else if(menu == create_subset_menu)
       {
+      // activate or deactivate Create button if any filename as been specified
       if(create_subset_menu->get_item_by_id(MN_ID_FILENAME_SUBSET).input[0] == '\0')
         create_subset_menu->get_item_by_id(MN_ID_CREATE_SUBSET).kind = MN_DEACTIVE;
-      else if(create_subset_menu->check() == MN_ID_CREATE_SUBSET)
+      else
+        create_subset_menu->get_item_by_id(MN_ID_CREATE_SUBSET).kind = MN_ACTION;
+
+      if(create_subset_menu->check() == MN_ID_CREATE_SUBSET)
         {   // applying settings:
         LevelSubset::create(create_subset_menu->get_item_by_id(MN_ID_FILENAME_SUBSET).input);